[sysprof] menu-button: hide the process list when whole-system is enabled



commit 9e082a257df2b8055f2fe2635ba111601083b163
Author: Christian Hergert <christian hergert me>
Date:   Sat Apr 16 18:21:26 2016 -0700

    menu-button: hide the process list when whole-system is enabled
    
    No sense in showing a desensitized widget that cannot be toggled except
    for discover-ability. But progressive disclosure is probably better.

 lib/resources/ui/sp-profiler-menu-button.ui |   42 ++++++++++++++++-----------
 lib/sp-profiler-menu-button.c               |    2 +-
 2 files changed, 26 insertions(+), 18 deletions(-)
---
diff --git a/lib/resources/ui/sp-profiler-menu-button.ui b/lib/resources/ui/sp-profiler-menu-button.ui
index 38a1537..51fd914 100644
--- a/lib/resources/ui/sp-profiler-menu-button.ui
+++ b/lib/resources/ui/sp-profiler-menu-button.ui
@@ -45,9 +45,11 @@
         </child>
         <child>
           <object class="GtkBox">
+            <property name="width-request">425</property>
             <property name="visible">true</property>
             <property name="hexpand">true</property>
             <property name="margin">10</property>
+            <property name="spacing">12</property>
             <child type="center">
               <object class="GtkLabel">
                 <property name="hexpand">true</property>
@@ -76,28 +78,34 @@
             <property name="visible">true</property>
             <property name="border-width">10</property>
             <child>
-              <object class="GtkBox" id="processes_box">
-                <property name="orientation">vertical</property>
+              <object class="GtkBox">
+                <!-- box with single child is used so we can toggle visibility of the child -->
                 <property name="visible">true</property>
-                <style>
-                  <class name="linked"/>
-                </style>
                 <child>
-                  <object class="GtkEntry" id="process_filter_entry">
-                    <property name="placeholder-text" translatable="yes">Search</property>
-                    <property name="visible">true</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="SpScrolledWindow">
-                    <property name="min-content-width">100</property>
-                    <property name="max-content-width">400</property>
-                    <property name="max-content-height">450</property>
-                    <property name="shadow-type">in</property>
+                  <object class="GtkBox" id="processes_box">
+                    <property name="orientation">vertical</property>
                     <property name="visible">true</property>
+                    <style>
+                      <class name="linked"/>
+                    </style>
+                    <child>
+                      <object class="GtkEntry" id="process_filter_entry">
+                        <property name="placeholder-text" translatable="yes">Search</property>
+                        <property name="visible">true</property>
+                      </object>
+                    </child>
                     <child>
-                      <object class="GtkListBox" id="process_list_box">
+                      <object class="SpScrolledWindow">
+                        <property name="min-content-width">100</property>
+                        <property name="max-content-width">400</property>
+                        <property name="max-content-height">450</property>
+                        <property name="shadow-type">in</property>
                         <property name="visible">true</property>
+                        <child>
+                          <object class="GtkListBox" id="process_list_box">
+                            <property name="visible">true</property>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/lib/sp-profiler-menu-button.c b/lib/sp-profiler-menu-button.c
index b7971cc..288104f 100644
--- a/lib/sp-profiler-menu-button.c
+++ b/lib/sp-profiler-menu-button.c
@@ -203,7 +203,7 @@ sp_profiler_menu_button_connect (SpProfilerMenuButton *self)
 
   add_binding (&priv->list_sensitive_binding,
                priv->profiler, "whole-system",
-               priv->processes_box, "sensitive",
+               priv->processes_box, "visible",
                G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
 
   add_binding (&priv->inherit_binding,


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