Skip to content

Commit 626fede

Browse files
authored
Set size policy in plugin-backlight and plugin-colorpicker (#2049)
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.
1 parent 42ae564 commit 626fede

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

plugin-backlight/backlight.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ LXQtBacklight::LXQtBacklight(const ILXQtPanelPluginStartupInfo &startupInfo):
3434
m_backlightButton = new QToolButton();
3535
// use our own icon
3636
m_backlightButton->setIcon(QIcon::fromTheme(QStringLiteral("brightnesssettings")));
37+
m_backlightButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
3738

3839
connect(m_backlightButton, &QToolButton::clicked, this, &LXQtBacklight::showSlider);
3940

plugin-colorpicker/colorpicker.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void ColorPicker::realign()
8080

8181
ColorPickerWidget::ColorPickerWidget(QWidget *parent) : QWidget(parent)
8282
{
83-
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
83+
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
8484

8585
mSeparator = new QFrame();
8686
mSeparator->setFrameShape(QFrame::VLine);
@@ -93,12 +93,14 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent) : QWidget(parent)
9393
mPickerButton->setAccessibleName(mPickerButton->objectName());
9494
mPickerButton->setAutoRaise(true);
9595
mPickerButton->setIcon(QIcon::fromTheme(QLatin1String("color-picker"), QIcon::fromTheme(QLatin1String("color-select-symbolic"))));
96+
mPickerButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
9697

9798
mColorButton = new ColorButton();
9899
mColorButton->setObjectName(QStringLiteral("ColorPickerColorButton"));
99100
mColorButton->setAccessibleName(mColorButton->objectName());
100101
mColorButton->setAutoRaise(true);
101102
mColorButton->setStyleSheet(QStringLiteral("::menu-indicator{ image: none; }"));
103+
mColorButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
102104

103105
QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight);
104106
layout->setContentsMargins(0, 0, 0, 0);

0 commit comments

Comments
 (0)