[empathy: 1/7] ChatroomsWindow: GNOME 3-ify the Remove button



commit 9f79b7c5d74f1a82387881121403e755757f8cb3
Author: Will Thompson <will thompson collabora co uk>
Date:   Fri Jun 24 15:02:58 2011 +0100

    ChatroomsWindow: GNOME 3-ify the Remove button

 src/empathy-chatrooms-window.c  |   10 +++++
 src/empathy-chatrooms-window.ui |   70 ++++++++++++++++++++++++--------------
 2 files changed, 54 insertions(+), 26 deletions(-)
---
diff --git a/src/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c
index 1b00548..1ebe80b 100644
--- a/src/empathy-chatrooms-window.c
+++ b/src/empathy-chatrooms-window.c
@@ -97,6 +97,8 @@ empathy_chatrooms_window_show (GtkWindow *parent)
 	static EmpathyChatroomsWindow *window = NULL;
 	GtkBuilder                    *gui;
 	gchar                         *filename;
+	GtkWidget                     *sw, *toolbar;
+	GtkStyleContext               *context;
 
 	if (window) {
 		gtk_window_present (GTK_WINDOW (window->window));
@@ -110,12 +112,20 @@ empathy_chatrooms_window_show (GtkWindow *parent)
 				       "chatrooms_window", &window->window,
 				       "hbox_account", &window->hbox_account,
 				       "label_account", &window->label_account,
+				       "sw_room_list", &sw,
 				       "treeview", &window->treeview,
+				       "toolbar_remove", &toolbar,
 				       "button_remove", &window->button_remove,
 				       "button_close", &window->button_close,
 				       NULL);
 	g_free (filename);
 
+	/* join the remove toolbar to the treeview */
+	context = gtk_widget_get_style_context (sw);
+	gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
+	context = gtk_widget_get_style_context (toolbar);
+	gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
+
 	empathy_builder_connect (gui, window,
 			      "chatrooms_window", "destroy", chatrooms_window_destroy_cb,
 			      "button_remove", "clicked", chatrooms_window_button_remove_clicked_cb,
diff --git a/src/empathy-chatrooms-window.ui b/src/empathy-chatrooms-window.ui
index 83f3fd0..973f66e 100644
--- a/src/empathy-chatrooms-window.ui
+++ b/src/empathy-chatrooms-window.ui
@@ -37,24 +37,57 @@
               </packing>
             </child>
             <child>
-              <object class="GtkScrolledWindow" id="scrolledwindow1">
-                <property name="height_request">150</property>
+              <object class="GtkVBox" id="box_room_list">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-                <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                <property name="shadow_type">GTK_SHADOW_IN</property>
                 <child>
-                  <object class="GtkTreeView" id="treeview">
+                  <object class="GtkScrolledWindow" id="sw_room_list">
+                    <property name="height_request">150</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="has_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                    <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_IN</property>
+                    <child>
+                      <object class="GtkTreeView" id="treeview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_focus">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolbar" id="toolbar_remove">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="icon_size">1</property>
+                    <style>
+                      <class name="inline-toolbar"/>
+                    </style>
+                    <child>
+                      <object class="GtkToolButton" id="button_remove">
+                        <property name="tooltip-text" translatable="yes">Remove</property>
+                        <property name="visible">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="stock_id">gtk-remove</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="homogeneous">True</property>
+                      </packing>
+                    </child>
                   </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
             </child>
           </object>
         </child>
@@ -64,21 +97,6 @@
             <property name="spacing">6</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button_remove">
-                <property name="label">gtk-remove</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkButton" id="button_close">
                 <property name="label">gtk-close</property>
                 <property name="visible">True</property>



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