[gnome-photos] Get rid of the WM's titlebar
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] Get rid of the WM's titlebar
- Date: Thu, 8 Aug 2013 14:11:55 +0000 (UTC)
commit d33e221f20fc8dd6ee54b830bef4890a110d628c
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Aug 8 13:09:25 2013 +0200
Get rid of the WM's titlebar
Bump minimum GTK+ version to 3.9.11 because we need
gtk_header_bar_set_show_close_button.
configure.ac | 2 +-
src/photos-embed.c | 15 ++++++++++++++-
src/photos-main-toolbar.c | 5 +++++
3 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 61763d6..8406878 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ EXEMPI_MIN_VERSION=1.99.5
GLIB_MIN_VERSION=2.35.1
GOA_MIN_VERSION=3.8.0
GRILO_MIN_VERSION=0.2.6
-GTK_MIN_VERSION=3.9.10
+GTK_MIN_VERSION=3.9.11
LIBEXIF_MIN_VERSION=0.6.14
LIBRSVG_MIN_VERSION=2.26.0
diff --git a/src/photos-embed.c b/src/photos-embed.c
index 4077b8d..537cd38 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -29,6 +29,7 @@
#include <gegl.h>
#include <glib/gi18n.h>
+#include "photos-application.h"
#include "photos-embed.h"
#include "photos-empty-results-box.h"
#include "photos-error-box.h"
@@ -450,15 +451,28 @@ photos_embed_dispose (GObject *object)
G_OBJECT_CLASS (photos_embed_parent_class)->dispose (object);
}
+
+static void
+photos_embed_window_added (PhotosEmbed *self, GtkWindow *window)
+{
+ gtk_window_set_titlebar (window, self->priv->toolbar);
+}
+
+
static void
photos_embed_init (PhotosEmbed *self)
{
PhotosEmbedPrivate *priv;
+ GtkApplication *app;
gboolean querying;
self->priv = photos_embed_get_instance_private (self);
priv = self->priv;
+ app = photos_application_new ();
+ g_signal_connect_swapped (app, "window-added", G_CALLBACK (photos_embed_window_added), self);
+ g_object_unref (app);
+
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
gtk_widget_show (GTK_WIDGET (self));
@@ -477,7 +491,6 @@ photos_embed_init (PhotosEmbed *self)
priv->toolbar = photos_main_toolbar_new ();
photos_main_toolbar_set_stack (PHOTOS_MAIN_TOOLBAR (priv->toolbar), GTK_STACK (priv->stack));
- gtk_box_pack_start (GTK_BOX (self), priv->toolbar, FALSE, FALSE, 0);
priv->ntfctn_mngr = g_object_ref_sink (photos_notification_manager_new ());
gtk_overlay_add_overlay (GTK_OVERLAY (priv->stack_overlay), priv->ntfctn_mngr);
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index f1e0260..25a4942 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -328,6 +328,7 @@ photos_main_toolbar_clear_toolbar (PhotosMainToolbar *self)
PhotosMainToolbarPrivate *priv = self->priv;
photos_main_toolbar_clear_state_data (self);
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->toolbar), FALSE);
photos_header_bar_clear (PHOTOS_HEADER_BAR (priv->toolbar));
g_simple_action_set_enabled (priv->gear_menu, FALSE);
}
@@ -383,6 +384,7 @@ photos_main_toolbar_populate_for_collections (PhotosMainToolbar *self)
PhotosMainToolbarPrivate *priv = self->priv;
GObject *object;
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->toolbar), TRUE);
photos_header_bar_set_mode (PHOTOS_HEADER_BAR (priv->toolbar), PHOTOS_HEADER_BAR_MODE_NORMAL);
photos_main_toolbar_add_selection_button (self);
@@ -415,6 +417,7 @@ photos_main_toolbar_populate_for_favorites (PhotosMainToolbar *self)
PhotosMainToolbarPrivate *priv = self->priv;
GObject *object;
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->toolbar), TRUE);
photos_header_bar_set_mode (PHOTOS_HEADER_BAR (priv->toolbar), PHOTOS_HEADER_BAR_MODE_NORMAL);
photos_main_toolbar_add_selection_button (self);
@@ -429,6 +432,7 @@ photos_main_toolbar_populate_for_overview (PhotosMainToolbar *self)
PhotosMainToolbarPrivate *priv = self->priv;
GObject *object;
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->toolbar), TRUE);
photos_header_bar_set_mode (PHOTOS_HEADER_BAR (priv->toolbar), PHOTOS_HEADER_BAR_MODE_NORMAL);
photos_main_toolbar_add_selection_button (self);
@@ -448,6 +452,7 @@ photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
gboolean remote_display_available;
GAction *remote_display_action;
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->toolbar), TRUE);
photos_header_bar_set_mode (PHOTOS_HEADER_BAR (priv->toolbar), PHOTOS_HEADER_BAR_MODE_STANDALONE);
back_button = photos_main_toolbar_add_back_button (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]