diff options
author | Rory MacQueen <rory@endlessm.com> | 2013-09-17 19:55:33 -0700 |
---|---|---|
committer | Rory MacQueen <rorymacqueen@gmail.com> | 2013-09-26 10:43:54 -0700 |
commit | ea0ee7eae47409aab44f79f5e8e939b38398f961 (patch) | |
tree | 3391fc4c9162a71e4cc1dad63592ed0119a275ba /wikipedia/widgets | |
parent | 7a8bc7d599fe3440b925980f7d821f7d42874d43 (diff) |
Reorganized widget layout for the category page
We were encountering a bizarre bug where the textview would enlarge
when you click the button on the category page. It seems to be
due to the set_size_request call on the textview or containing
widget. To correct, I took out that set_size_request call and
instead subclassed the textview to override the get_preferred_width
function.
The button image is a placeholder till we get the right asset from
design.
Diffstat (limited to 'wikipedia/widgets')
-rw-r--r-- | wikipedia/widgets/FixedSizeTextView.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wikipedia/widgets/FixedSizeTextView.js b/wikipedia/widgets/FixedSizeTextView.js new file mode 100644 index 0000000..14b82dc --- /dev/null +++ b/wikipedia/widgets/FixedSizeTextView.js @@ -0,0 +1,14 @@ +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Lang = imports.lang; + +const CATEGORY_DESCRIPTION_WIDTH = 520; + +const FixedSizeTextView = new Lang.Class({ + Name: "FixedSizeTextView", + Extends: Gtk.TextView, + + vfunc_get_preferred_width:function(){ + return [CATEGORY_DESCRIPTION_WIDTH, CATEGORY_DESCRIPTION_WIDTH]; + } +}); |