[gnome-characters] menu: Add separator between font labels
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters] menu: Add separator between font labels
- Date: Thu, 4 Jun 2015 07:43:08 +0000 (UTC)
commit f0e7f026b6f741116d5cdb8a0e9b71b0e6e356e4
Author: Daiki Ueno <dueno src gnome org>
Date: Thu Jun 4 16:39:14 2015 +0900
menu: Add separator between font labels
https://bugzilla.gnome.org/show_bug.cgi?id=748717
data/menu.ui | 2 ++
src/menu.js | 10 ++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/data/menu.ui b/data/menu.ui
index 969dd5b..b545868 100644
--- a/data/menu.ui
+++ b/data/menu.ui
@@ -23,6 +23,8 @@
<property name="can_focus">True</property>
<property name="visible">True</property>
<property name="halign">fill</property>
+ <property name="margin_start">6</property>
+ <property name="margin_end">6</property>
</object>
</child>
<child>
diff --git a/src/menu.js b/src/menu.js
index 7793b2b..02906bb 100644
--- a/src/menu.js
+++ b/src/menu.js
@@ -61,6 +61,7 @@ const MenuPopover = new Lang.Class({
this._font_listbox.connect('row-selected',
Lang.bind(this, this._handleRowSelected));
this._font_listbox.set_filter_func(Lang.bind(this, this._filterFunc));
+ this._font_listbox.set_header_func(Lang.bind(this, this._headerFunc));
// This silents warning at Characters exit about this widget being
// visible but not mapped. Borrowed from Maps.
@@ -98,5 +99,14 @@ const MenuPopover = new Lang.Class({
return nameWord.indexOf(keyword) >= 0;
});
});
+ },
+
+ _headerFunc: function(row, before) {
+ if (before && !row.get_header()) {
+ let separator = new Gtk.Separator({
+ orientation: Gtk.Orientation.HORIZONTAL
+ });
+ row.set_header (separator);
+ }
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]