Commit 0d22439c authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

fullscreen: do not hide the commands when the zoom popover is active

parent e74eb573
......@@ -426,11 +426,27 @@ 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),
......
......@@ -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)
......
......@@ -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 */
......
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