slider: Request a size
Sliders (and level bars) currently don't request any size, so it's up to the caller (or stylesheet) to explicitly set a size big enough to fit the bar/handle. That's rather unexpected, we should request the size we need ourselves. Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7133 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
This commit is contained in:

committed by
Marge Bot

parent
a6706bd2ca
commit
99d49f787b
@ -75,6 +75,18 @@ export const Slider = GObject.registerClass({
|
||||
cr.$dispose();
|
||||
}
|
||||
|
||||
_getPreferredHeight() {
|
||||
const barHeight = super._getPreferredHeight();
|
||||
const handleHeight = 2 * this._handleRadius + this._handleBorderWidth;
|
||||
return Math.max(barHeight, handleHeight);
|
||||
}
|
||||
|
||||
_getPreferredWidth() {
|
||||
const barWidth = super._getPreferredWidth();
|
||||
const handleWidth = 2 * this._handleRadius + this._handleBorderWidth;
|
||||
return Math.max(barWidth, handleWidth);
|
||||
}
|
||||
|
||||
vfunc_button_press_event(event) {
|
||||
return this.startDragging(event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user