[gnome-contacts] Re-introduce separator before the stock thumbnails
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Re-introduce separator before the stock thumbnails
- Date: Mon, 26 Jun 2017 16:16:22 +0000 (UTC)
commit aea3ec9a895aae82680cdcaad1182465228249db
Author: Niels De Graef <nielsdegraef gmail com>
Date: Mon Jun 26 18:16:10 2017 +0200
Re-introduce separator before the stock thumbnails
data/ui/contacts-avatar-dialog.ui | 22 ++++++++++++++++++++--
src/contacts-avatar-dialog.vala | 18 ++++++++++--------
2 files changed, 30 insertions(+), 10 deletions(-)
---
diff --git a/data/ui/contacts-avatar-dialog.ui b/data/ui/contacts-avatar-dialog.ui
index 5684f98..b9c0819 100644
--- a/data/ui/contacts-avatar-dialog.ui
+++ b/data/ui/contacts-avatar-dialog.ui
@@ -62,9 +62,27 @@
<property name="vexpand">True</property>
<property name="height_request">300</property>
<child>
- <object class="GtkFlowBox" id="thumbnail_grid">
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="min_children_per_line">5</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkFlowBox" id="personas_thumbnail_grid">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkFlowBox" id="stock_thumbnail_grid">
+ <property name="visible">True</property>
+ <property name="min_children_per_line">5</property>
+ <property name="max_children_per_line">8</property>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/contacts-avatar-dialog.vala b/src/contacts-avatar-dialog.vala
index bef1156..7ffa801 100644
--- a/src/contacts-avatar-dialog.vala
+++ b/src/contacts-avatar-dialog.vala
@@ -43,7 +43,9 @@ public class Contacts.AvatarDialog : Dialog {
[GtkChild]
private Stack views_stack;
[GtkChild]
- private FlowBox thumbnail_grid;
+ private FlowBox personas_thumbnail_grid;
+ [GtkChild]
+ private FlowBox stock_thumbnail_grid;
[GtkChild]
private Grid crop_page;
private Um.CropArea crop_area;
@@ -141,7 +143,7 @@ public class Contacts.AvatarDialog : Dialog {
});
*/
- update_thumbnail_grid ();
+ update_thumbnail_grids ();
}
private Gdk.Pixbuf scale_pixbuf_for_avatar_use (Gdk.Pixbuf pixbuf) {
@@ -207,23 +209,23 @@ public class Contacts.AvatarDialog : Dialog {
set_response_sensitive (ResponseType.OK, true);
}
- private void update_thumbnail_grid () {
+ private void update_thumbnail_grids () {
if (this.contact != null) {
foreach (var p in contact.individual.personas) {
ContactFrame? frame = frame_for_persona (p);
if (frame != null)
- this.thumbnail_grid.add (frame);
+ this.personas_thumbnail_grid.add (frame);
}
}
+ this.personas_thumbnail_grid.show_all ();
var stock_files = Utils.get_stock_avatars ();
foreach (var file_name in stock_files) {
ContactFrame? frame = frame_for_filename (file_name);
if (frame != null)
- this.thumbnail_grid.add (frame);
+ this.stock_thumbnail_grid.add (frame);
}
-
- this.thumbnail_grid.show_all ();
+ this.stock_thumbnail_grid.show_all ();
}
public void update_preview (FileChooser chooser) {
@@ -332,7 +334,7 @@ public class Contacts.AvatarDialog : Dialog {
else
selected_pixbuf (scale_pixbuf_for_avatar_use (pixbuf));
- update_thumbnail_grid ();
+ update_thumbnail_grids ();
} catch {
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]