[sysprof/wip/chergert/timechart: 2/2] window: tweak controls add include timechart widget



commit 3d66b8810e0483da6acc1511ab8152dfd3749229
Author: Christian Hergert <chergert redhat com>
Date:   Sun May 20 19:30:23 2018 -0700

    window: tweak controls add include timechart widget

 lib/visualizers/sp-visualizer-list.c |    2 +-
 src/resources/theme/shared.css       |    8 ++
 src/resources/ui/sp-window.ui        |  170 +++++++++++++++++++++-------------
 3 files changed, 113 insertions(+), 67 deletions(-)
---
diff --git a/lib/visualizers/sp-visualizer-list.c b/lib/visualizers/sp-visualizer-list.c
index e99f7de..c37efbb 100644
--- a/lib/visualizers/sp-visualizer-list.c
+++ b/lib/visualizers/sp-visualizer-list.c
@@ -311,7 +311,7 @@ handle_capture_results (GObject      *object,
           GtkWidget *row = g_object_new (SP_TYPE_MARK_VISUALIZER_ROW,
                                          "group", key,
                                          "title", key,
-                                         "height-request", 50,
+                                         "height-request", 35,
                                          "selectable", FALSE,
                                          "visible", TRUE,
                                          NULL);
diff --git a/src/resources/theme/shared.css b/src/resources/theme/shared.css
index 6649549..aa9951d 100644
--- a/src/resources/theme/shared.css
+++ b/src/resources/theme/shared.css
@@ -23,3 +23,11 @@ visualizers list row:last-child {
 ticks {
   color: alpha(@theme_fg_color, 0.4);
 }
+
+box.controls {
+  margin: 4px;
+}
+
+box.controls button {
+  padding: 0;
+}
diff --git a/src/resources/ui/sp-window.ui b/src/resources/ui/sp-window.ui
index 0bd7b6d..b7246ca 100644
--- a/src/resources/ui/sp-window.ui
+++ b/src/resources/ui/sp-window.ui
@@ -172,9 +172,111 @@
                   </object>
                 </child>
                 <child>
-                  <object class="SpCallgraphView" id="callgraph_view">
+                  <object class="GtkBox">
+                    <property name="orientation">horizontal</property>
+                    <property name="vexpand">false</property>
                     <property name="visible">true</property>
-                    <property name="vexpand">true</property>
+                    <style>
+                      <class name="controls"/>
+                    </style>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="orientation">horizontal</property>
+                        <property name="halign">start</property>
+                        <property name="hexpand">false</property>
+                        <property name="visible">true</property>
+                        <style>
+                          <class name="linked"/>
+                        </style>
+                        <child>
+                          <object class="GtkButton">
+                            <property name="action-name">zoom.zoom-out</property>
+                            <property name="hexpand">true</property>
+                            <property name="tooltip-text" translatable="yes">Zoom out (Ctrl+-)</property>
+                            <property name="visible">true</property>
+                            <style>
+                              <class name="image-button"/>
+                            </style>
+                            <child>
+                              <object class="GtkImage">
+                                <property name="icon-name">zoom-out-symbolic</property>
+                                <property name="visible">true</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkButton">
+                            <property name="action-name">zoom.zoom-one</property>
+                            <property name="tooltip-text" translatable="yes">Reset zoom level 
(Ctrl+0)</property>
+                            <property name="visible">true</property>
+                            <child>
+                              <object class="GtkLabel" id="zoom_one_label">
+                                <property name="width-chars">5</property>
+                                <property name="visible">true</property>
+                                <property name="margin-left">8</property>
+                                <property name="margin-right">8</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkButton">
+                            <property name="action-name">zoom.zoom-in</property>
+                            <property name="hexpand">true</property>
+                            <property name="tooltip-text" translatable="yes">Zoom in (Ctrl++)</property>
+                            <property name="visible">true</property>
+                            <style>
+                              <class name="image-button"/>
+                            </style>
+                            <child>
+                              <object class="GtkImage">
+                                <property name="icon-name">zoom-in-symbolic</property>
+                                <property name="visible">true</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="center">
+                      <object class="GtkStackSwitcher">
+                        <style>
+                          <class name="views"/>
+                        </style>
+                        <property name="halign">center</property>
+                        <property name="stack">data_stack</property>
+                        <property name="vexpand">false</property>
+                        <property name="visible">true</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkStack" id="data_stack">
+                    <property name="expand">true</property>
+                    <property name="transition-type">crossfade</property>
+                    <property name="visible">true</property>
+                    <child>
+                      <object class="SpCallgraphView" id="callgraph_view">
+                        <property name="visible">true</property>
+                        <property name="expand">true</property>
+                      </object>
+                      <packing>
+                        <property name="name">callgraph</property>
+                        <property name="title" translatable="yes">Callgraph</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="SpTimechartView" id="timechart_view">
+                        <property name="visible">true</property>
+                        <property name="expand">true</property>
+                      </object>
+                      <packing>
+                        <property name="name">timechart</property>
+                        <property name="title" translatable="yes">Timechart</property>
+                      </packing>
+                    </child>
                   </object>
                 </child>
               </object>
@@ -198,70 +300,6 @@
         <property name="orientation">vertical</property>
         <property name="visible">true</property>
         <child>
-          <object class="GtkBox">
-            <property name="hexpand">true</property>
-            <property name="orientation">horizontal</property>
-            <property name="visible">true</property>
-            <style>
-              <class name="linked"/>
-            </style>
-            <child>
-              <object class="GtkButton">
-                <property name="action-name">zoom.zoom-out</property>
-                <property name="hexpand">true</property>
-                <property name="tooltip-text" translatable="yes">Zoom out (Ctrl+-)</property>
-                <property name="visible">true</property>
-                <style>
-                  <class name="image-button"/>
-                </style>
-                <child>
-                  <object class="GtkImage">
-                    <property name="icon-name">zoom-out-symbolic</property>
-                    <property name="visible">true</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkButton">
-                <property name="action-name">zoom.zoom-one</property>
-                <property name="tooltip-text" translatable="yes">Reset zoom level (Ctrl+0)</property>
-                <property name="visible">true</property>
-                <child>
-                  <object class="GtkLabel" id="zoom_one_label">
-                    <property name="width-chars">5</property>
-                    <property name="visible">true</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkButton">
-                <property name="action-name">zoom.zoom-in</property>
-                <property name="hexpand">true</property>
-                <property name="tooltip-text" translatable="yes">Zoom in (Ctrl++)</property>
-                <property name="visible">true</property>
-                <style>
-                  <class name="image-button"/>
-                </style>
-                <child>
-                  <object class="GtkImage">
-                    <property name="icon-name">zoom-in-symbolic</property>
-                    <property name="visible">true</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="GtkSeparator">
-            <property name="orientation">horizontal</property>
-            <property name="margin-top">6</property>
-            <property name="visible">true</property>
-          </object>
-        </child>
-        <child>
           <object class="GtkModelButton">
             <property name="action-name">win.open-capture</property>
             <property name="text" translatable="yes">Open</property>


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