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 | enabled: kcm.orientationSensorAvailable && element.internal | ||||
30 | // TODO: Make this dependend on: | ||||
31 | // * tablet mode being available (?) | ||||
32 | | ||||
33 | Controls.RadioButton { | ||||
34 | id: autoRotateRadio | ||||
35 | text: i18n("Automatic") | ||||
36 | checked: autoRotateColumn.enabled && element.autoRotate | ||||
37 | onClicked: element.autoRotate = true | ||||
38 | } | ||||
39 | | ||||
40 | Controls.RadioButton { | ||||
41 | id: manualRotateRadio | ||||
42 | text: i18n("Manual") | ||||
43 | checked: !element.autoRotate || !autoRotateColumn.enabled | ||||
44 | onClicked: element.autoRotate = false | ||||
45 | } | ||||
46 | } | ||||
47 | | ||||
22 | RowLayout { | 48 | RowLayout { | ||
ngraham: There's enough horizontal space in the window to put this row next to the "Manual" label so it… | |||||
23 | id: orientation | 49 | id: orientation | ||
24 | Kirigami.FormData.label: i18n("Orientation:") | 50 | enabled: !element.autoRotate || !autoRotateColumn.enabled | ||
25 | 51 | | |||
26 | Controls.ButtonGroup { | 52 | Controls.ButtonGroup { | ||
27 | buttons: orientation.children | 53 | buttons: orientation.children | ||
28 | } | 54 | } | ||
29 | 55 | | |||
30 | RotationButton { | 56 | RotationButton { | ||
31 | value: 0 | 57 | value: 0 | ||
32 | } | 58 | } | ||
33 | RotationButton { | 59 | RotationButton { | ||
34 | value: 90 | 60 | value: 90 | ||
35 | } | 61 | } | ||
36 | RotationButton { | 62 | RotationButton { | ||
37 | value: 180 | 63 | value: 180 | ||
38 | } | 64 | } | ||
39 | RotationButton { | 65 | RotationButton { | ||
40 | value: 270 | 66 | value: 270 | ||
41 | } | 67 | } | ||
42 | } | 68 | } | ||
69 | } |
There's enough horizontal space in the window to put this row next to the "Manual" label so it would be like so: