feat: use EchidnaSidebar in window ui file

merge-requests/8/head
Nefo Fortressia 2021-10-28 17:19:33 +07:00
parent 6144feb857
commit 6ad708cfc1
2 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,8 @@ use gtk::CompositeTemplate;
pub struct EchidnaWindow { pub struct EchidnaWindow {
#[template_child] #[template_child]
pub notebook: TemplateChild<gtk::Notebook>, pub notebook: TemplateChild<gtk::Notebook>,
#[template_child]
pub sidebar: TemplateChild<super::super::sidebar::EchidnaSidebar>,
} }
#[glib::object_subclass] #[glib::object_subclass]
@ -19,7 +21,6 @@ impl ObjectSubclass for EchidnaWindow {
type Type = super::EchidnaWindow; type Type = super::EchidnaWindow;
type ParentType = gtk::ApplicationWindow; type ParentType = gtk::ApplicationWindow;
fn class_init(class: &mut Self::Class) { fn class_init(class: &mut Self::Class) {
Self::bind_template(class); Self::bind_template(class);
} }

View File

@ -15,7 +15,7 @@
<object class="GtkBox" id="bars-box"> <object class="GtkBox" id="bars-box">
<property name="vexpand">1</property> <property name="vexpand">1</property>
<child> <child>
<object class="GtkStackSidebar" id="sidebar"></object> <object class="EchidnaSidebar" id="sidebar"></object>
</child> </child>
<child> <child>
<placeholder /> <placeholder />
@ -26,6 +26,7 @@
<child> <child>
--> -->
<object class="GtkNotebook" id="notebook"> <object class="GtkNotebook" id="notebook">
<property name="hexpand">1</property>
<child> <child>
<object id="getting-started" class="GtkLabel"> <object id="getting-started" class="GtkLabel">
<property name="label">Hello from Echidna!</property> <property name="label">Hello from Echidna!</property>