Changeset View
Changeset View
Standalone View
Standalone View
kcm/package/contents/ui/Orientation.qml
Show All 13 Lines | |||||
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.4 as Kirigami | 20 | import org.kde.kirigami 2.4 as Kirigami | ||
21 | 21 | | |||
22 | ColumnLayout { | ||||
23 | Kirigami.FormData.label: i18n("Orientation:") | ||||
24 | Kirigami.FormData.buddyFor: autoRotateRadio | ||||
25 | spacing: Kirigami.Units.smallSpacing | ||||
26 | | ||||
27 | ColumnLayout { | ||||
28 | id: autoRotateColumn | ||||
29 | | ||||
30 | // TODO: Make this dependend on tablet mode being available | ||||
31 | enabled: kcm.orientationSensorAvailable && element.internal | ||||
32 | visible: kcm.autoRotationSupported | ||||
33 | | ||||
34 | ColumnLayout { | ||||
35 | Controls.RadioButton { | ||||
36 | id: autoRotateRadio | ||||
37 | text: i18n("Automatic") | ||||
38 | checked: autoRotateColumn.enabled && element.autoRotate | ||||
39 | onClicked: element.autoRotate = true | ||||
40 | } | ||||
41 | | ||||
42 | Controls.CheckBox { | ||||
43 | id: autoRotateOnlyInTabletMode | ||||
44 | Layout.leftMargin: Kirigami.Units.largeSpacing | ||||
45 | | ||||
46 | text: i18n("Only when in tablet mode.") | ||||
47 | enabled: autoRotateRadio.checked | ||||
48 | checked: enabled && element.autoRotateOnlyInTabletMode | ||||
ngraham: There's enough horizontal space in the window to put this row next to the "Manual" label so it… | |||||
49 | onClicked: element.autoRotateOnlyInTabletMode = checked | ||||
50 | } | ||||
51 | } | ||||
52 | | ||||
53 | Controls.RadioButton { | ||||
54 | id: manualRotateRadio | ||||
55 | text: i18n("Manual") | ||||
56 | checked: !element.autoRotate || !autoRotateColumn.enabled | ||||
57 | onClicked: element.autoRotate = false | ||||
58 | } | ||||
59 | } | ||||
60 | | ||||
22 | RowLayout { | 61 | RowLayout { | ||
23 | id: orientation | 62 | id: orientation | ||
24 | Kirigami.FormData.label: i18n("Orientation:") | 63 | enabled: !element.autoRotate || !autoRotateColumn.enabled || !autoRotateColumn.visible | ||
25 | 64 | | |||
26 | Controls.ButtonGroup { | 65 | Controls.ButtonGroup { | ||
27 | buttons: orientation.children | 66 | buttons: orientation.children | ||
28 | } | 67 | } | ||
29 | 68 | | |||
30 | RotationButton { | 69 | RotationButton { | ||
31 | value: 0 | 70 | value: 0 | ||
32 | } | 71 | } | ||
33 | RotationButton { | 72 | RotationButton { | ||
34 | value: 90 | 73 | value: 90 | ||
35 | } | 74 | } | ||
36 | RotationButton { | 75 | RotationButton { | ||
37 | value: 180 | 76 | value: 180 | ||
38 | } | 77 | } | ||
39 | RotationButton { | 78 | RotationButton { | ||
40 | value: 270 | 79 | value: 270 | ||
41 | } | 80 | } | ||
42 | } | 81 | } | ||
82 | } |
There's enough horizontal space in the window to put this row next to the "Manual" label so it would be like so: