Skip to content

Commit

Permalink
Set size policy in plugin-backlight and plugin-colorpicker (#2049)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
isf63 authored Aug 26, 2024
1 parent 42ae564 commit 626fede
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugin-backlight/backlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion plugin-colorpicker/colorpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 626fede

Please sign in to comment.