From e136605403b9873f964ebab9e8416c7817cd6ff0 Mon Sep 17 00:00:00 2001 From: Ian Farrell Date: Fri, 12 Apr 2024 18:58:59 -0400 Subject: [PATCH] Set size policy in plugin-backlight and plugin-colorpicker Fixes an inconsistency in themes when they expect an expanding size policy, which is what most plugins have set. Some themes that do this: KDE-Plasma, Ambiance, Kvantum. Further stylesheet changes in some themes will be needed to match themes exactly. --- plugin-backlight/backlight.cpp | 1 + plugin-colorpicker/colorpicker.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin-backlight/backlight.cpp b/plugin-backlight/backlight.cpp index 31247f7b1..d6c7086f9 100644 --- a/plugin-backlight/backlight.cpp +++ b/plugin-backlight/backlight.cpp @@ -34,6 +34,7 @@ LXQtBacklight::LXQtBacklight(const ILXQtPanelPluginStartupInfo &startupInfo): m_backlightButton = new QToolButton(); // use our own icon m_backlightButton->setIcon(QIcon::fromTheme(QStringLiteral("brightnesssettings"))); + m_backlightButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); connect(m_backlightButton, &QToolButton::clicked, this, &LXQtBacklight::showSlider); diff --git a/plugin-colorpicker/colorpicker.cpp b/plugin-colorpicker/colorpicker.cpp index 004314557..e6f541580 100644 --- a/plugin-colorpicker/colorpicker.cpp +++ b/plugin-colorpicker/colorpicker.cpp @@ -80,7 +80,7 @@ void ColorPicker::realign() ColorPickerWidget::ColorPickerWidget(QWidget *parent) : QWidget(parent) { - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); mSeparator = new QFrame(); mSeparator->setFrameShape(QFrame::VLine); @@ -93,12 +93,14 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent) : QWidget(parent) mPickerButton->setAccessibleName(mPickerButton->objectName()); mPickerButton->setAutoRaise(true); mPickerButton->setIcon(QIcon::fromTheme(QLatin1String("color-picker"), QIcon::fromTheme(QLatin1String("color-select-symbolic")))); + mPickerButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); mColorButton = new ColorButton(); mColorButton->setObjectName(QStringLiteral("ColorPickerColorButton")); mColorButton->setAccessibleName(mColorButton->objectName()); mColorButton->setAutoRaise(true); mColorButton->setStyleSheet(QStringLiteral("::menu-indicator{ image: none; }")); + mColorButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight); layout->setContentsMargins(0, 0, 0, 0);