diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -57,7 +57,7 @@ KAboutData *about = new KAboutData(QStringLiteral("kcm_kscreen"), i18n("Display Configuration"), QStringLiteral(KSCREEN_VERSION), - i18n("Configuration for displays"), + i18n("Manage and configure monitors and displays"), KAboutLicense::GPL, i18n("Copyright © 2019 Roman Gilg")); about->addAuthor(i18n("Roman Gilg"), diff --git a/kcm/kcm_kscreen.desktop b/kcm/kcm_kscreen.desktop --- a/kcm/kcm_kscreen.desktop +++ b/kcm/kcm_kscreen.desktop @@ -8,7 +8,7 @@ X-KDE-System-Settings-Parent-Category=display X-KDE-Weight=40 -Name=Displays +Name=Display Configuration Name[ca]=Pantalles Name[ca@valencia]=Pantalles Name[cs]=Obrazovky diff --git a/kcm/output_model.cpp b/kcm/output_model.cpp --- a/kcm/output_model.cpp +++ b/kcm/output_model.cpp @@ -16,6 +16,8 @@ *********************************************************************/ #include "output_model.h" +#include "../common/utils.h" + #include "config_handler.h" #include @@ -44,7 +46,7 @@ const KScreen::OutputPtr &output = m_outputs[index.row()].ptr; switch (role) { case Qt::DisplayRole: - return output->name(); + return Utils::outputName(output); case EnabledRole: return output->isEnabled(); case PrimaryRole: diff --git a/kcm/package/contents/ui/Output.qml b/kcm/package/contents/ui/Output.qml --- a/kcm/package/contents/ui/Output.qml +++ b/kcm/package/contents/ui/Output.qml @@ -255,6 +255,7 @@ } DragHandler { id: dragHandler + enabled: kcm.outputModel && kcm.outputModel.rowCount() > 1 acceptedButtons: Qt.LeftButton target: null diff --git a/kcm/package/contents/ui/OutputIdentifier.qml b/kcm/package/contents/ui/OutputIdentifier.qml --- a/kcm/package/contents/ui/OutputIdentifier.qml +++ b/kcm/package/contents/ui/OutputIdentifier.qml @@ -28,8 +28,8 @@ color: theme.backgroundColor border { - color: theme.textColor - width: Math.ceil(units.gridUnit / 20) + color: "red" + width: units.smallSpacing * 2 } width: childrenRect.width + 2 * childrenRect.x diff --git a/kcm/package/contents/ui/OutputPanel.qml b/kcm/package/contents/ui/OutputPanel.qml --- a/kcm/package/contents/ui/OutputPanel.qml +++ b/kcm/package/contents/ui/OutputPanel.qml @@ -19,27 +19,35 @@ import QtQuick.Controls 2.3 as Controls import org.kde.kirigami 2.4 as Kirigami +import org.kde.kcm 1.2 as KCM + ColumnLayout { id: outputPanel property var element: model + Kirigami.Heading { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + level: 2 + text: i18n("Settings for %1", element.display) + visible: kcm.outputModel.rowCount() > 1 + } + Kirigami.FormLayout { - Controls.Label { -// Kirigami.FormData.label: i18n("Name") - text: element.display - } + twinFormLayouts: globalSettingsLayout Controls.CheckBox { text: i18n("Enabled") checked: element.enabled onClicked: element.enabled = checked + visible: kcm.outputModel.rowCount() > 1 } Controls.CheckBox { text: i18n("Primary") checked: element.primary onClicked: element.primary = checked - visible: kcm.primaryOutputSupported + visible: kcm.primaryOutputSupported && kcm.outputModel.rowCount() > 1 } Controls.ComboBox { @@ -50,11 +58,12 @@ onActivated: element.resolutionIndex = currentIndex } - ColumnLayout { + RowLayout { Layout.fillWidth: true visible: kcm.perOutputScaling Kirigami.FormData.label: i18n("Scale:") + Controls.Slider { id: scaleSlider @@ -68,7 +77,7 @@ } Controls.Label { Layout.alignment: Qt.AlignHCenter - text: scaleSlider.value.toLocaleString(Qt.locale(), "f", 1) + text: i18nc("Scale factor (e.g. 1.0x, 1.5x, 2.0x)","%1x", scaleSlider.value.toLocaleString(Qt.locale(), "f", 1)) } } @@ -79,7 +88,6 @@ RowLayout { id: orientation Kirigami.FormData.label: i18n("Orientation:") - Layout.fillWidth: true RotationButton { value: 0 @@ -106,7 +114,7 @@ Controls.ComboBox { Kirigami.FormData.label: i18n("Replica of:") model: element.replicationSourceModel - visible: kcm.outputReplicationSupported + visible: kcm.outputReplicationSupported && kcm.outputModel && kcm.outputModel.rowCount() > 1 onModelChanged: enabled = (count > 1); onCountChanged: enabled = (count > 1); diff --git a/kcm/package/contents/ui/Panel.qml b/kcm/package/contents/ui/Panel.qml --- a/kcm/package/contents/ui/Panel.qml +++ b/kcm/package/contents/ui/Panel.qml @@ -22,19 +22,6 @@ import org.kde.private.kcm.kscreen 1.0 as KScreen ColumnLayout { - Kirigami.FormLayout { - twinFormLayouts: globalSettingsLayout - Item { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Output settings") - - Rectangle { - anchors.fill: parent - opacity: 0.5 - } - } - } - Controls.SwipeView { id: panelView currentIndex: root.selectedOutput @@ -54,7 +41,7 @@ id: indicator Layout.alignment: Qt.AlignHCenter - opacity: count > 1 ? 1 : 0 + visible: count > 1 count: panelView.count currentIndex: panelView.currentIndex @@ -65,18 +52,13 @@ Kirigami.FormLayout { id: globalSettingsLayout Layout.fillWidth: true - Layout.topMargin: 20 + Kirigami.Separator { Layout.fillWidth: true Kirigami.FormData.isSection: true } - Item { - Layout.fillWidth: true - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Arrangement settings") - } - ColumnLayout { + RowLayout { Layout.fillWidth: true Kirigami.FormData.label: i18n("Global scale:") @@ -94,8 +76,7 @@ onMoved: kcm.globalScale = value } Controls.Label { - Layout.alignment: Qt.AlignHCenter - text: globalScaleSlider.value.toLocaleString(Qt.locale(), "f", 1) + text: i18nc("Scale factor (e.g. 1.0x, 1.5x, 2.0x)","%1x", globalScaleSlider.value.toLocaleString(Qt.locale(), "f", 1)) } } @@ -106,20 +87,20 @@ ColumnLayout { id: retentionSelector - Kirigami.FormData.label: i18n("Save values of an output:") + Kirigami.FormData.label: i18n("Save displays' properties:") Kirigami.FormData.buddyFor: globalRetentionRadio spacing: Kirigami.Units.smallSpacing Controls.RadioButton { id: globalRetentionRadio - text: i18n("For this and other combination of outputs") + text: i18n("For any display arrangement") checked: !individualRetentionRadio.checked onClicked: kcm.outputRetention = KScreen.Control.Global } Controls.RadioButton { id: individualRetentionRadio - text: i18n("For this specific setup independently of others") + text: i18n("For only this specific display arrangement") checked: kcm.outputRetention === KScreen.Control.Individual onClicked: kcm.outputRetention = KScreen.Control.Individual } diff --git a/kcm/package/contents/ui/Screen.qml b/kcm/package/contents/ui/Screen.qml --- a/kcm/package/contents/ui/Screen.qml +++ b/kcm/package/contents/ui/Screen.qml @@ -17,6 +17,7 @@ import QtQuick 2.9 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.3 as Controls +import org.kde.kirigami 2.5 as Kirigami Rectangle { property var outputs @@ -30,8 +31,8 @@ onHeightChanged: resetTotalSize() property real relativeFactor: { - var relativeSize = Qt.size(totalSize.width / (0.6 * width), - totalSize.height / (0.6 * height)); + var relativeSize = Qt.size(totalSize.width / (0.35 * width), + totalSize.height / (0.35 * height)); if (relativeSize.width > relativeSize.height) { // Available width smaller than height, optimize for width (we have // '>' because the available width, height is in the denominator). @@ -44,8 +45,11 @@ property int xOffset: (width - totalSize.width / relativeFactor) / 2; property int yOffset: (height - totalSize.height / relativeFactor) / 2; - implicitHeight: root.height * 0.45 + implicitHeight: Math.max(root.height * 0.4, units.gridUnit * 13) + radius: units.smallSpacing color: "white" + border.color: Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.8)) + border.width: 1 clip: true Row { @@ -59,13 +63,17 @@ Controls.Button { onClicked: kcm.identifyOutputs() text: i18n("Identify") + icon.name: "documentinfo" focusPolicy: Qt.NoFocus + visible: kcm.outputModel && kcm.outputModel.rowCount() > 1 } Controls.Button { enabled: !kcm.screenNormalized onClicked: resetTotalSize() - text: i18n("Center view") + text: i18n("Center View") + icon.name: "zoom-original" focusPolicy: Qt.NoFocus + visible: kcm.outputModel && kcm.outputModel.rowCount() > 1 } } diff --git a/kcm/package/contents/ui/main.qml b/kcm/package/contents/ui/main.qml --- a/kcm/package/contents/ui/main.qml +++ b/kcm/package/contents/ui/main.qml @@ -24,8 +24,8 @@ KCM.SimpleKCM { id: root - implicitWidth: units.gridUnit * 40 - implicitHeight: units.gridUnit * 50 + implicitWidth: units.gridUnit * 30 + implicitHeight: units.gridUnit * 38 property int selectedOutput: 0 @@ -115,7 +115,11 @@ Screen { id: screen - Layout.fillWidth: true + + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: Math.max(root.width * 0.8, units.gridUnit * 26) + Layout.topMargin: Kirigami.Units.smallSpacing + Layout.bottomMargin: Kirigami.Units.largeSpacing * 2 enabled: kcm.outputModel && !kcm.backendError outputs: kcm.outputModel }