[gnome-photos/wip/abono/sidebar: 6/8] Introduce properties sidebar



commit 3cf4295bb2ce2d7e01afbd066d4fb26ccb81e851
Author: Alessandro Bono <abono gnome org>
Date:   Thu Oct 27 13:15:39 2016 +0200

    Introduce properties sidebar

 po/POTFILES.in                   |    1 +
 src/Makefile.am                  |    3 +
 src/photos-properties-sidebar.c  |  105 ++++++++++++++++++++
 src/photos-properties-sidebar.h  |   35 +++++++
 src/photos-properties-sidebar.ui |  203 ++++++++++++++++++++++++++++++++++++++
 src/photos.gresource.xml         |    1 +
 6 files changed, 348 insertions(+), 0 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 29604bf..9ffe054 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -30,6 +30,7 @@ src/photos-print-notification.c
 src/photos-print-operation.c
 src/photos-print-setup.c
 src/photos-properties-dialog.c
+[type: gettext/glade]src/photos-properties-sidebar.ui
 src/photos-search-match-manager.c
 src/photos-search-type-manager.c
 [type: gettext/glade]src/photos-selection-menu.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index 55fe257..ed3480d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -172,6 +172,8 @@ gnome_photos_SOURCES = \
        photos-print-setup.h \
        photos-properties-dialog.c \
        photos-properties-dialog.h \
+       photos-properties-sidebar.c \
+       photos-properties-sidebar.h \
        photos-query.c \
        photos-query.h \
        photos-query-builder.h \
@@ -281,6 +283,7 @@ EXTRA_DIST = \
        photos-marshalers.list \
        photos-menus.ui \
        photos-preview-menu.ui \
+       photos-properties-sidebar.ui \
        photos-selection-menu.ui \
        photos-selection-toolbar.ui \
        photos-share-dialog.ui \
