Commit 200cdd78 authored by Frederik Gladhorn's avatar Frederik Gladhorn
Browse files

Change rotation icons to be a rotated preview icon

Summary:
Right now there is an icon associated with each rotation, but they
do not actually make much sense since they are not rotation arrows, but just
arrows pointing to the sides/up/down.
Instead use the view-preview icon and rotate it.

Reviewers: #plasma, #vdg, ngraham, romangg

Reviewed By: #plasma, #vdg, ngraham, romangg

Subscribers: abetts, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14339
parent e40e747c
......@@ -115,10 +115,15 @@ void OutputConfig::initUi()
formLayout->addRow(i18n("Resolution:"), mResolution);
mRotation = new QComboBox(this);
mRotation->addItem(QIcon::fromTheme(QStringLiteral("arrow-up")), i18n("Normal"), KScreen::Output::None);
mRotation->addItem(QIcon::fromTheme(QStringLiteral("arrow-right")), i18n("90° Clockwise"), KScreen::Output::Right);
mRotation->addItem(QIcon::fromTheme(QStringLiteral("arrow-down")), i18n("Upside Down"), KScreen::Output::Inverted);
mRotation->addItem(QIcon::fromTheme(QStringLiteral("arrow-left")), i18n("90° Counterclockwise"), KScreen::Output::Left);
QIcon previewIcon = QIcon::fromTheme(QStringLiteral("view-preview"));
QPixmap previewPixmap = previewIcon.pixmap(mRotation->iconSize());
QIcon previewRotatedCounterClockwise = QIcon(previewPixmap.transformed(QMatrix(0.0, 1.0, 1.0, 0.0, 0.0, 0.0)));
QIcon previewRotatedClockwise = QIcon(previewPixmap.transformed(QMatrix(0.0, -1.0, -1.0, 0.0, 0.0, 0.0)));
QIcon previewRotatedUpSideDown = QIcon(previewPixmap.transformed(QMatrix(-1.0, 0.0, 0.0, -1.0, 0.0, 0.0)));
mRotation->addItem(previewIcon, i18n("Normal"), KScreen::Output::None);
mRotation->addItem(previewRotatedClockwise, i18n("90° Clockwise"), KScreen::Output::Right);
mRotation->addItem(previewRotatedUpSideDown, i18n("Upside Down"), KScreen::Output::Inverted);
mRotation->addItem(previewRotatedCounterClockwise, i18n("90° Counterclockwise"), KScreen::Output::Left);
connect(mRotation, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
this, &OutputConfig::slotRotationChanged);
mRotation->setCurrentIndex(mRotation->findData(mOutput->rotation()));
......
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