From b02800f8b50cf61f8493920df8ca2c9c0a81172a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 6 Dec 2023 15:46:12 +0100 Subject: [PATCH] js: Explicitly set expand of St.Bin children Right now, St.Bin ignores the child's expand properties, and instead expands the child if its alignment is set to FILL. This will change when we replace the custom allocation code with a layout manager, so to prepare for that, set the expand property where needed to keep the expected behavior. Part-of: --- js/gdm/loginDialog.js | 1 + js/ui/calendar.js | 1 + js/ui/dateMenu.js | 5 ++++- js/ui/quickSettings.js | 6 +++--- js/ui/screenshot.js | 2 ++ js/ui/search.js | 5 ++++- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index ba2a1ad71..f97811299 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -50,6 +50,7 @@ export const UserListItem = GObject.registerClass({ _init(user) { let layout = new St.BoxLayout({ vertical: true, + x_expand: true, }); super._init({ style_class: 'login-dialog-user-list-item', diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 64663c5af..6ab62c51b 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -824,6 +824,7 @@ class NotificationTimeLabel extends St.Label { style_class: 'event-time', x_align: Clutter.ActorAlign.START, y_align: Clutter.ActorAlign.END, + x_expand: true, }); this._datetime = datetime; } diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 525923c0e..a66d9233b 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -63,7 +63,10 @@ class TodayButton extends St.Button { reactive: false, }); - const hbox = new St.BoxLayout({vertical: true}); + const hbox = new St.BoxLayout({ + vertical: true, + x_expand: true, + }); this.child = hbox; this._dayLabel = new St.Label({ diff --git a/js/ui/quickSettings.js b/js/ui/quickSettings.js index d53ae2f8b..6deff416c 100644 --- a/js/ui/quickSettings.js +++ b/js/ui/quickSettings.js @@ -62,7 +62,7 @@ export const QuickToggle = GObject.registerClass({ ...params, }); - this._box = new St.BoxLayout(); + this._box = new St.BoxLayout({x_expand: true}); this.set_child(this._box); const iconProps = {}; @@ -167,7 +167,7 @@ export const QuickMenuToggle = GObject.registerClass({ this.add_style_class_name('quick-menu-toggle'); - this._box = new St.BoxLayout(); + this._box = new St.BoxLayout({x_expand: true}); this.set_child(this._box); const contents = new QuickToggle({ @@ -264,7 +264,7 @@ export const QuickSlider = GObject.registerClass({ hasMenu: true, }); - const box = new St.BoxLayout(); + const box = new St.BoxLayout({x_expand: true}); this.set_child(box); const iconProps = {}; diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 18926bf62..8875d9325 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -1320,6 +1320,8 @@ export const ScreenshotUI = GObject.registerClass({ this._captureButton = new St.Button({style_class: 'screenshot-ui-capture-button'}); this._captureButton.set_child(new St.Widget({ style_class: 'screenshot-ui-capture-button-circle', + x_expand: true, + y_expand: true, })); this.add_child(new Tooltip(this._captureButton, { /* Translators: since this string refers to an action, diff --git a/js/ui/search.js b/js/ui/search.js index b90ab33ac..293aa196e 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -286,7 +286,10 @@ class ListSearchResults extends SearchResultsBase { _init(provider, resultsView) { super._init(provider, resultsView); - this._container = new St.BoxLayout({style_class: 'search-section-content'}); + this._container = new St.BoxLayout({ + style_class: 'search-section-content', + x_expand: true, + }); this.providerInfo = new ProviderInfo(provider); this.providerInfo.connect('key-focus-in', this._keyFocusIn.bind(this)); this.providerInfo.connect('clicked', () => {