diff --git a/src/photos-properties-sidebar.c b/src/photos-properties-sidebar.c
new file mode 100644
index 0000000..dc184bc
--- /dev/null
+++ b/src/photos-properties-sidebar.c
@@ -0,0 +1,105 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2016 Alessandro Bono
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include "photos-properties-sidebar.h"
+
+struct _PhotosPropertiesSidebar
+{
+  GtkScrolledWindow parent_instance;
+  GtkWidget *albums_list_box;
+};
+
+struct _PhotosPropertiesSidebarClass
+{
+  GtkScrolledWindowClass parent_class;
+};
+
+G_DEFINE_TYPE (PhotosPropertiesSidebar, photos_properties_sidebar, GTK_TYPE_SCROLLED_WINDOW)
+
+enum {
+  PROP_0,
+  N_PROPS
+};
+
+static GParamSpec *properties [N_PROPS];
+
+GtkWidget *
+photos_properties_sidebar_new (void)
+{
+  return g_object_new (PHOTOS_TYPE_PROPERTIES_SIDEBAR, NULL);
+}
+
+static void
+photos_properties_sidebar_finalize (GObject *object)
+{
+  PhotosPropertiesSidebar *self = (PhotosPropertiesSidebar *)object;
+
+  G_OBJECT_CLASS (photos_properties_sidebar_parent_class)->finalize (object);
+}
+
+static void
+photos_properties_sidebar_get_property (GObject    *object,
+                                        guint       prop_id,
+                                        GValue     *value,
+                                        GParamSpec *pspec)
+{
+  PhotosPropertiesSidebar *self = PHOTOS_PROPERTIES_SIDEBAR (object);
+
+  switch (prop_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+photos_properties_sidebar_set_property (GObject      *object,
+                                        guint         prop_id,
+                                        const GValue *value,
+                                        GParamSpec   *pspec)
+{
+  PhotosPropertiesSidebar *self = PHOTOS_PROPERTIES_SIDEBAR (object);
+
+  switch (prop_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+photos_properties_sidebar_class_init (PhotosPropertiesSidebarClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+  object_class->finalize = photos_properties_sidebar_finalize;
+  object_class->get_property = photos_properties_sidebar_get_property;
+  object_class->set_property = photos_properties_sidebar_set_property;
+
+  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Photos/properties-sidebar.ui");
+//  gtk_widget_class_bind_template_child_private (widget_class, PhotosPropertiesSidebar, albums_list_box);
+}
+
+static void
+photos_properties_sidebar_init (PhotosPropertiesSidebar *self)
+{
+  gtk_widget_init_template (GTK_WIDGET (self));
+}
diff --git a/src/photos-properties-sidebar.h b/src/photos-properties-sidebar.h
new file mode 100644
index 0000000..93f2dcd
--- /dev/null
+++ b/src/photos-properties-sidebar.h
@@ -0,0 +1,35 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2016 Alessandro Bono
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef PHOTOS_PROPERTIES_SIDEBAR_H
+#define PHOTOS_PROPERTIES_SIDEBAR_H
+
+#include "photos-base-item.h"
+
+G_BEGIN_DECLS
+
+#define PHOTOS_TYPE_PROPERTIES_SIDEBAR (photos_properties_sidebar_get_type ())
+G_DECLARE_FINAL_TYPE (PhotosPropertiesSidebar, photos_properties_sidebar, PHOTOS, PROPERTIES_SIDEBAR, 
GtkScrolledWindow);
+
+GtkWidget             *photos_properties_sidebar_new                    (void);
+
+G_END_DECLS
+
+#endif /* PHOTOS_PROPERTIES_SIDEBAR_H */
diff --git a/src/photos-properties-sidebar.ui b/src/photos-properties-sidebar.ui
new file mode 100644
index 0000000..9dc2747
--- /dev/null
+++ b/src/photos-properties-sidebar.ui
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+  <requires lib="gtk+" version="3.20"/>
+  <template class="PhotosPropertiesSidebar" parent="GtkScrolledWindow">
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="hexpand">False</property>
+    <property name="hscrollbar_policy">never</property>
+    <property name="shadow_type">in</property>
+    <child>
+      <object class="GtkViewport">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkGrid">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">center</property>
+            <property name="margin_left">9</property>
+            <property name="margin_right">9</property>
+            <property name="margin_top">9</property>
+            <property name="margin_bottom">9</property>
+            <property name="orientation">vertical</property>
+            <property name="row_spacing">12</property>
+            <child>
+              <object class="GtkGrid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">start</property>
+                    <property name="hexpand">True</property>
+                    <property name="label" translatable="yes">Title</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkEntry" id="title_entry">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">start</property>
+                    <property name="hexpand">True</property>
+                    <property name="label" translatable="yes">Description</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkTextView" id="description_text_view">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="wrap_mode">word-char</property>
+                        <property name="accepts_tab">False</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">start</property>
+                    <property name="hexpand">True</property>
+                    <property name="label" translatable="yes">Albums</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="icon_name">image-edit-symbolic</property>
+                      </object>
+                    </child>
+                    <style>
+                      <class name="circular"/>
+                      <class name="flat"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkListBox" id="albums_list_box">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">start</property>
+                    <property name="hexpand">True</property>
+                    <property name="label" translatable="yes">Properties</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
+              </packing>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/src/photos.gresource.xml b/src/photos.gresource.xml
index 34ed09c..8bc9de6 100644
--- a/src/photos.gresource.xml
+++ b/src/photos.gresource.xml
@@ -6,6 +6,7 @@
     <file alias="dnd-counter.svg" preprocess="to-pixdata">../data/dnd-counter.svg</file>
     <file alias="export-dialog.ui" preprocess="xml-stripblanks" 
compressed="true">photos-export-dialog.ui</file>
     <file alias="preview-menu.ui" preprocess="xml-stripblanks" 
compressed="true">photos-preview-menu.ui</file>
+    <file alias="properties-sidebar.ui" preprocess="xml-stripblanks" 
compressed="true">photos-properties-sidebar.ui</file>
     <file alias="selection-menu.ui" preprocess="xml-stripblanks" 
compressed="true">photos-selection-menu.ui</file>
     <file alias="selection-toolbar.ui" preprocess="xml-stripblanks" 
compressed="true">photos-selection-toolbar.ui</file>
     <file alias="share-dialog.ui" preprocess="xml-stripblanks" 
compressed="true">photos-share-dialog.ui</file>


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