11/******************************************************************************
22 *
3- * Copyright (C) 2018-2019 Marton Borzak <hello@martonborzak.com>
3+ * Copyright (C) 2018-2020 Marton Borzak <hello@martonborzak.com>
44 *
55 * This file is part of the YIO-Remote software project.
66 *
2222import QtQuick 2.11
2323import Style 1.0
2424
25+ import Haptic 1.0
2526import Entity.Remote 1.0
2627
2728Item {
2829 width: parent .width - 60
2930 anchors .horizontalCenter : parent .horizontalCenter
3031
3132 Rectangle {
32- id: bg
33+ id: powerButton
3334 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
3636 radius: height/ 2
3737 color: Style .color .red
38- anchors .top : parent .top
39- anchors .left : parent .left
38+ anchors { top: parent .top ; left: parent .left }
4039
4140 Text {
4241 color: Style .color .line
4342 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
4945 font {family: " icons" ; pixelSize: 60 }
5046 anchors .centerIn : parent
5147 }
5450 id: mouseArea
5551 anchors .fill : parent
5652 onClicked: {
57- haptic .playEffect (Haptic .Click );
53+ Haptic .playEffect (Haptic .Click );
5854 if (obj .isSupported (Remote .F_POWER_TOGGLE )) {
5955 obj .powerToggle ();
6056 } else if (obj .isSupported (Remote .F_POWER_ON ) && obj .isSupported (Remote .F_POWER_OFF )) {
@@ -69,44 +65,90 @@ Item {
6965
7066 Button {
7167 visible: obj .isSupported (Remote .F_SOURCE )
72- anchors .top : parent .top
73- anchors .right : parent .right
68+ anchors { top: parent .top ; right: parent .right }
7469 title: qsTr (" Source" ) + translateHandler .emptyString
75- mouseArea .onClicked : {
76- obj .source ();
77- }
70+ mouseArea .onClicked : { obj .source (); }
7871 }
7972
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 ); }
8784 }
88- }
8985
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 ); }
9790 }
98- }
9991
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 ); }
107132 }
108- }
109133
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+ }
110152}
111153
112154
0 commit comments