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

@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
@ -11,6 +11,8 @@ use gtk::CompositeTemplate;
pub struct EchidnaWindow {
#[template_child]
pub notebook: TemplateChild<gtk::Notebook>,
#[template_child]
pub sidebar: TemplateChild<super::super::sidebar::EchidnaSidebar>,
}
#[glib::object_subclass]
@ -19,7 +21,6 @@ impl ObjectSubclass for EchidnaWindow {
type Type = super::EchidnaWindow;
type ParentType = gtk::ApplicationWindow;
fn class_init(class: &mut Self::Class) {
Self::bind_template(class);
}

View File

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