Commit cd3b350e authored by Sebastian Kügler's avatar Sebastian Kügler
Browse files

hide primary display combo when not supported

Some backends, for example the kwayland backend, do not support
setting the primary display. The backends already make their
feature set known so we can just hide it from the UI.

It's enough to hide it from the UI since setting it doesn't make
any difference, the libkscreen backend will simply ignore it
internally, so it's just honest to not show it.


Test Plan:
ran kscreen kcm on both, X11 and wayland platforms, combo
and label are shown and hidden as expected

Reviewers: #plasma, dvratil, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kpiwowarski, plasma-devel

Tags: #plasma

Differential Revision:
parent 411c3c20
......@@ -89,7 +89,8 @@ Widget::Widget(QWidget *parent):
mPrimaryCombo = new PrimaryOutputCombo(this);
connect(mPrimaryCombo, &PrimaryOutputCombo::changed,
this, &Widget::changed);
hbox->addWidget(new QLabel(i18n("Primary display:")));
mPrimaryLabel = new QLabel(i18n("Primary display:"));
......@@ -176,7 +177,8 @@ void Widget::setConfig(const KScreen::ConfigPtr &config)
mUnifyButton->setEnabled(mConfig->outputs().count() > 1);
for (const KScreen::OutputPtr &output : mConfig->outputs()) {
connect(, &KScreen::Output::isEnabledChanged,
......@@ -26,6 +26,7 @@
#include <kscreen/config.h>
class ProfilesModel;
class QLabel;
class QMLOutput;
class QMLScreen;
class ControlPanel;
......@@ -89,6 +90,7 @@ class Widget : public QWidget
ProfilesModel *mProfilesModel = nullptr;
PrimaryOutputCombo *mPrimaryCombo = nullptr;
QLabel *mPrimaryLabel = nullptr;
QComboBox *mProfilesCombo = nullptr;
QPushButton *mScaleAllOutputsButton = nullptr;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment