summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrmacqueen <rorymacqueen@gmail.com>2013-08-29 14:20:54 -0700
committerrmacqueen <rorymacqueen@gmail.com>2013-08-29 14:20:54 -0700
commitfd2059521807e71da5bffd9d7ca3a6f9448c1fd5 (patch)
tree61567704d49d5cbad85097aa5628389936949c9e
parent1fe432a7c2c2eef4bfda3f81e5b323758a17bb29 (diff)
parent3f5996882efe92ec6575ff6fbcc4ff95c69e5b1b (diff)
Merge pull request #256 from endlessm/issues/255
Word-wrap overly long category title
-rw-r--r--wikipedia/widgets/category_button.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/wikipedia/widgets/category_button.js b/wikipedia/widgets/category_button.js
index 4edac83..ade1f21 100644
--- a/wikipedia/widgets/category_button.js
+++ b/wikipedia/widgets/category_button.js
@@ -11,6 +11,7 @@ const CATEGORY_LABEL_BOTTOM_MARGIN = 20; // pixels
const CATEGORY_BUTTON_RIGHT_MARGIN = 20; // pixels
const CATEGORY_BUTTON_BOTTOM_MARGIN = 20; // pixels
const CATEGORY_LABEL_BENTON_SANS_CORRECTION = 0; // pixels
+const CATEGORY_BUTTON_BENTON_SANS_CORRECTION = 10; // pixels
const _HOVER_ARROW_URI = '/com/endlessm/wikipedia-domain/assets/category_hover_arrow.png';
const MAIN_CATEGORY_SCREEN_WIDTH_PERCENTAGE = 0.37;
@@ -72,14 +73,17 @@ const CategoryButton = new Lang.Class({
margin_left: CATEGORY_LABEL_LEFT_MARGIN,
margin_bottom: CATEGORY_LABEL_BOTTOM_MARGIN - CATEGORY_LABEL_BENTON_SANS_CORRECTION,
hexpand: true,
- halign: Gtk.Align.START
+ halign: Gtk.Align.START,
+ xalign: 0.0, // deprecated Gtk.Misc properties; necessary because
+ wrap: true // "wrap" doesn't respect "halign"
});
this._arrow = new Gtk.Image({
resource: _HOVER_ARROW_URI,
margin_right: CATEGORY_BUTTON_RIGHT_MARGIN,
- margin_bottom: CATEGORY_BUTTON_BOTTOM_MARGIN - CATEGORY_LABEL_BENTON_SANS_CORRECTION,
+ margin_bottom: CATEGORY_BUTTON_BOTTOM_MARGIN + CATEGORY_BUTTON_BENTON_SANS_CORRECTION,
halign: Gtk.Align.END,
- no_show_all: true
+ valign: Gtk.Align.END,
+ opacity: 0
});
let context = this._label.get_style_context();
@@ -146,12 +150,12 @@ const CategoryButton = new Lang.Class({
this._eventbox.connect('enter-notify-event',
Lang.bind(this, function(widget, event) {
this._eventbox.set_state_flags(Gtk.StateFlags.PRELIGHT, false);
- this._arrow.show();
+ this._arrow.opacity = 1.0;
}));
this._eventbox.connect('leave-notify-event',
Lang.bind(this, function(widget, event) {
this._eventbox.unset_state_flags(Gtk.StateFlags.PRELIGHT);
- this._arrow.hide();
+ this._arrow.opacity = 0.0;
}));
}
},