Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/widget.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 59 | { | |||
---|---|---|---|---|---|
84 | widget->setLayout(vbox); | 84 | widget->setLayout(vbox); | ||
85 | 85 | | |||
86 | QHBoxLayout *hbox = new QHBoxLayout; | 86 | QHBoxLayout *hbox = new QHBoxLayout; | ||
87 | vbox->addLayout(hbox); | 87 | vbox->addLayout(hbox); | ||
88 | 88 | | |||
89 | mPrimaryCombo = new PrimaryOutputCombo(this); | 89 | mPrimaryCombo = new PrimaryOutputCombo(this); | ||
90 | connect(mPrimaryCombo, &PrimaryOutputCombo::changed, | 90 | connect(mPrimaryCombo, &PrimaryOutputCombo::changed, | ||
91 | this, &Widget::changed); | 91 | this, &Widget::changed); | ||
92 | hbox->addWidget(new QLabel(i18n("Primary display:"))); | 92 | mPrimaryLabel = new QLabel(i18n("Primary display:")); | ||
93 | hbox->addWidget(mPrimaryLabel); | ||||
93 | hbox->addWidget(mPrimaryCombo); | 94 | hbox->addWidget(mPrimaryCombo); | ||
94 | 95 | | |||
95 | hbox->addStretch(); | 96 | hbox->addStretch(); | ||
96 | 97 | | |||
97 | #ifdef WITH_PROFILES | 98 | #ifdef WITH_PROFILES | ||
98 | mProfilesModel = new ProfilesModel(this); | 99 | mProfilesModel = new ProfilesModel(this); | ||
99 | 100 | | |||
100 | connect(mProfilesModel, &ProfilesModel::modelUpdated()), | 101 | connect(mProfilesModel, &ProfilesModel::modelUpdated()), | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 164 | { | |||
171 | mConfig = config; | 172 | mConfig = config; | ||
172 | KScreen::ConfigMonitor::instance()->addConfig(mConfig); | 173 | KScreen::ConfigMonitor::instance()->addConfig(mConfig); | ||
173 | 174 | | |||
174 | mScreen->setConfig(mConfig); | 175 | mScreen->setConfig(mConfig); | ||
175 | mControlPanel->setConfig(mConfig); | 176 | mControlPanel->setConfig(mConfig); | ||
176 | mPrimaryCombo->setConfig(mConfig); | 177 | mPrimaryCombo->setConfig(mConfig); | ||
177 | mUnifyButton->setEnabled(mConfig->outputs().count() > 1); | 178 | mUnifyButton->setEnabled(mConfig->outputs().count() > 1); | ||
178 | mScaleAllOutputsButton->setVisible(!mConfig->supportedFeatures().testFlag(KScreen::Config::Feature::PerOutputScaling)); | 179 | mScaleAllOutputsButton->setVisible(!mConfig->supportedFeatures().testFlag(KScreen::Config::Feature::PerOutputScaling)); | ||
179 | 180 | mPrimaryCombo->setVisible(mConfig->supportedFeatures().testFlag(KScreen::Config::Feature::PrimaryDisplay)); | |||
181 | mPrimaryLabel->setVisible(mConfig->supportedFeatures().testFlag(KScreen::Config::Feature::PrimaryDisplay)); | ||||
180 | 182 | | |||
181 | for (const KScreen::OutputPtr &output : mConfig->outputs()) { | 183 | for (const KScreen::OutputPtr &output : mConfig->outputs()) { | ||
182 | connect(output.data(), &KScreen::Output::isEnabledChanged, | 184 | connect(output.data(), &KScreen::Output::isEnabledChanged, | ||
183 | this, &Widget::slotOutputEnabledChanged); | 185 | this, &Widget::slotOutputEnabledChanged); | ||
184 | connect(output.data(), &KScreen::Output::posChanged, | 186 | connect(output.data(), &KScreen::Output::posChanged, | ||
185 | this, &Widget::changed); | 187 | this, &Widget::changed); | ||
186 | } | 188 | } | ||
187 | 189 | | |||
▲ Show 20 Lines • Show All 297 Lines • Show Last 20 Lines |