[gnome-system-monitor/wip/newdesign] Fixed memory and swap picker alignment issues



commit dfca3f8be3ee4f084c0f873bda6f41cdd3dfbf80
Author: Robert Roth <robert roth off gmail com>
Date:   Thu Aug 15 18:36:50 2013 +0300

    Fixed memory and swap picker alignment issues

 data/interface.ui  |   32 +++++++++++++++++---------------
 src/interface.cpp  |    8 ++++----
 src/load-graph.cpp |    2 +-
 3 files changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/data/interface.ui b/data/interface.ui
index ea2836e..f6e2e47 100644
--- a/data/interface.ui
+++ b/data/interface.ui
@@ -300,7 +300,7 @@
                       <object class="GtkBox" id="mem_label_box">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">30</property>
+                        <property name="margin_right">56</property>
                         <property name="orientation">horizontal</property>
                         <child>
                           <object class="GtkLabel" id="mem_label">
@@ -322,35 +322,34 @@
                           <object class="GtkGrid" id="mem_table">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="hexpand">True</property>
-                            <property name="row_spacing">6</property>
+                            <property name="column_homogeneous">True</property>
                             <property name="column_spacing">6</property>
-                            <property name="row_homogeneous">True</property>
                             <child>
                               <object class="GtkLabel" id="memory_label">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="hexpand">True</property>
-                                <property name="xalign">0</property>
+                                <property name="xalign">1</property>
                                 <property name="label" translatable="yes">Memory</property>
                               </object>
                               <packing>
-                                <property name="left_attach">1</property>
+                                <property name="left_attach">0</property>
                                 <property name="top_attach">0</property>
                                 <property name="width">1</property>
                                 <property name="height">1</property>
                               </packing>
                             </child>
                             <child>
+                              <placeholder/>
+                            </child>
+                            <child>
                               <object class="GtkLabel" id="swap_label">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="hexpand">True</property>
-                                <property name="xalign">0</property>
+                                <property name="xalign">1</property>
                                 <property name="label" translatable="yes">Swap</property>
                               </object>
                               <packing>
-                                <property name="left_attach">3</property>
+                                <property name="left_attach">2</property>
                                 <property name="top_attach">0</property>
                                 <property name="width">1</property>
                                 <property name="height">1</property>
@@ -359,12 +358,9 @@
                             <child>
                               <placeholder/>
                             </child>
-                            <child>
-                              <placeholder/>
-                            </child>
                           </object>
                           <packing>
-                            <property name="expand">True</property>
+                            <property name="expand">False</property>
                             <property name="fill">True</property>
                             <property name="pack_type">end</property>
                             <property name="position">1</property>
@@ -438,7 +434,6 @@
                             <property name="can_focus">False</property>
                             <property name="row_spacing">6</property>
                             <property name="column_spacing">6</property>
-                            <property name="row_homogeneous">True</property>
                             <property name="column_homogeneous">True</property>
                             <child>
                               <object class="GtkLabel" id="receiving_label">
@@ -538,5 +533,12 @@
       </object>
     </child>
   </object>
+  <object class="GtkSizeGroup" id="explabels">
+    <widgets>
+      <widget name="net_table"/>
+      <widget name="cpu_table"/>
+      <widget name="mem_table"/>
+    </widgets>
+  </object>
 
 </interface>
diff --git a/src/interface.cpp b/src/interface.cpp
index 9e91e39..99db784 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -252,8 +252,8 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
 
     label = GTK_WIDGET(gtk_builder_get_object(builder, "memory_label"));
     gtk_widget_set_size_request(GTK_WIDGET(color_picker), 100, 28);
-    gtk_grid_attach_next_to (GTK_GRID (table), color_picker, label, GTK_POS_LEFT, 1, 1);
-    gtk_grid_attach_next_to (GTK_GRID (table), load_graph_get_labels(mem_graph)->memory, label, 
GTK_POS_BOTTOM, 1, 1);
+    gtk_grid_attach_next_to (GTK_GRID (table), color_picker, label, GTK_POS_RIGHT, 1, 1);
+//    gtk_grid_attach_next_to (GTK_GRID (table), load_graph_get_labels(mem_graph)->memory, label, 
GTK_POS_BOTTOM, 1, 1);
 
     color_picker = load_graph_get_swap_color_picker(mem_graph);
     g_signal_connect (G_OBJECT (color_picker), "color-set",
@@ -264,8 +264,8 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
 
     label = GTK_WIDGET(gtk_builder_get_object(builder, "swap_label"));
     gtk_widget_set_size_request(GTK_WIDGET(color_picker), 100, 28);
-    gtk_grid_attach_next_to (GTK_GRID (table), color_picker, label, GTK_POS_LEFT, 1, 1);
-    gtk_grid_attach_next_to (GTK_GRID (table), load_graph_get_labels(mem_graph)->swap, label, 
GTK_POS_BOTTOM, 1, 1);
+    gtk_grid_attach_next_to (GTK_GRID (table), color_picker, label, GTK_POS_RIGHT, 1, 1);
+//    gtk_grid_attach_next_to (GTK_GRID (table), load_graph_get_labels(mem_graph)->swap, label, 
GTK_POS_BOTTOM, 1, 1);
 
     app->mem_graph = mem_graph;
 
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 78c40fc..f09419a 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -377,7 +377,7 @@ namespace
 
         if (picker) {
             gsm_color_button_set_fraction(picker, percent);
-            text = total == 0? g_strdup(_("not available")):g_strdup_printf("%.1f%%", 100 * percent);
+            text = total == 0? g_strdup(_("N/A")):g_strdup_printf("%.1f%%", 100 * percent);
             gsm_color_button_set_text(picker, text);
             g_free (text);
         } 


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