[gnome-photos/wip/rishi/edit-mode: 6/25] main-toolbar, icons: Edit toolbar



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

    main-toolbar, icons: Edit toolbar

 src/photos-icons.h        |    6 ++++-
 src/photos-main-toolbar.c |   50 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-icons.h b/src/photos-icons.h
index 2021074..9e2eafa 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
@@ -29,6 +29,10 @@ G_BEGIN_DECLS
 
 #define PHOTOS_ICON_EDIT_FIND_SYMBOLIC "edit-find-symbolic"
 
+#define PHOTOS_ICON_EDIT_REDO_SYMBOLIC "edit-redo-symbolic"
+
+#define PHOTOS_ICON_EDIT_UNDO_SYMBOLIC "edit-undo-symbolic"
+
 #define PHOTOS_ICON_FAVORITE "starred"
 #define PHOTOS_ICON_FAVORITE_SYMBOLIC PHOTOS_ICON_FAVORITE "-symbolic"
 
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index db1ddcb..5795152 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -440,6 +440,19 @@ photos_main_toolbar_done_button_clicked (PhotosMainToolbar *self)
 
 
 static void
+photos_main_toolbar_edit_cancel_button_clicked (PhotosMainToolbar *self)
+{
+  photos_mode_controller_go_back (self->priv->mode_cntrlr);
+}
+
+
+static void
+photos_main_toolbar_edit_save_button_clicked (PhotosMainToolbar *self)
+{
+}
+
+
+static void
 photos_main_toolbar_favorite_button_clicked (PhotosMainToolbar *self)
 {
   PhotosBaseItem *item;
@@ -502,6 +515,41 @@ photos_main_toolbar_populate_for_collections (PhotosMainToolbar *self)
 
 
 static void
+photos_main_toolbar_populate_for_edit (PhotosMainToolbar *self)
+{
+  PhotosMainToolbarPrivate *priv = self->priv;
+  GtkWidget *cancel_button;
+  GtkWidget *redo_button;
+  GtkWidget *save_button;
+  GtkWidget *undo_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_header_bar_pack_start (GTK_HEADER_BAR (priv->toolbar), cancel_button);
+  g_signal_connect_swapped (cancel_button,
+                            "clicked",
+                            G_CALLBACK (photos_main_toolbar_edit_cancel_button_clicked),
+                            self);
+
+  save_button = gtk_button_new_with_label (_("Save"));
+  gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->toolbar), save_button);
+  g_signal_connect_swapped (save_button,
+                            "clicked",
+                            G_CALLBACK (photos_main_toolbar_edit_save_button_clicked),
+                            self);
+
+  redo_button = gtk_button_new_from_icon_name (PHOTOS_ICON_EDIT_REDO_SYMBOLIC, GTK_ICON_SIZE_BUTTON);
+  gtk_widget_set_tooltip_text (redo_button, _("Redo the last change"));
+  gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->toolbar), redo_button);
+
+  undo_button = gtk_button_new_from_icon_name (PHOTOS_ICON_EDIT_UNDO_SYMBOLIC, GTK_ICON_SIZE_BUTTON);
+  gtk_widget_set_tooltip_text (undo_button, _("Undo the last change"));
+  gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->toolbar), undo_button);
+}
+
+
+static void
 photos_main_toolbar_update_remote_display_button (PhotosMainToolbar *self)
 {
   PhotosMainToolbarPrivate *priv = self->priv;
@@ -867,6 +915,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]