[gthumb] Show the slideshow preferences in the viewer tab to save some horizontal space
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] Show the slideshow preferences in the viewer tab to save some horizontal space
- Date: Tue, 8 Nov 2011 13:36:50 +0000 (UTC)
commit 8c70bf237896fb6a1cfbf9aa54e9b4c5afe013cf
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Nov 8 10:53:16 2011 +0100
Show the slideshow preferences in the viewer tab to save some horizontal space
extensions/image_viewer/preferences.c | 1 +
extensions/slideshow/callbacks.c | 1 +
.../slideshow/data/ui/slideshow-preferences.ui | 3 +-
extensions/slideshow/preferences.c | 30 ++++++++++++++++---
extensions/slideshow/slideshow.extension.in.in | 2 +-
5 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/extensions/image_viewer/preferences.c b/extensions/image_viewer/preferences.c
index 5080213..0db0104 100644
--- a/extensions/image_viewer/preferences.c
+++ b/extensions/image_viewer/preferences.c
@@ -90,6 +90,7 @@ image_viewer__dlg_preferences_construct_cb (GtkWidget *dialog,
notebook = _gtk_builder_get_widget (dialog_builder, "notebook");
page = _gtk_builder_get_widget (data->builder, "preferences_page");
+ g_object_set_data (G_OBJECT (page), "extension-name", "image_viewer");
gtk_widget_show (page);
gtk_combo_box_set_active (GTK_COMBO_BOX (GET_WIDGET ("change_zoom_combobox")), eel_gconf_get_enum (PREF_ZOOM_CHANGE, GTH_TYPE_ZOOM_CHANGE, GTH_ZOOM_CHANGE_FIT_SIZE_IF_LARGER));
diff --git a/extensions/slideshow/callbacks.c b/extensions/slideshow/callbacks.c
index 2ab065d..5ca5073 100644
--- a/extensions/slideshow/callbacks.c
+++ b/extensions/slideshow/callbacks.c
@@ -394,6 +394,7 @@ ss__dlg_catalog_properties (GtkBuilder *builder,
gth_slideshow_preferences_set_audio (GTH_SLIDESHOW_PREFERENCES (slideshow_preferences),
g_value_hash_get_stringv (catalog->attributes, "slideshow::playlist"));
+ gtk_container_set_border_width (GTK_CONTAINER (slideshow_preferences), 12);
gtk_widget_show (gth_slideshow_preferences_get_widget (GTH_SLIDESHOW_PREFERENCES (slideshow_preferences), "personalize_checkbutton"));
gtk_widget_hide (gth_slideshow_preferences_get_widget (GTH_SLIDESHOW_PREFERENCES (slideshow_preferences), "slideshow_label"));
gtk_widget_show (gth_slideshow_preferences_get_widget (GTH_SLIDESHOW_PREFERENCES (slideshow_preferences), "playlist_box"));
diff --git a/extensions/slideshow/data/ui/slideshow-preferences.ui b/extensions/slideshow/data/ui/slideshow-preferences.ui
index 5c10a03..6910d57 100644
--- a/extensions/slideshow/data/ui/slideshow-preferences.ui
+++ b/extensions/slideshow/data/ui/slideshow-preferences.ui
@@ -20,7 +20,6 @@
<object class="GtkVBox" id="preferences_page">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkVBox" id="vbox1">
@@ -174,7 +173,7 @@
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
diff --git a/extensions/slideshow/preferences.c b/extensions/slideshow/preferences.c
index 3c8dbd9..2feff17 100644
--- a/extensions/slideshow/preferences.c
+++ b/extensions/slideshow/preferences.c
@@ -96,7 +96,7 @@ ss__dlg_preferences_construct_cb (GtkWidget *dialog,
BrowserData *data;
GtkWidget *notebook;
char *current_transition;
- GtkWidget *label;
+ gboolean image_viewer_page_found;
notebook = _gtk_builder_get_widget (dialog_builder, "notebook");
@@ -135,10 +135,30 @@ ss__dlg_preferences_construct_cb (GtkWidget *dialog,
G_CALLBACK (change_delay_spinbutton_value_changed_cb),
data);
- label = gtk_label_new (_("Slideshow"));
- gtk_widget_show (label);
-
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook), data->preferences_page, label);
+ image_viewer_page_found = FALSE;
+ if (gth_main_extension_is_active ("image_viewer")) {
+ GList *children;
+ GList *scan;
+
+ children = gtk_container_get_children (GTK_CONTAINER (gtk_builder_get_object (dialog_builder, "notebook")));
+ for (scan = children; scan; scan = scan->next) {
+ GtkWidget *page = scan->data;
+
+ if (g_strcmp0 (g_object_get_data (G_OBJECT (page), "extension-name"), "image_viewer") == 0) {
+ image_viewer_page_found = TRUE;
+ gtk_widget_set_vexpand (data->preferences_page, FALSE);
+ gtk_box_pack_start (GTK_BOX (page), data->preferences_page, FALSE, FALSE, 0);
+ }
+ }
+ }
+
+ if (! image_viewer_page_found) { /* add the preferences in an ad-hoc page */
+ GtkWidget *label;
+
+ label = gtk_label_new (_("Slideshow"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), data->preferences_page, label);
+ }
g_object_set_data_full (G_OBJECT (dialog), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
}
diff --git a/extensions/slideshow/slideshow.extension.in.in b/extensions/slideshow/slideshow.extension.in.in
index 22c5212..6f29786 100644
--- a/extensions/slideshow/slideshow.extension.in.in
+++ b/extensions/slideshow/slideshow.extension.in.in
@@ -10,4 +10,4 @@ Category=Browser
[Loader]
Type=module
File=%LIBRARY%
-After=catalogs
\ No newline at end of file
+After=catalogs;image_viewer
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]