Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/outputconfig.cpp
Show All 15 Lines | |||||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "outputconfig.h" | 22 | #include "outputconfig.h" | ||
23 | #include "resolutionslider.h" | 23 | #include "resolutionslider.h" | ||
24 | #include "scalingconfig.h" | ||||
24 | #include "collapsablebutton.h" | 25 | #include "collapsablebutton.h" | ||
25 | #include "utils.h" | 26 | #include "utils.h" | ||
26 | #include "kcm_screen_debug.h" | 27 | #include "kcm_screen_debug.h" | ||
27 | 28 | | |||
28 | #include <QtCore/QStringBuilder> | 29 | #include <QtCore/QStringBuilder> | ||
29 | #include <QFormLayout> | 30 | #include <QFormLayout> | ||
30 | #include <QComboBox> | 31 | #include <QComboBox> | ||
31 | #include <QCheckBox> | 32 | #include <QCheckBox> | ||
32 | #include <QHBoxLayout> | 33 | #include <QHBoxLayout> | ||
33 | #include <QLabel> | 34 | #include <QLabel> | ||
34 | #include <QPushButton> | 35 | #include <QPushButton> | ||
35 | #include <QGroupBox> | 36 | #include <QGroupBox> | ||
37 | #include <QPointer> | ||||
36 | 38 | | |||
37 | #include <KLocalizedString> | 39 | #include <KLocalizedString> | ||
38 | #include <QComboBox> | 40 | #include <QComboBox> | ||
39 | 41 | | |||
40 | #include <kscreen/output.h> | 42 | #include <kscreen/output.h> | ||
41 | #include <kscreen/edid.h> | 43 | #include <kscreen/edid.h> | ||
42 | 44 | | |||
43 | OutputConfig::OutputConfig(QWidget *parent) | 45 | OutputConfig::OutputConfig(QWidget *parent) | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 131 | if (mShowScaleOption) { | |||
132 | mScale->addItem(i18nc("Scale multiplier, show everything at 2 times normal scale", "2x"), 2); | 134 | mScale->addItem(i18nc("Scale multiplier, show everything at 2 times normal scale", "2x"), 2); | ||
133 | connect(mScale, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), | 135 | connect(mScale, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), | ||
134 | this, &OutputConfig::slotScaleChanged); | 136 | this, &OutputConfig::slotScaleChanged); | ||
135 | mScale->setCurrentIndex(mScale->findData(mOutput->scale())); | 137 | mScale->setCurrentIndex(mScale->findData(mOutput->scale())); | ||
136 | 138 | | |||
137 | formLayout->addRow(i18n("Scale:"), mScale); | 139 | formLayout->addRow(i18n("Scale:"), mScale); | ||
138 | 140 | | |||
139 | formLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum)); | 141 | formLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum)); | ||
142 | } else { | ||||
143 | QPushButton *scaleDialogButton = new QPushButton(i18n("Scale Display"), this); | ||||
davidedmundson: QPushButton* | |||||
Indeed, how did that build? Maybe the diff actually failed to build but I never noticed. fvogt: Indeed, how did that build? Maybe the diff actually failed to build but I never noticed. | |||||
144 | connect(scaleDialogButton, &QPushButton::released, [this] { | ||||
145 | QPointer<ScalingConfig> dialog = new ScalingConfig(mOutput, this); | ||||
gladhorn: Why not use QScopedPointer here? | |||||
fvogt: I just moved the code from kcm/src/widget.cpp. | |||||
146 | dialog->exec(); | ||||
147 | delete dialog; | ||||
148 | }); | ||||
149 | formLayout->addWidget(scaleDialogButton); | ||||
140 | } | 150 | } | ||
141 | 151 | | |||
142 | CollapsableButton *advancedButton = new CollapsableButton(i18n("Advanced Settings"), this); | 152 | CollapsableButton *advancedButton = new CollapsableButton(i18n("Advanced Settings"), this); | ||
143 | advancedButton->setCollapsed(true); | 153 | advancedButton->setCollapsed(true); | ||
144 | vbox->addWidget(advancedButton); | 154 | vbox->addWidget(advancedButton); | ||
145 | 155 | | |||
146 | QWidget *advancedWidget = new QWidget(this); | 156 | QWidget *advancedWidget = new QWidget(this); | ||
147 | int leftMargin, topMargin, rightMargin, bottomMargin; | 157 | int leftMargin, topMargin, rightMargin, bottomMargin; | ||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
QPushButton*