[gnome-tweak-tool] extensions: Make placeholder actually show up



commit 3e95c359ec94d0de36389c19610c70725737767e
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jun 8 18:58:12 2017 +0200

    extensions: Make placeholder actually show up
    
    Tweak tool automatically filters out empty tweak groups, which means the
    extension tweak is hidden altogether when no extensions are installed
    rather than showing the placeholder as intended.
    Work around this by making the placeholder itself a tweak, so the group
    is never considered empty.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783563

 gtweak/tweaks/tweak_group_shell_extensions.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_shell_extensions.py b/gtweak/tweaks/tweak_group_shell_extensions.py
index e8c39f1..266dfce 100644
--- a/gtweak/tweaks/tweak_group_shell_extensions.py
+++ b/gtweak/tweaks/tweak_group_shell_extensions.py
@@ -33,11 +33,12 @@ def _fix_shell_version_for_ego(version):
 def _get_shell_major_minor_version(version):
     return '.'.join(version.split('.')[0:2])
 
-class _ExtensionsBlankState(Gtk.Box):
+class _ExtensionsBlankState(Gtk.Box, Tweak):
 
     def __init__(self):
         Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=18,
                                valign=Gtk.Align.CENTER)
+        Tweak.__init__(self, 'extensions', '')
 
         self.add(Gtk.Image(icon_name="gnome-tweak-tool-symbolic",
                  pixel_size=128, opacity=0.3))
@@ -247,7 +248,9 @@ class ShellExtensionTweakGroup(ListBoxTweakGroup):
         self.connect("row-activated", self._on_row_activated, None);
 
         if not len(extension_tweaks):
-            self.set_placeholder(_ExtensionsBlankState())
+            placeholder = _ExtensionsBlankState()
+            self.set_placeholder(placeholder)
+            self.tweaks.append(placeholder)
 
     def _got_info(self, ego, resp, uuid, extension, widget):
         if uuid == extension["uuid"]:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]