[gnome-photos/wip/rishi/fullscreen: 3/5] mode-controller: Set the fullscreen policy when going back
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/fullscreen: 3/5] mode-controller: Set the fullscreen policy when going back
- Date: Tue, 6 Oct 2015 16:06:08 +0000 (UTC)
commit 573dd661fb73300aaa7954d69819125d0268c185
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Oct 6 17:28:43 2015 +0200
mode-controller: Set the fullscreen policy when going back
We forgot to do this, but the gnome-documents code got it right. So,
let's cherry-pick the change.
https://bugzilla.gnome.org/show_bug.cgi?id=756131
src/photos-mode-controller.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-mode-controller.c b/src/photos-mode-controller.c
index bd375ae..dc9573b 100644
--- a/src/photos-mode-controller.c
+++ b/src/photos-mode-controller.c
@@ -54,6 +54,13 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_PRIVATE (PhotosModeController, photos_mode_controller, G_TYPE_OBJECT);
+static gboolean
+photos_mode_controller_can_fullscreen_policy (PhotosModeController *self, PhotosWindowMode mode)
+{
+ return mode == PHOTOS_WINDOW_MODE_PREVIEW;
+}
+
+
static GObject *
photos_mode_controller_constructor (GType type, guint n_construct_params, GObjectConstructParam
*construct_params)
{
@@ -178,6 +185,7 @@ photos_mode_controller_go_back (PhotosModeController *self)
PhotosModeControllerPrivate *priv = self->priv;
PhotosWindowMode old_mode;
PhotosWindowMode tmp;
+ gboolean policy;
if (g_queue_is_empty (priv->history))
return;
@@ -194,6 +202,9 @@ photos_mode_controller_go_back (PhotosModeController *self)
if (old_mode == PHOTOS_WINDOW_MODE_NONE)
return;
+ policy = photos_mode_controller_can_fullscreen_policy (self, old_mode);
+ photos_mode_controller_set_can_fullscreen (self, policy);
+
/* Swap the old and current modes */
tmp = old_mode;
old_mode = priv->mode;
@@ -241,16 +252,15 @@ photos_mode_controller_set_window_mode (PhotosModeController *self, PhotosWindow
{
PhotosModeControllerPrivate *priv = self->priv;
PhotosWindowMode old_mode;
+ gboolean policy;
old_mode = priv->mode;
if (old_mode == mode)
return;
- if (mode == PHOTOS_WINDOW_MODE_PREVIEW)
- photos_mode_controller_set_can_fullscreen (self, TRUE);
- else
- photos_mode_controller_set_can_fullscreen (self, FALSE);
+ policy = photos_mode_controller_can_fullscreen_policy (self, mode);
+ photos_mode_controller_set_can_fullscreen (self, policy);
g_queue_push_head (priv->history, GINT_TO_POINTER (old_mode));
priv->mode = mode;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]