Changeset View
Changeset View
Standalone View
Standalone View
kcm/package/contents/ui/Screen.qml
Show All 14 Lines | |||||
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 | import org.kde.kirigami 2.5 as Kirigami | ||
21 | 21 | | |||
22 | Controls.ScrollView { | 22 | Controls.ScrollView { | ||
23 | id: screenView | ||||
24 | | ||||
23 | property var outputs | 25 | property var outputs | ||
24 | property size totalSize | 26 | property size totalSize | ||
25 | 27 | | |||
26 | function resetTotalSize() { | 28 | function resetTotalSize() { | ||
27 | totalSize = kcm.normalizeScreen(); | 29 | totalSize = kcm.normalizeScreen(); | ||
28 | } | 30 | } | ||
29 | 31 | | |||
30 | onWidthChanged: resetTotalSize() | 32 | onWidthChanged: resetTotalSize() | ||
Show All 40 Lines | 69 | Controls.Button { | |||
71 | icon.name: "zoom-original" | 73 | icon.name: "zoom-original" | ||
72 | focusPolicy: Qt.NoFocus | 74 | focusPolicy: Qt.NoFocus | ||
73 | visible: kcm.outputModel && kcm.outputModel.rowCount() > 1 | 75 | visible: kcm.outputModel && kcm.outputModel.rowCount() > 1 | ||
74 | } | 76 | } | ||
75 | } | 77 | } | ||
76 | 78 | | |||
77 | Repeater { | 79 | Repeater { | ||
78 | model: kcm.outputModel | 80 | model: kcm.outputModel | ||
79 | delegate: Output {} | 81 | delegate: Output { | ||
80 | 82 | // Ensure a corner of a screen always stays visible | |||
83 | visibleBounds: Qt.rect(Kirigami.Units.gridUnit, Kirigami.Units.gridUnit, | ||||
mart: magic numbers? | |||||
broulik: Suggestions? | |||||
IMO magic numbers are probably okay here, but 20 is pretty similar to GridUnit so maybe just use multiples of that instead? ngraham: IMO magic numbers are probably okay here, but 20 is pretty similar to GridUnit so maybe just… | |||||
84 | screenView.width - 2 * Kirigami.Units.gridUnit, screenView.height - 2 * Kirigami.Units.gridUnit) | ||||
85 | } | ||||
81 | onCountChanged: resetTotalSize() | 86 | onCountChanged: resetTotalSize() | ||
82 | } | 87 | } | ||
83 | } | 88 | } |
magic numbers?