From 52a78eed46c4a360e4701fa06bec40225687dba7 Mon Sep 17 00:00:00 2001 From: lainsce Date: Mon, 9 Jan 2023 18:17:06 -0300 Subject: [PATCH] fix a thing --- lib/Widgets/NavigationRail.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Widgets/NavigationRail.vala b/lib/Widgets/NavigationRail.vala index 900f79c9..43b7ac55 100644 --- a/lib/Widgets/NavigationRail.vala +++ b/lib/Widgets/NavigationRail.vala @@ -105,6 +105,18 @@ var button_child_label = new Gtk.Label (""); this._stack_pages.get_item (position).bind_property ("title", button_child_label, "label", SYNC_CREATE); + if (button.active) { + this._stack_pages.select_item (position, true); + if (((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name.contains ("-symbolic")) { + ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name = ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name.replace ("-filled",""); + ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name = ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name.replace ("-symbolic","-filled-symbolic"); + } else { + ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name = ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name.replace ("-filled",""); + ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name = ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name + "-filled-symbolic"; + } + } else { + ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name = ((Gtk.StackPage)this._stack_pages.get_item (position)).icon_name.replace ("-filled",""); + } var button_child = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); button_child.append (button_child_image);