1
1
/******************************************************************************
2
2
*
3
- * Copyright (C) 2018-2019 Marton Borzak <hello@martonborzak.com>
3
+ * Copyright (C) 2018-2020 Marton Borzak <hello@martonborzak.com>
4
4
*
5
5
* This file is part of the YIO-Remote software project.
6
6
*
22
22
import QtQuick 2.11
23
23
import Style 1.0
24
24
25
+ import Haptic 1.0
25
26
import Entity.Remote 1.0
26
27
27
28
Item {
28
29
width: parent .width - 60
29
30
anchors .horizontalCenter : parent .horizontalCenter
30
31
31
32
Rectangle {
32
- id: bg
33
+ id: powerButton
33
34
visible: obj .isSupported (Remote .F_POWER_TOGGLE ) || (obj .isSupported (Remote .F_POWER_ON ) && obj .isSupported (Remote .F_POWER_OFF ))
34
- width: 110
35
- height: 60
35
+ width: 118 ; height: 60
36
36
radius: height/ 2
37
37
color: Style .color .red
38
- anchors .top : parent .top
39
- anchors .left : parent .left
38
+ anchors { top: parent .top ; left: parent .left }
40
39
41
40
Text {
42
41
color: Style .color .line
43
42
text: Style .icon .power_on
44
- renderType: Text .NativeRendering
45
- width: 70
46
- height: 70
47
- verticalAlignment: Text .AlignVCenter
48
- horizontalAlignment: Text .AlignHCenter
43
+ width: 70 ; height: 70
44
+ verticalAlignment: Text .AlignVCenter ; horizontalAlignment: Text .AlignHCenter
49
45
font {family: " icons" ; pixelSize: 60 }
50
46
anchors .centerIn : parent
51
47
}
54
50
id: mouseArea
55
51
anchors .fill : parent
56
52
onClicked: {
57
- haptic .playEffect (Haptic .Click );
53
+ Haptic .playEffect (Haptic .Click );
58
54
if (obj .isSupported (Remote .F_POWER_TOGGLE )) {
59
55
obj .powerToggle ();
60
56
} else if (obj .isSupported (Remote .F_POWER_ON ) && obj .isSupported (Remote .F_POWER_OFF )) {
@@ -69,44 +65,90 @@ Item {
69
65
70
66
Button {
71
67
visible: obj .isSupported (Remote .F_SOURCE )
72
- anchors .top : parent .top
73
- anchors .right : parent .right
68
+ anchors { top: parent .top ; right: parent .right }
74
69
title: qsTr (" Source" ) + translateHandler .emptyString
75
- mouseArea .onClicked : {
76
- obj .source ();
77
- }
70
+ mouseArea .onClicked : { obj .source (); }
78
71
}
79
72
80
- Button {
81
- visible: obj .isSupported (Remote .F_INFO )
82
- anchors .bottom : parent .bottom
83
- anchors .left : parent .left
84
- title: qsTr (" Info" ) + translateHandler .emptyString
85
- mouseArea .onClicked : {
86
- obj .info ();
73
+ Flow {
74
+ width: parent .width
75
+ visible: obj .isSupported (Remote .F_DIGIT_0 ) && obj .isSupported (Remote .F_DIGIT_1 ) && obj .isSupported (Remote .F_DIGIT_2 ) && obj .isSupported (Remote .F_DIGIT_3 ) && obj .isSupported (Remote .F_DIGIT_4 ) && obj .isSupported (Remote .F_DIGIT_5 )
76
+ && obj .isSupported (Remote .F_DIGIT_6 ) && obj .isSupported (Remote .F_DIGIT_7 ) && obj .isSupported (Remote .F_DIGIT_8 ) && obj .isSupported (Remote .F_DIGIT_9 )
77
+ anchors { top: powerButton .bottom ; topMargin: 30 ; horizontalCenter: parent .horizontalCenter }
78
+ spacing: 32
79
+
80
+ Button {
81
+ visible: obj .isSupported (Remote .F_DIGIT_1 )
82
+ title: " 1"
83
+ mouseArea .onClicked : { obj .channel (1 ); }
87
84
}
88
- }
89
85
90
- Button {
91
- visible: obj .isSupported (Remote .F_MENU )
92
- anchors .bottom : parent .bottom
93
- anchors .horizontalCenter : parent .horizontalCenter
94
- title: qsTr (" Menu" ) + translateHandler .emptyString
95
- mouseArea .onClicked : {
96
- obj .menu ();
86
+ Button {
87
+ visible: obj .isSupported (Remote .F_DIGIT_2 )
88
+ title: " 2"
89
+ mouseArea .onClicked : { obj .channel (2 ); }
97
90
}
98
- }
99
91
100
- Button {
101
- visible: obj .isSupported (Remote .F_GUIDE )
102
- anchors .bottom : parent .bottom
103
- anchors .right : parent .right
104
- title: qsTr (" Guide" ) + translateHandler .emptyString
105
- mouseArea .onClicked : {
106
- obj .guide ();
92
+ Button {
93
+ visible: obj .isSupported (Remote .F_DIGIT_3 )
94
+ title: " 3"
95
+ mouseArea .onClicked : { obj .channel (3 ); }
96
+ }
97
+
98
+ Button {
99
+ visible: obj .isSupported (Remote .F_DIGIT_4 )
100
+ title: " 4"
101
+ mouseArea .onClicked : { obj .channel (4 ); }
102
+ }
103
+
104
+ Button {
105
+ visible: obj .isSupported (Remote .F_DIGIT_5 )
106
+ title: " 5"
107
+ mouseArea .onClicked : { obj .channel (5 ); }
108
+ }
109
+
110
+ Button {
111
+ visible: obj .isSupported (Remote .F_DIGIT_6 )
112
+ title: " 6"
113
+ mouseArea .onClicked : { obj .channel (6 ); }
114
+ }
115
+
116
+ Button {
117
+ visible: obj .isSupported (Remote .F_DIGIT_7 )
118
+ title: " 7"
119
+ mouseArea .onClicked : { obj .channel (7 ); }
120
+ }
121
+
122
+ Button {
123
+ visible: obj .isSupported (Remote .F_DIGIT_8 )
124
+ title: " 8"
125
+ mouseArea .onClicked : { obj .channel (8 ); }
126
+ }
127
+
128
+ Button {
129
+ visible: obj .isSupported (Remote .F_DIGIT_9 )
130
+ title: " 9"
131
+ mouseArea .onClicked : { obj .channel (9 ); }
107
132
}
108
- }
109
133
134
+ Button {
135
+ visible: obj .isSupported (Remote .F_DIGIT_SEPARATOR )
136
+ title: " -"
137
+ mouseArea .onClicked : { }
138
+ }
139
+
140
+ Button {
141
+ visible: obj .isSupported (Remote .F_DIGIT_0 )
142
+ title: " 0"
143
+ mouseArea .onClicked : { obj .channel (0 ); }
144
+ }
145
+
146
+ Button {
147
+ visible: obj .isSupported (Remote .F_DIGIT_ENTER )
148
+ title: " Pre-CH"
149
+ mouseArea .onClicked : { }
150
+ }
151
+ }
110
152
}
111
153
112
154
0 commit comments