Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/outputconfig.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 79 | connect(mOutput.data(), &KScreen::Output::rotationChanged, | |||
---|---|---|---|---|---|
83 | }); | 83 | }); | ||
84 | 84 | | |||
85 | connect(mOutput.data(), &KScreen::Output::scaleChanged, | 85 | connect(mOutput.data(), &KScreen::Output::scaleChanged, | ||
86 | this, [=]() { | 86 | this, [=]() { | ||
87 | const int index = mScale->findData(mOutput->scale()); | 87 | const int index = mScale->findData(mOutput->scale()); | ||
88 | mScale->setCurrentIndex(index); | 88 | mScale->setCurrentIndex(index); | ||
89 | }); | 89 | }); | ||
90 | 90 | | |||
91 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | 91 | setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); | ||
92 | 92 | | |||
93 | QVBoxLayout *vbox = new QVBoxLayout(this); | 93 | QVBoxLayout *vbox = new QVBoxLayout(this); | ||
94 | mTitle = new QLabel(this); | 94 | mTitle = new QLabel(this); | ||
95 | mTitle->setAlignment(Qt::AlignHCenter); | 95 | mTitle->setAlignment(Qt::AlignHCenter); | ||
96 | vbox->addWidget(mTitle); | 96 | vbox->addWidget(mTitle); | ||
97 | 97 | | |||
98 | setTitle(Utils::outputName(mOutput)); | 98 | setTitle(Utils::outputName(mOutput)); | ||
99 | 99 | | |||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
154 | advancedWidget->setLayout(formLayout); | 154 | advancedWidget->setLayout(formLayout); | ||
155 | 155 | | |||
156 | mRefreshRate = new QComboBox(advancedWidget); | 156 | mRefreshRate = new QComboBox(advancedWidget); | ||
157 | mRefreshRate->addItem(i18n("Auto"), -1); | 157 | mRefreshRate->addItem(i18n("Auto"), -1); | ||
158 | formLayout->addRow(i18n("Refresh rate:"), mRefreshRate); | 158 | formLayout->addRow(i18n("Refresh rate:"), mRefreshRate); | ||
159 | slotResolutionChanged(mResolution->currentResolution()); | 159 | slotResolutionChanged(mResolution->currentResolution()); | ||
160 | connect(mRefreshRate, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), | 160 | connect(mRefreshRate, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), | ||
161 | this, &OutputConfig::slotRefreshRateChanged); | 161 | this, &OutputConfig::slotRefreshRateChanged); | ||
162 | | ||||
163 | vbox->addStretch(2); | | |||
164 | } | 162 | } | ||
165 | 163 | | |||
166 | void OutputConfig::setOutput(const KScreen::OutputPtr &output) | 164 | void OutputConfig::setOutput(const KScreen::OutputPtr &output) | ||
167 | { | 165 | { | ||
168 | mOutput = output; | 166 | mOutput = output; | ||
169 | initUi(); | 167 | initUi(); | ||
170 | } | 168 | } | ||
171 | 169 | | |||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |