[gnome-photos/wip/rishi/edit-mode: 32/33] main-toolbar: Edit toolbar



commit 79a8fdbecb002ae4d11146266ddeb556411fdcd0
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 26 10:29:22 2015 +0100

    main-toolbar: Edit toolbar

 src/photos-icons.h        |    2 +-
 src/photos-main-toolbar.c |   26 +++++++++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-icons.h b/src/photos-icons.h
index 5395b43..717aee6 100644
--- a/src/photos-icons.h
+++ b/src/photos-icons.h
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2014 Red Hat, Inc.
+ * Copyright © 2014, 2015 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 6a81171..e11c665 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -125,7 +125,7 @@ photos_main_toolbar_set_toolbar_title (PhotosMainToolbar *self)
           g_free (label);
         }
     }
-  else if (window_mode == PHOTOS_WINDOW_MODE_PREVIEW)
+  else if (window_mode == PHOTOS_WINDOW_MODE_EDIT || window_mode == PHOTOS_WINDOW_MODE_PREVIEW)
     {
       GObject *item;
 
@@ -494,6 +494,28 @@ photos_main_toolbar_populate_for_collections (PhotosMainToolbar *self)
 
 
 static void
+photos_main_toolbar_populate_for_edit (PhotosMainToolbar *self)
+{
+  PhotosMainToolbarPrivate *priv = self->priv;
+  GtkStyleContext *context;
+  GtkWidget *cancel_button;
+  GtkWidget *done_button;
+
+  photos_header_bar_set_mode (PHOTOS_HEADER_BAR (priv->toolbar), PHOTOS_HEADER_BAR_MODE_STANDALONE);
+
+  cancel_button = gtk_button_new_with_label (_("Cancel"));
+  gtk_actionable_set_action_name (GTK_ACTIONABLE (cancel_button), "app.edit-cancel");
+  gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->toolbar), cancel_button);
+
+  done_button = gtk_button_new_with_label (_("Done"));
+  gtk_actionable_set_action_name (GTK_ACTIONABLE (done_button), "app.save-current");
+  gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->toolbar), done_button);
+  context = gtk_widget_get_style_context (done_button);
+  gtk_style_context_add_class (context, "suggested-action");
+}
+
+
+static void
 photos_main_toolbar_populate_for_favorites (PhotosMainToolbar *self)
 {
   PhotosMainToolbarPrivate *priv = self->priv;
@@ -838,6 +860,8 @@ photos_main_toolbar_reset_toolbar_mode (PhotosMainToolbar *self)
     photos_main_toolbar_populate_for_selection_mode (self);
   else if (window_mode == PHOTOS_WINDOW_MODE_COLLECTIONS)
     photos_main_toolbar_populate_for_collections (self);
+  else if (window_mode == PHOTOS_WINDOW_MODE_EDIT)
+    photos_main_toolbar_populate_for_edit (self);
   else if (window_mode == PHOTOS_WINDOW_MODE_FAVORITES)
     photos_main_toolbar_populate_for_favorites (self);
   else if (window_mode == PHOTOS_WINDOW_MODE_OVERVIEW)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]