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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3046>
This commit is contained in:
Florian Müllner 2023-12-06 15:46:12 +01:00 committed by Marge Bot
parent ef2e96bb32
commit b02800f8b5
6 changed files with 15 additions and 5 deletions

View File

@ -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',

View File

@ -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;
}

View File

@ -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({

View File

@ -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 = {};

View File

@ -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,

View File

@ -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', () => {