[gnome-color-manager] trivial: use the inline-toolbar style in gcm-viewer
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: use the inline-toolbar style in gcm-viewer
- Date: Mon, 28 Mar 2011 22:02:31 +0000 (UTC)
commit bee357a2238a4cb609e6906e430348b985f719e5
Author: Richard Hughes <richard hughsie com>
Date: Mon Mar 28 23:01:48 2011 +0100
trivial: use the inline-toolbar style in gcm-viewer
data/gcm-viewer.ui | 37 ++++++++++++++++++++-----------------
src/gcm-viewer.c | 19 ++++++++++++++++---
2 files changed, 36 insertions(+), 20 deletions(-)
---
diff --git a/data/gcm-viewer.ui b/data/gcm-viewer.ui
index 3ba2614..984a2fb 100644
--- a/data/gcm-viewer.ui
+++ b/data/gcm-viewer.ui
@@ -22,9 +22,8 @@
<object class="GtkVBox" id="vbox_profiles">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="scrolledwindow_profiles">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
@@ -47,44 +46,48 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox45">
+ <object class="GtkToolbar" id="toolbar_profiles">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="show_arrow">False</property>
+ <property name="icon_size">1</property>
<child>
- <object class="GtkButton" id="button_profile_import">
- <property name="label" translatable="yes">_Addâ?¦</property>
+ <object class="GtkToolButton" id="toolbutton_profile_import">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can_focus">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup" translatable="yes">Add a profile for the device</property>
+ <property name="tooltip_text">Add a profile for the device</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="icon_name">list-add-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="homogeneous">True</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="button_profile_delete">
- <property name="label" translatable="yes">_Remove</property>
+ <object class="GtkToolButton" id="toolbutton_profile_delete">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup" translatable="yes">Remove a profile from the device</property>
+ <property name="tooltip_text">Remove a profile from the device</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="icon_name">list-remove-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 7756422..4ad1c6a 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -856,7 +856,7 @@ gcm_viewer_profiles_treeview_clicked_cb (GtkTreeSelection *selection, GcmViewerP
/* set delete sensitivity */
ret = gcm_profile_get_can_delete (gcm_profile);
- widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "button_profile_delete"));
+ widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "toolbutton_profile_delete"));
gtk_widget_set_sensitive (widget, ret);
if (ret) {
/* TRANSLATORS: this is the tooltip when the profile can be deleted */
@@ -975,6 +975,7 @@ gcm_viewer_startup_cb (GApplication *application, GcmViewerPrivate *viewer)
GtkTreeSelection *selection;
GtkWidget *main_window;
GtkWidget *widget;
+ GtkStyleContext *context;
/* setup defaults */
viewer->settings = g_settings_new (GCM_SETTINGS_SCHEMA);
@@ -1038,11 +1039,11 @@ gcm_viewer_startup_cb (GApplication *application, GcmViewerPrivate *viewer)
G_CALLBACK (gcm_viewer_drag_data_received_cb), viewer);
gcm_viewer_setup_drag_and_drop (GTK_WIDGET(main_window));
- widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "button_profile_delete"));
+ widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "toolbutton_profile_delete"));
g_signal_connect (widget, "clicked",
G_CALLBACK (gcm_viewer_profile_delete_cb), viewer);
gtk_widget_set_sensitive (widget, FALSE);
- widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "button_profile_import"));
+ widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "toolbutton_profile_import"));
g_signal_connect (widget, "clicked",
G_CALLBACK (gcm_viewer_profile_import_cb), viewer);
@@ -1102,6 +1103,18 @@ gcm_viewer_startup_cb (GApplication *application, GcmViewerPrivate *viewer)
gcm_viewer_set_example_image (viewer, GTK_IMAGE (viewer->preview_widget_output));
gtk_widget_set_visible (viewer->preview_widget_output, TRUE);
+ /* make profiles toolbar sexy */
+ widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder,
+ "scrolledwindow_profiles"));
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
+
+ widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder,
+ "toolbar_profiles"));
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_INLINE_TOOLBAR);
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
+
/* show main UI */
gtk_widget_show (main_window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]