summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--overrides/endless_private/asset_button.js13
-rw-r--r--wikipedia/PrebuiltCategoryPage.js4
2 files changed, 15 insertions, 2 deletions
diff --git a/overrides/endless_private/asset_button.js b/overrides/endless_private/asset_button.js
index 594581e..dbb2282 100644
--- a/overrides/endless_private/asset_button.js
+++ b/overrides/endless_private/asset_button.js
@@ -46,9 +46,22 @@ const AssetButton = new Lang.Class({
this.parent(params);
this.set_image(this._image);
+ this._force_center_valign(this);
this.connect('state-flags-changed', Lang.bind(this, this._update_appearance));
},
+ // Gtk 3.10 switched to vertically aligning internal children with
+ // Gtk.Align.BASELINE, which is not what we want for our buttons. This
+ // forces the button internals to use Gtk.Align.CENTER which we want. If
+ // Gtk ever provides public api for controlling alignment of its image and
+ // label, that would be much preferable.
+ _force_center_valign: function (w) {
+ w.set_valign(Gtk.Align.FILL);
+ if (w instanceof Gtk.Container) {
+ w.forall(Lang.bind(this, this._force_center_valign));
+ }
+ },
+
_update_appearance: function() {
let flags = this.get_state_flags();
diff --git a/wikipedia/PrebuiltCategoryPage.js b/wikipedia/PrebuiltCategoryPage.js
index 9934864..4f38b41 100644
--- a/wikipedia/PrebuiltCategoryPage.js
+++ b/wikipedia/PrebuiltCategoryPage.js
@@ -121,12 +121,12 @@ const PrebuiltCategoryPage = new Lang.Class({
this._back_button = new Endless.AssetButton({
valign: Gtk.Align.CENTER,
- hexpand: true,
normal_image_uri: "resource://com/endlessm/wikipedia-domain/assets/introduction_back_button_normal.png",
active_image_uri: "resource://com/endlessm/wikipedia-domain/assets/introduction_back_button_pressed.png",
prelight_image_uri: "resource://com/endlessm/wikipedia-domain/assets/introduction_back_button_hover.png",
label: _("OTHER CATEGORIES"),
- margin_right: 10
+ margin_right: 10,
+ margin_left: 40
});
this._back_button.connect('clicked', Lang.bind(this, function() {