Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/resolutionslider.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 62 | if (mModes.count() > 15) { | |||
---|---|---|---|---|---|
74 | layout->addWidget(mComboBox, 0, 0, 1, 1); | 74 | layout->addWidget(mComboBox, 0, 0, 1, 1); | ||
75 | connect(mComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), | 75 | connect(mComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), | ||
76 | this, &ResolutionSlider::slotValueChanged); | 76 | this, &ResolutionSlider::slotValueChanged); | ||
77 | } else { | 77 | } else { | ||
78 | mCurrentLabel = new QLabel(this); | 78 | mCurrentLabel = new QLabel(this); | ||
79 | mCurrentLabel->setAlignment(Qt::AlignCenter); | 79 | mCurrentLabel->setAlignment(Qt::AlignCenter); | ||
80 | layout->addWidget(mCurrentLabel, 1, 0, 1, 3); | 80 | layout->addWidget(mCurrentLabel, 1, 0, 1, 3); | ||
81 | 81 | | |||
82 | if (mModes.count() == 0) { | 82 | if (mModes.isEmpty()) { | ||
83 | mCurrentLabel->setText(i18n("No available resolutions")); | 83 | mCurrentLabel->setText(i18n("No available resolutions")); | ||
84 | } else if (mModes.count() == 1) { | 84 | } else if (mModes.count() == 1) { | ||
85 | mCurrentLabel->setText(Utils::sizeToString(mModes.first())); | 85 | mCurrentLabel->setText(Utils::sizeToString(mModes.first())); | ||
86 | } else { | 86 | } else { | ||
87 | mSlider = new QSlider(Qt::Horizontal, this); | 87 | mSlider = new QSlider(Qt::Horizontal, this); | ||
88 | mSlider->setTickInterval(1); | 88 | mSlider->setTickInterval(1); | ||
89 | mSlider->setTickPosition(QSlider::TicksBelow); | 89 | mSlider->setTickPosition(QSlider::TicksBelow); | ||
90 | mSlider->setSingleStep(1); | 90 | mSlider->setSingleStep(1); | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |