[gnome-disk-utility/udisks2-port] Split drive label into two widgets



commit 77494eaa9ec0b7eab76953f80aa6679da4ed0b45
Author: David Zeuthen <davidz redhat com>
Date:   Wed Sep 21 06:19:50 2011 -0400

    Split drive label into two widgets
    
    Apparently this is different on GTK+ 3.1.x compared to GTK+ 3.0.x.
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 data/ui/palimpsest.ui      |   62 ++++++++++++++++++++++++++++++++------------
 src/palimpsest/gduwindow.c |   25 ++++++++++++-----
 2 files changed, 62 insertions(+), 25 deletions(-)
---
diff --git a/data/ui/palimpsest.ui b/data/ui/palimpsest.ui
index 96a5507..6d816ff 100644
--- a/data/ui/palimpsest.ui
+++ b/data/ui/palimpsest.ui
@@ -264,23 +264,6 @@
                     <property name="n_columns">2</property>
                     <property name="column_spacing">10</property>
                     <child>
-                      <object class="GtkLabel" id="devtab-drive-value-label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="xalign">0</property>
-                        <property name="selectable">True</property>
-                        <property name="ellipsize">end</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                        <property name="y_padding">4</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkLabel" id="devtab-model-label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -478,6 +461,51 @@
                         <property name="y_padding">4</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkVBox" id="devtab-drive-vbox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkLabel" id="devtab-drive-name-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="xalign">0</property>
+                            <property name="selectable">True</property>
+                            <property name="ellipsize">end</property>
+                            <property name="single_line_mode">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="devtab-drive-devices-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="xalign">0</property>
+                            <property name="selectable">True</property>
+                            <property name="ellipsize">end</property>
+                            <property name="single_line_mode">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                        <property name="y_padding">4</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index d75fe88..403b3a1 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -70,7 +70,9 @@ struct _GduWindow
   GtkWidget *device_toolbar;
   GtkWidget *device_toolbar_attach_disk_image_button;
   GtkWidget *device_toolbar_detach_disk_image_button;
-  GtkWidget *devtab_drive_value_label;
+  GtkWidget *devtab_drive_vbox;
+  GtkWidget *devtab_drive_name_label;
+  GtkWidget *devtab_drive_devices_label;
   GtkWidget *devtab_drive_image;
   GtkWidget *devtab_table;
   GtkWidget *devtab_drive_table;
@@ -109,7 +111,9 @@ static const struct {
   {G_STRUCT_OFFSET (GduWindow, device_treeview), "device-tree-treeview"},
   {G_STRUCT_OFFSET (GduWindow, details_notebook), "palimpsest-notebook"},
   {G_STRUCT_OFFSET (GduWindow, devtab_drive_table), "devtab-drive-table"},
-  {G_STRUCT_OFFSET (GduWindow, devtab_drive_value_label), "devtab-drive-value-label"},
+  {G_STRUCT_OFFSET (GduWindow, devtab_drive_vbox), "devtab-drive-vbox"},
+  {G_STRUCT_OFFSET (GduWindow, devtab_drive_name_label), "devtab-drive-name-label"},
+  {G_STRUCT_OFFSET (GduWindow, devtab_drive_devices_label), "devtab-drive-devices-label"},
   {G_STRUCT_OFFSET (GduWindow, devtab_drive_image), "devtab-drive-image"},
   {G_STRUCT_OFFSET (GduWindow, devtab_table), "devtab-table"},
   {G_STRUCT_OFFSET (GduWindow, devtab_grid_hbox), "devtab-grid-hbox"},
@@ -1401,14 +1405,19 @@ update_device_page_for_drive (GduWindow      *window,
         g_string_append_c (str, ' ');
       g_string_append (str, udisks_block_get_preferred_device (udisks_object_peek_block (block_object)));
     }
-  s = g_strdup_printf ("<big><b>%s</b></big>\n"
-                       "<small><span foreground=\"#555555\">%s</span></small>",
-                       description,
+  s = g_strdup_printf ("<big><b>%s</b></big>",
+                       description);
+  gtk_label_set_markup (GTK_LABEL (window->devtab_drive_name_label), s);
+  gtk_widget_show (window->devtab_drive_name_label);
+  g_free (s);
+  s = g_strdup_printf ("<small><span foreground=\"#555555\">%s</span></small>",
                        str->str);
-  g_string_free (str, TRUE);
-  gtk_label_set_markup (GTK_LABEL (window->devtab_drive_value_label), s);
-  gtk_widget_show (window->devtab_drive_value_label);
+  gtk_label_set_markup (GTK_LABEL (window->devtab_drive_devices_label), s);
+  gtk_widget_show (window->devtab_drive_devices_label);
   g_free (s);
+  g_string_free (str, TRUE);
+  gtk_widget_show (window->devtab_drive_vbox);
+
   if (media_icon != NULL)
     gtk_image_set_from_gicon (GTK_IMAGE (window->devtab_drive_image), media_icon, GTK_ICON_SIZE_DIALOG);
   else



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