summaryrefslogtreecommitdiff
path: root/wikipedia/widgets/category_button.js
diff options
context:
space:
mode:
Diffstat (limited to 'wikipedia/widgets/category_button.js')
-rw-r--r--wikipedia/widgets/category_button.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/wikipedia/widgets/category_button.js b/wikipedia/widgets/category_button.js
index 44a3e1b..e6cfdde 100644
--- a/wikipedia/widgets/category_button.js
+++ b/wikipedia/widgets/category_button.js
@@ -162,9 +162,15 @@ const CategoryButton = new Lang.Class({
// Sometimes our label content runs too long and the min window width can
// be greater than the screen width. So we provide our own min width for
- // category buttons here, and allow the GtkLabels to be cut off
- vfunc_get_preferred_width: function() {
- let natural_width = this.parent()[1];
+ // category buttons here, and allow the GtkLabels to be cut off if there's
+ // no space. We ask for width for height management so the height will be
+ // allocated first.
+ vfunc_get_request_mode: function() {
+ return Gtk.SizeRequestMode.WIDTH_FOR_HEIGHT;
+ },
+
+ vfunc_get_preferred_width_for_height: function(height) {
+ let natural_width = this.parent(height)[1];
return [CATEGORY_MIN_WIDTH, natural_width];
},