[gthumb] fullscreen: do not hide the commands when the zoom popover is active
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] fullscreen: do not hide the commands when the zoom popover is active
- Date: Sat, 2 Jan 2016 13:36:11 +0000 (UTC)
commit 0d22439c1ee9ca68bdc8247e86ed76b0b823816a
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Jan 2 12:11:18 2016 +0100
fullscreen: do not hide the commands when the zoom popover is active
extensions/image_viewer/gth-image-viewer-page.c | 22 +++++++++++++++++++++-
gthumb/gth-browser.c | 13 ++++++++++++-
gthumb/gth-browser.h | 2 ++
3 files changed, 35 insertions(+), 2 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index d9633a2..18f10df 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -427,10 +427,26 @@ zoom_scale_value_changed_cb (GtkScale *scale,
static void
+zoom_button_toggled_cb (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ GthImageViewerPage *self = user_data;
+
+ if (! gtk_toggle_button_get_active (togglebutton))
+ return;
+
+ gth_browser_keep_mouse_visible (self->priv->browser, TRUE);
+}
+
+
+static void
zoom_popover_closed_cb (GtkPopover *popover,
gpointer user_data)
{
- call_when_idle ((DataFunc) gth_viewer_page_focus, user_data);
+ GthImageViewerPage *self = user_data;
+
+ gth_browser_keep_mouse_visible (self->priv->browser, FALSE);
+ call_when_idle ((DataFunc) gth_viewer_page_focus, self);
}
@@ -926,6 +942,10 @@ gth_image_viewer_page_real_activate (GthViewerPage *base,
"value-changed",
G_CALLBACK (zoom_scale_value_changed_cb),
self);
+ g_signal_connect (self->priv->buttons[ZOOM_BUTTON],
+ "toggled",
+ G_CALLBACK (zoom_button_toggled_cb),
+ self);
g_signal_connect (_gtk_builder_get_widget (self->priv->builder, "zoom_popover"),
"closed",
G_CALLBACK (zoom_popover_closed_cb),
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 7e475f0..ea574d2 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -206,6 +206,7 @@ struct _GthBrowserPrivate {
gdouble last_mouse_x;
gdouble last_mouse_y;
gboolean view_files_in_fullscreen;
+ gboolean keep_mouse_visible;
struct {
int page;
gboolean thumbnail_list;
@@ -2276,7 +2277,8 @@ hide_mouse_pointer_cb (gpointer data)
/* do not hide the pointer if it's over a viewer control */
- if (pointer_on_control (hmdata, browser->priv->fixed_viewer_controls)
+ if (browser->priv->keep_mouse_visible
+ || pointer_on_control (hmdata, browser->priv->fixed_viewer_controls)
|| pointer_on_control (hmdata, browser->priv->viewer_controls)
|| pointer_on_widget (browser->priv->viewer_sidebar_alignment, hmdata->device))
{
@@ -4288,6 +4290,7 @@ gth_browser_init (GthBrowser *browser)
browser->priv->folder_tree_last_dest_row = NULL;
browser->priv->folder_tree_open_folder_id = 0;
browser->priv->view_files_in_fullscreen = g_settings_get_boolean (browser->priv->browser_settings,
PREF_BROWSER_OPEN_FILES_IN_FULLSCREEN);;
+ browser->priv->keep_mouse_visible = FALSE;
browser->priv->fullscreen_state.sidebar = g_settings_get_enum (browser->priv->browser_settings,
PREF_FULLSCREEN_SIDEBAR);
browser->priv->fullscreen_state.thumbnail_list = g_settings_get_boolean
(browser->priv->browser_settings, PREF_FULLSCREEN_THUMBNAILS_VISIBLE);
@@ -6982,6 +6985,14 @@ gth_browser_get_fullscreen_headerbar (GthBrowser *browser)
}
+void
+gth_browser_keep_mouse_visible (GthBrowser *browser,
+ gboolean value)
+{
+ browser->priv->keep_mouse_visible = value;
+}
+
+
GMenuItem *
_g_menu_item_new_for_file (GFile *file,
const char *custom_label)
diff --git a/gthumb/gth-browser.h b/gthumb/gth-browser.h
index 382b3a0..57aef12 100644
--- a/gthumb/gth-browser.h
+++ b/gthumb/gth-browser.h
@@ -273,6 +273,8 @@ void gth_browser_apply_editor_changes (GthBrowser *browser);
GthICCProfile gth_browser_get_screen_profile (GthBrowser *browser);
GtkWidget * gth_browser_get_fullscreen_headerbar
(GthBrowser *browser);
+void gth_browser_keep_mouse_visible (GthBrowser *browser,
+ gboolean value);
/* utilities */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]