Commit 8c70bf23 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

Show the slideshow preferences in the viewer tab to save some horizontal space

parent e1d5cb47
......@@ -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));
......
......@@ -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"));
......
......@@ -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>
......
......@@ -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);
}
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment