From f63252cd97a28d3c5467f1c05ba7c7696bba7697 Mon Sep 17 00:00:00 2001 From: papajoker Date: Wed, 27 Nov 2019 21:44:44 +0100 Subject: [PATCH] set UI btns with one or 2 plugins --- src/manjaro_hello.py | 33 ++++++++++++++++------ ui/manjaro-hello.glade | 64 ++++++++++++++++++++++++++++-------------- 2 files changed, 67 insertions(+), 30 deletions(-) diff --git a/src/manjaro_hello.py b/src/manjaro_hello.py index af88ac8..67ae21a 100644 --- a/src/manjaro_hello.py +++ b/src/manjaro_hello.py @@ -74,7 +74,7 @@ class Hello(Gtk.Window): widget.get_image_position() is Gtk.PositionType.RIGHT: img = Gtk.Image.new_from_file( self.preferences["data_path"] + "img/external-link.png") - img.set_margin_left(2) + img.set_margin_start(2) widget.set_image(img) # Create pages @@ -106,18 +106,33 @@ class Hello(Gtk.Window): # Installed systems else: if APPS_PLUGIN: - conf = HelloConfig(application="manjaro-hello") - app_browser = ApplicationBrowser(conf, self) - # create page install Applications - self.builder.get_object("stack").add_named(app_browser, "appBrowserpage") - self.builder.get_object("appBrowser").set_visible(True) + try: + conf = HelloConfig(application="manjaro-hello") + app_browser = ApplicationBrowser(conf, self) + # create page install Applications + self.builder.get_object("stack").add_named(app_browser, "appBrowserpage") + self.builder.get_object("appBrowser").set_visible(True) + except Exception as err: + print("Error Application utility:", err) try: + #self.builder.get_object("appBrowser").set_visible(True) # for test with 2 btns from layoutswitcherlib.layoutsbox import LayoutBox - app_layout = LayoutBox(self, usehello=True) - self.builder.get_object("stack").add_named(app_layout, "appLayoutspage") - self.builder.get_object("appLayouts").set_visible(True) # show btn in UI + try: + app_layout = LayoutBox(self, usehello=True) + self.builder.get_object("stack").add_named(app_layout, "appLayoutspage") + if not self.builder.get_object("appBrowser").props.visible: #if APPS_PLUGIN: + btn = self.builder.get_object("appLayouts") + btn.set_margin_start(200) + btn.set_margin_end(200) + self.builder.get_object("appLayouts").set_visible(True) # show btn in UI + except Exception as err: + print("Error Gnome Manager:", err) except ModuleNotFoundError as e: print(f"Info: Application Gnome Layout Switcher plugin not found : {e}") + if self.builder.get_object("appBrowser").props.visible and not self.builder.get_object("appLayouts").props.visible: #if : + btn = self.builder.get_object("appBrowser") + btn.set_margin_start(200) + btn.set_margin_end(200) self.window.show() diff --git a/ui/manjaro-hello.glade b/ui/manjaro-hello.glade index 519b181..00f31da 100644 --- a/ui/manjaro-hello.glade +++ b/ui/manjaro-hello.glade @@ -503,25 +503,53 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we - - Applications - appBrowser + False - True - Common application selection - - - - Layouts switcher - appLayouts - False - True - Manjaro Gnone config tool - + True + boxPlugins + 0 + True + + + Applications + appBrowser + False + False + True + Common application selection + 15 + 15 + + + + True + True + 0 + + + + + Gnome Layouts Manager + appLayouts + False + False + True + Manjaro Gnone config tool + 15 + 15 + + + + False + True + 1 + + - 1 + 0 8 + 3 @@ -530,12 +558,6 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we - - - - - - homepage