Changeset View
Changeset View
Standalone View
Standalone View
kcm/package/contents/ui/Screen.qml
Show All 11 Lines | |||||
12 | GNU General Public License for more details. | 12 | GNU General Public License for more details. | ||
13 | 13 | | |||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | *********************************************************************/ | 16 | *********************************************************************/ | ||
17 | import QtQuick 2.9 | 17 | import QtQuick 2.9 | ||
18 | import QtQuick.Layouts 1.1 | 18 | import QtQuick.Layouts 1.1 | ||
19 | import QtQuick.Controls 2.3 as Controls | 19 | import QtQuick.Controls 2.3 as Controls | ||
20 | import org.kde.kirigami 2.5 as Kirigami | ||||
20 | 21 | | |||
21 | Rectangle { | 22 | Rectangle { | ||
22 | property var outputs | 23 | property var outputs | ||
23 | property size totalSize | 24 | property size totalSize | ||
24 | 25 | | |||
25 | function resetTotalSize() { | 26 | function resetTotalSize() { | ||
26 | totalSize = kcm.normalizeScreen(); | 27 | totalSize = kcm.normalizeScreen(); | ||
27 | } | 28 | } | ||
Show All 11 Lines | 33 | property real relativeFactor: { | |||
39 | } else { | 40 | } else { | ||
40 | return relativeSize.height; | 41 | return relativeSize.height; | ||
41 | } | 42 | } | ||
42 | } | 43 | } | ||
43 | 44 | | |||
44 | property int xOffset: (width - totalSize.width / relativeFactor) / 2; | 45 | property int xOffset: (width - totalSize.width / relativeFactor) / 2; | ||
45 | property int yOffset: (height - totalSize.height / relativeFactor) / 2; | 46 | property int yOffset: (height - totalSize.height / relativeFactor) / 2; | ||
46 | 47 | | |||
47 | implicitHeight: root.height * 0.45 | 48 | implicitHeight: Math.max(root.height * 0.4, units.gridUnit * 14) | ||
49 | radius: units.smallSpacing | ||||
48 | color: "white" | 50 | color: "white" | ||
51 | border.color: Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.8)) | ||||
52 | border.width: 1 | ||||
49 | clip: true | 53 | clip: true | ||
50 | 54 | | |||
51 | Row { | 55 | Row { | ||
52 | z: 90 | 56 | z: 90 | ||
53 | anchors { | 57 | anchors { | ||
54 | bottom: parent.bottom | 58 | bottom: parent.bottom | ||
55 | horizontalCenter: parent.horizontalCenter | 59 | horizontalCenter: parent.horizontalCenter | ||
56 | margins: units.smallSpacing | 60 | margins: units.smallSpacing | ||
57 | } | 61 | } | ||
58 | spacing: units.smallSpacing | 62 | spacing: units.smallSpacing | ||
59 | Controls.Button { | 63 | Controls.Button { | ||
60 | onClicked: kcm.identifyOutputs() | 64 | onClicked: kcm.identifyOutputs() | ||
61 | text: i18n("Identify") | 65 | text: i18n("Identify") | ||
66 | icon.name: "documentinfo" | ||||
GB_2: Icon: "documentinfo" | |||||
62 | focusPolicy: Qt.NoFocus | 67 | focusPolicy: Qt.NoFocus | ||
63 | } | 68 | } | ||
64 | Controls.Button { | 69 | Controls.Button { | ||
65 | enabled: !kcm.screenNormalized | 70 | enabled: !kcm.screenNormalized | ||
66 | onClicked: resetTotalSize() | 71 | onClicked: resetTotalSize() | ||
67 | text: i18n("Center view") | 72 | text: i18n("Center view") | ||
73 | icon.name: "zoom-original" | ||||
GB_2: "Center View"
Icon: "zoom-original" | |||||
68 | focusPolicy: Qt.NoFocus | 74 | focusPolicy: Qt.NoFocus | ||
69 | } | 75 | } | ||
70 | } | 76 | } | ||
71 | 77 | | |||
72 | Repeater { | 78 | Repeater { | ||
73 | model: kcm.outputModel | 79 | model: kcm.outputModel | ||
74 | delegate: Output {} | 80 | delegate: Output {} | ||
75 | 81 | | |||
76 | onCountChanged: resetTotalSize() | 82 | onCountChanged: resetTotalSize() | ||
77 | } | 83 | } | ||
78 | } | 84 | } |
Icon: "documentinfo"