[gnome-documents] searchbar: use GdMarginContainer to center the search entry
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] searchbar: use GdMarginContainer to center the search entry
- Date: Fri, 28 Oct 2011 19:20:24 +0000 (UTC)
commit 5d938525c1b8632a6451b72ce5e0f1bd6e03aad8
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Oct 26 13:57:14 2011 -0400
searchbar: use GdMarginContainer to center the search entry
src/searchbar.js | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index 9752716..e59e4c0 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -19,6 +19,7 @@
*
*/
+const Gd = imports.gi.Gd;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
@@ -41,14 +42,17 @@ Searchbar.prototype = {
this.widget.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR);
this._searchEntry = new Gtk.Entry({ width_request: 260,
- margin_left: 64,
- margin_right: 64,
secondary_icon_name: 'edit-find-symbolic',
secondary_icon_sensitive: false,
secondary_icon_activatable: false });
let item = new Gtk.ToolItem();
item.set_expand(true);
- item.add(this._searchEntry);
+
+ let container = new Gd.MarginContainer({ min_margin: 6,
+ max_margin: 64 });
+ container.add(this._searchEntry);
+
+ item.add(container);
this._searchEntry.connect('changed', Lang.bind(this, function() {
let text = this._searchEntry.get_text();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]