[gnome-photos/wip/abono/sidebar: 635/635] WIP Source



commit 29926052f15b3a694e719e1ecd9c677e074a2e25
Author: Alessandro Bono <abono gnome org>
Date:   Thu Nov 2 15:58:25 2017 +0100

    WIP Source

 src/photos-properties-sidebar.c  |   11 ++++++++++
 src/photos-properties-sidebar.ui |   40 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-properties-sidebar.c b/src/photos-properties-sidebar.c
index f334642..d804b63 100644
--- a/src/photos-properties-sidebar.c
+++ b/src/photos-properties-sidebar.c
@@ -31,6 +31,7 @@ struct _PhotosPropertiesSidebar
   GtkScrolledWindow parent_instance;
   GtkWidget *albums_list_box;
   GtkWidget *description_text_view;
+  GtkWidget *source_grid;
   GtkWidget *title_entry;
   PhotosBaseItem *item;
 };
@@ -76,6 +77,7 @@ photos_properties_sidebar_class_init (PhotosPropertiesSidebarClass *klass)
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Photos/properties-sidebar.ui");
   gtk_widget_class_bind_template_child (widget_class, PhotosPropertiesSidebar, albums_list_box);
   gtk_widget_class_bind_template_child (widget_class, PhotosPropertiesSidebar, description_text_view);
+  gtk_widget_class_bind_template_child (widget_class, PhotosPropertiesSidebar, source_grid);
   gtk_widget_class_bind_template_child (widget_class, PhotosPropertiesSidebar, title_entry);
 }
 
@@ -103,6 +105,10 @@ photos_properties_sidebar_clear (PhotosPropertiesSidebar *self)
   children = gtk_container_get_children (GTK_CONTAINER (self->albums_list_box));
   for(l = children; l != NULL; l = g_list_next(l))
     gtk_container_remove (GTK_CONTAINER (self->albums_list_box), GTK_WIDGET (l->data));
+
+  children = gtk_container_get_children (GTK_CONTAINER (self->source_grid));
+  for(l = children; l != NULL; l = g_list_next(l))
+    gtk_container_remove (GTK_CONTAINER (self->source_grid), GTK_WIDGET (l->data));
 }
 
 
@@ -156,6 +162,7 @@ photos_properties_sidebar_on_collection_fetched (GObject *source_object,
 void
 photos_properties_sidebar_set_item (PhotosPropertiesSidebar *self, PhotosBaseItem *item)
 {
+  GtkWidget *source_widget;
   PhotosFetchCollectionsJob *collection_fetcher;
   const gchar *item_id;
 
@@ -176,4 +183,8 @@ photos_properties_sidebar_set_item (PhotosPropertiesSidebar *self, PhotosBaseIte
                                     photos_properties_sidebar_on_collection_fetched,
                                     g_object_ref (self));
   g_object_unref (collection_fetcher);
+
+  source_widget = photos_base_item_get_source_widget (item);
+  gtk_widget_show (GTK_WIDGET (source_widget));
+  gtk_container_add (GTK_CONTAINER(self->source_grid), source_widget);
 }
diff --git a/src/photos-properties-sidebar.ui b/src/photos-properties-sidebar.ui
index b02c6ba..c5d44d4 100644
--- a/src/photos-properties-sidebar.ui
+++ b/src/photos-properties-sidebar.ui
@@ -189,6 +189,46 @@
             </child>
           </object>
         </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="label" translatable="yes">Source</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="GtkGrid" id="source_grid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <placeholder/>
+                </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">4</property>
+          </packing>
+        </child>
       </object>
     </child>
   </template>


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