[Xfce4-commits] <ristretto:ristretto-0.0> Implement option to hide thumbnailbar when fullscreen
Stephan Arts
noreply at xfce.org
Sun Oct 23 19:17:49 CEST 2011
Updating branch refs/heads/ristretto-0.0
to 79277392c9dd1e1ae4a493a54b001dbcdf980efd (commit)
from 54560c4bab54160935322d2f2bc796def94f86e3 (commit)
commit 79277392c9dd1e1ae4a493a54b001dbcdf980efd
Author: Stephan Arts <stephan at xfce.org>
Date: Sat Sep 5 11:41:58 2009 +0200
Implement option to hide thumbnailbar when fullscreen
ChangeLog | 6 ++++++
src/main_window.c | 10 ++++++++++
src/preferences_dialog.c | 38 ++++++++++++++++++++++++++++++++++++++
src/settings.c | 20 +++++++++++++++++++-
4 files changed, 73 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 794e17b..8730756 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-09-05 Stephan Arts <stephan at xfce.org>
+ * src/preferences_dialog.c,
+ src/settings.c,
+ src/main_window.c: Implement option to hide thumbnail-bar when fullscreen
+
+2009-09-05 Stephan Arts <stephan at xfce.org>
+
* src/preferences_dialog.c
src/settings.c,
src/main_window.c: Implement slideshow timeout slider
diff --git a/src/main_window.c b/src/main_window.c
index 1755c15..5c6f5fd 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1249,6 +1249,11 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
gtk_widget_hide (window->priv->image_list_toolbar);
}
+ if (rstto_settings_get_boolean_property (window->priv->settings_manager, "hide-thumbnailbar-fullscreen"))
+ {
+ gtk_widget_hide (window->priv->thumbnailbar);
+ }
+
rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER (window->priv->picture_viewer));
gtk_ui_manager_add_ui (window->priv->ui_manager,
@@ -1288,6 +1293,11 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
gtk_widget_show (window->priv->image_list_toolbar);
else
gtk_widget_hide(window->priv->image_list_toolbar);
+
+ if (rstto_settings_get_boolean_property (window->priv->settings_manager, "show-thumbnailbar"))
+ {
+ gtk_widget_show (window->priv->thumbnailbar);
+ }
}
}
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index ef3de73..aed517d 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -59,6 +59,11 @@ static void
cb_rstto_preferences_dialog_switch_scrollwheel_action_radio_button_toggled (GtkToggleButton *, gpointer );
static void
+cb_rstto_preferences_dialog_hide_thumbnails_fullscreen_check_button_toggled (
+ GtkToggleButton *button,
+ gpointer user_data);
+
+static void
cb_rstto_preferences_dialog_slideshow_timeout_value_changed (GtkRange *, gpointer);
static GtkWidgetClass *parent_class = NULL;
@@ -87,6 +92,10 @@ struct _RsttoPreferencesDialogPriv
{
GtkWidget *timeout_vbox;
GtkWidget *timeout_frame;
+ GtkWidget *thumbnail_vbox;
+ GtkWidget *thumbnail_frame;
+ GtkWidget *hide_thumbnails_fullscreen_lbl;
+ GtkWidget *hide_thumbnails_fullscreen_check_button;
} slideshow_tab;
struct
@@ -150,9 +159,11 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
gboolean bool_bgcolor_override;
gchar *scrollwheel_primary_action;
guint uint_slideshow_timeout;
+ gboolean bool_hide_thumbnailbar_fullscreen;
GdkColor *bgcolor;
GtkWidget *timeout_lbl, *timeout_hscale;
+ GtkWidget *thumbnail_lbl;
GtkWidget *scaling_frame, *scaling_vbox;
GtkWidget *widget;
GtkObject *cache_adjustment;
@@ -179,6 +190,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
"bgcolor", &bgcolor,
"scrollwheel-primary-action", &scrollwheel_primary_action,
"slideshow-timeout", &uint_slideshow_timeout,
+ "hide-thumbnailbar-fullscreen", &bool_hide_thumbnailbar_fullscreen,
NULL);
/*****************/
@@ -290,6 +302,22 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
g_signal_connect (G_OBJECT (timeout_hscale),
"value-changed", (GCallback)cb_rstto_preferences_dialog_slideshow_timeout_value_changed, dialog);
+
+ dialog->priv->slideshow_tab.thumbnail_vbox = gtk_vbox_new(FALSE, 0);
+ dialog->priv->slideshow_tab.thumbnail_frame = xfce_create_framebox_with_content (_("Thumbnails"), dialog->priv->slideshow_tab.thumbnail_vbox);
+ gtk_box_pack_start (GTK_BOX (slideshow_main_vbox), dialog->priv->slideshow_tab.thumbnail_frame, FALSE, FALSE, 0);
+
+ dialog->priv->slideshow_tab.hide_thumbnails_fullscreen_lbl = gtk_label_new(_("The thumbnailbar can be automatically hidden \nwhen the image-viewer is fullscreen."));
+ dialog->priv->slideshow_tab.hide_thumbnails_fullscreen_check_button = gtk_check_button_new_with_label (_("Hide thumbnailbar when fullscreen"));
+ gtk_box_pack_start (GTK_BOX (dialog->priv->slideshow_tab.thumbnail_vbox), dialog->priv->slideshow_tab.hide_thumbnails_fullscreen_lbl, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dialog->priv->slideshow_tab.thumbnail_vbox), dialog->priv->slideshow_tab.hide_thumbnails_fullscreen_check_button, FALSE, FALSE, 0);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->slideshow_tab.hide_thumbnails_fullscreen_check_button),
+ bool_hide_thumbnailbar_fullscreen);
+
+ g_signal_connect (G_OBJECT (dialog->priv->slideshow_tab.hide_thumbnails_fullscreen_check_button),
+ "toggled", (GCallback)cb_rstto_preferences_dialog_hide_thumbnails_fullscreen_check_button_toggled, dialog);
+
/********************************************/
control_main_vbox = gtk_vbox_new(FALSE, 0);
@@ -621,3 +649,13 @@ cb_rstto_preferences_dialog_slideshow_timeout_value_changed (GtkRange *range, gp
rstto_settings_set_uint_property (dialog->priv->settings, "slideshow-timeout", (guint)gtk_range_get_value (range));
}
+
+static void
+cb_rstto_preferences_dialog_hide_thumbnails_fullscreen_check_button_toggled (
+ GtkToggleButton *button,
+ gpointer user_data)
+{
+ RsttoPreferencesDialog *dialog = RSTTO_PREFERENCES_DIALOG (user_data);
+
+ rstto_settings_set_boolean_property (dialog->priv->settings, "hide-thumbnailbar-fullscreen", gtk_toggle_button_get_active(button));
+}
diff --git a/src/settings.c b/src/settings.c
index 7abb621..fdeb36f 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -57,6 +57,7 @@ enum
PROP_SHOW_NAV_TOOLBAR,
PROP_NAVBAR_POSITION,
PROP_SHOW_THUMBNAILBAR,
+ PROP_HIDE_THUMBNAILBAR_FULLSCREEN,
PROP_TOOLBAR_OPEN,
PROP_ENABLE_CACHE,
PROP_PRELOAD_IMAGES,
@@ -106,6 +107,7 @@ struct _RsttoSettingsPriv
gboolean show_file_toolbar;
gboolean show_nav_toolbar;
gboolean show_thumbnailbar;
+ gboolean hide_thumbnailbar_fullscreen;
gchar *navigationbar_position;
guint preload_images;
gboolean enable_cache;
@@ -154,6 +156,7 @@ rstto_settings_init (GObject *object)
xfconf_g_property_bind (settings->priv->channel, "/window/show-file-toolbar", G_TYPE_BOOLEAN, settings, "show-file-toolbar");
xfconf_g_property_bind (settings->priv->channel, "/window/show-navigation-toolbar", G_TYPE_BOOLEAN, settings, "show-nav-toolbar");
xfconf_g_property_bind (settings->priv->channel, "/window/show-thumbnailbar", G_TYPE_BOOLEAN, settings, "show-thumbnailbar");
+ xfconf_g_property_bind (settings->priv->channel, "/window/hide-thumbnailbar-fullscreen", G_TYPE_BOOLEAN, settings, "hide-thumbnailbar-fullscreen");
xfconf_g_property_bind (settings->priv->channel, "/window/navigationbar-position", G_TYPE_STRING, settings, "navigationbar-position");
xfconf_g_property_bind (settings->priv->channel, "/window/scrollwheel-primary-action", G_TYPE_STRING, settings, "scrollwheel-primary-action");
xfconf_g_property_bind (settings->priv->channel, "/window/scrollwheel-secondary-action", G_TYPE_STRING, settings, "scrollwheel-secondary-action");
@@ -235,6 +238,15 @@ rstto_settings_class_init (GObjectClass *object_class)
PROP_SHOW_THUMBNAILBAR,
pspec);
+ pspec = g_param_spec_boolean ("hide-thumbnailbar-fullscreen",
+ "",
+ "",
+ TRUE,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (object_class,
+ PROP_HIDE_THUMBNAILBAR_FULLSCREEN,
+ pspec);
+
pspec = g_param_spec_string ("navigationbar-position",
"",
"",
@@ -433,7 +445,10 @@ rstto_settings_set_property (GObject *object,
settings->priv->show_nav_toolbar = g_value_get_boolean (value);
break;
case PROP_SHOW_THUMBNAILBAR:
- settings->priv->show_thumbnailbar= g_value_get_boolean (value);
+ settings->priv->show_thumbnailbar = g_value_get_boolean (value);
+ break;
+ case PROP_HIDE_THUMBNAILBAR_FULLSCREEN:
+ settings->priv->hide_thumbnailbar_fullscreen = g_value_get_boolean (value);
break;
case PROP_NAVBAR_POSITION:
str_val = g_value_get_string (value);
@@ -524,6 +539,9 @@ rstto_settings_get_property (GObject *object,
case PROP_SHOW_THUMBNAILBAR:
g_value_set_boolean (value, settings->priv->show_thumbnailbar);
break;
+ case PROP_HIDE_THUMBNAILBAR_FULLSCREEN:
+ g_value_set_boolean (value, settings->priv->hide_thumbnailbar_fullscreen);
+ break;
case PROP_NAVBAR_POSITION:
g_value_set_string (value, settings->priv->navigationbar_position);
break;
More information about the Xfce4-commits
mailing list