summaryrefslogtreecommitdiffstats
path: root/basicsuite/launchersettings
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/launchersettings')
-rw-r--r--basicsuite/launchersettings/SettingsButtonStyle.qml68
-rw-r--r--basicsuite/launchersettings/SettingsCheckBoxStyle.qml (renamed from basicsuite/launchersettings/WifiController.qml)33
-rw-r--r--basicsuite/launchersettings/SettingsGroupBoxStyle.qml81
-rw-r--r--basicsuite/launchersettings/SettingsRadioButtonStyle.qml66
-rw-r--r--basicsuite/launchersettings/WifiGroupBox.qml15
-rw-r--r--basicsuite/launchersettings/WifiNetworkList.qml (renamed from basicsuite/launchersettings/NetworkList.qml)60
-rw-r--r--basicsuite/launchersettings/main.qml229
-rw-r--r--basicsuite/launchersettings/preview_l.jpgbin18458 -> 106992 bytes
8 files changed, 388 insertions, 164 deletions
diff --git a/basicsuite/launchersettings/SettingsButtonStyle.qml b/basicsuite/launchersettings/SettingsButtonStyle.qml
new file mode 100644
index 0000000..bebae48
--- /dev/null
+++ b/basicsuite/launchersettings/SettingsButtonStyle.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://www.qt.io
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+
+ButtonStyle {
+ panel: Item {
+ implicitHeight: engine.smallFontSize() * 2.4
+ implicitWidth: engine.centimeter() * 5
+
+ BorderImage {
+ anchors.fill: parent
+ antialiasing: true
+ border.bottom: 8
+ border.top: 8
+ border.left: 8
+ border.right: 8
+ anchors.margins: control.pressed ? -4 : 0
+ source: control.pressed ? "images/button_pressed.png" : "images/button_default.png"
+ Text {
+ text: control.text
+ anchors.centerIn: parent
+ color: "white"
+ font.pixelSize: engine.smallFontSize()
+ renderType: Text.NativeRendering
+ }
+ }
+ }
+}
diff --git a/basicsuite/launchersettings/WifiController.qml b/basicsuite/launchersettings/SettingsCheckBoxStyle.qml
index 3725478..c7c55d0 100644
--- a/basicsuite/launchersettings/WifiController.qml
+++ b/basicsuite/launchersettings/SettingsCheckBoxStyle.qml
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: For any questions to Digia, please use the contact form at
-** http://qt.digia.com/
+** http://www.qt.io
**
** This file is part of the examples of the Qt Enterprise Embedded.
**
@@ -38,21 +38,24 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-import Qt.labs.wifi 0.1 as Wifi
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
-QtObject {
- function createWifiGroupBox()
- {
- if (Wifi.Interface.wifiSupported()) {
- var component = Qt.createComponent("WifiGroupBox.qml");
- var wifi = component.createObject(wifiOptions.contentItem);
- if (wifi == null) {
- wifiOptions.visible = false
- print("Error creating WifiGroupBox");
+CheckBoxStyle {
+ indicator: Rectangle {
+ implicitWidth: engine.mm(7)
+ implicitHeight: engine.mm(7)
+ radius: 10
+ border.color: "black"
+ border.width: 2
+ Rectangle {
+ visible: control.checked
+ color: "#45b7e2"
+ border.color: "darkblue"
+ radius: 10
+ anchors.margins: engine.mm(1)
+ anchors.fill: parent
}
- } else {
- wifiOptions.visible = false
- }
}
}
diff --git a/basicsuite/launchersettings/SettingsGroupBoxStyle.qml b/basicsuite/launchersettings/SettingsGroupBoxStyle.qml
new file mode 100644
index 0000000..c5c71b5
--- /dev/null
+++ b/basicsuite/launchersettings/SettingsGroupBoxStyle.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://www.qt.io
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+import QtQuick.Controls.Private 1.0
+
+// GroupBoxStyle currently is not available as a public API,
+// so we write our own by importing private Styles API.
+Style {
+ // The margin from the content item to the groupbox
+ padding {
+ top: (control.title.length > 0 ? TextSingleton.implicitHeight : 0) + 30
+ left: 8
+ right: 8
+ bottom: 8
+ }
+ // The groupbox frame
+ property Component panel: Item {
+ anchors.fill: parent
+
+ Text {
+ id: label
+ anchors.bottom: borderImage.top
+ anchors.margins: 2
+ text: control.title
+ font.pixelSize: engine.smallFontSize() * 1.1
+ color: "white"
+ renderType: Text.NativeRendering
+ }
+
+ BorderImage {
+ id: borderImage
+ anchors.fill: parent
+ anchors.topMargin: padding.top - 7
+ source: "images/groupbox.png"
+ border.left: 4
+ border.right: 4
+ border.top: 4
+ border.bottom: 4
+ }
+ }
+}
diff --git a/basicsuite/launchersettings/SettingsRadioButtonStyle.qml b/basicsuite/launchersettings/SettingsRadioButtonStyle.qml
new file mode 100644
index 0000000..9959ea1
--- /dev/null
+++ b/basicsuite/launchersettings/SettingsRadioButtonStyle.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+
+RadioButtonStyle {
+ indicator: Rectangle {
+ implicitWidth: engine.mm(7)
+ implicitHeight: engine.mm(7)
+ radius: 40
+ border.color: "black"
+ border.width: 2
+ Rectangle {
+ anchors.fill: parent
+ visible: control.checked
+ color: "#45b7e2"
+ border.color: "darkblue"
+ radius: 40
+ anchors.margins: engine.mm(1)
+ }
+ }
+ label: Label {
+ text: control.text
+ font.pixelSize: engine.smallFontSize() * 0.8
+ color: "white"
+ }
+}
diff --git a/basicsuite/launchersettings/WifiGroupBox.qml b/basicsuite/launchersettings/WifiGroupBox.qml
index e88f5cb..3ce35c9 100644
--- a/basicsuite/launchersettings/WifiGroupBox.qml
+++ b/basicsuite/launchersettings/WifiGroupBox.qml
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: For any questions to Digia, please use the contact form at
-** http://qt.digia.com/
+** http://www.qt.io
**
** This file is part of the examples of the Qt Enterprise Embedded.
**
@@ -38,10 +38,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-import QtQuick.Controls 1.0
+import QtQuick 2.2
+import QtQuick.Controls 1.2
import QtQuick.Layouts 1.0
-
import Qt.labs.wifi 0.1
ColumnLayout {
@@ -61,7 +60,7 @@ ColumnLayout {
Button {
id: wifiOnOffButton
Layout.fillWidth: true
- style: root.buttonStyle
+ style: SettingsButtonStyle {}
text: (wifiManager.backendReady) ? "Switch Off" : "Switch On"
onClicked: {
if (wifiManager.backendReady) {
@@ -77,7 +76,7 @@ ColumnLayout {
Button {
id: listNetworksButton
Layout.fillWidth: true
- style: root.buttonStyle
+ style: SettingsButtonStyle {}
visible: wifiManager.backendReady
text: (networkList.visible) ? "Hide wifi networks"
: "List available wifi networks"
@@ -85,9 +84,9 @@ ColumnLayout {
}
}
- NetworkList {
+ WifiNetworkList {
id: networkList
- implicitHeight: 400
+ implicitHeight: engine.centimeter(7)
Layout.fillWidth: true
visible: false
clip: true
diff --git a/basicsuite/launchersettings/NetworkList.qml b/basicsuite/launchersettings/WifiNetworkList.qml
index 1820dac..bbc99b0 100644
--- a/basicsuite/launchersettings/NetworkList.qml
+++ b/basicsuite/launchersettings/WifiNetworkList.qml
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: For any questions to Digia, please use the contact form at
-** http://qt.digia.com/
+** http://www.qt.io
**
** This file is part of the examples of the Qt Enterprise Embedded.
**
@@ -38,19 +38,21 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-import QtQuick.Controls 1.0
+import QtQuick 2.2
+import QtQuick.Controls 1.2
import Qt.labs.wifi 0.1
Item {
Component {
id: listDelegate
Rectangle {
- id: delegateBackground
property bool expanded: false
property bool connected: wifiManager.connectedSSID == network.ssid
property bool actingNetwork: networkView.currentNetworkSsid == network.ssid
- height: (expanded ? (connected ? 180: 260) : 70)
+ property int notExpandedHeight: ssidLabel.height + bssidLabel.height + engine.mm(4)
+ property int expandedHeight: notExpandedHeight + passwordInput.height + connectionButton.height + engine.mm(7)
+ property int connectedExpandedHeight: notExpandedHeight + connectionButton.height + engine.mm(4)
+ height: (expanded ? (connected ? connectedExpandedHeight : expandedHeight) : notExpandedHeight)
width: parent.width
clip: true // ### fixme
color: "#5C5C5C"
@@ -76,8 +78,9 @@ Item {
id: ssidLabel
anchors.top: parent.top
anchors.left: parent.left
- anchors.margins: 10
- font.pixelSize: 20
+ anchors.margins: engine.mm(1)
+ anchors.leftMargin: engine.mm(2)
+ font.pixelSize: engine.smallFontSize()
font.bold: true
color: "#E6E6E6"
text: network.ssid + (actingNetwork ? networkView.networkStateText : "");
@@ -87,41 +90,43 @@ Item {
id: bssidLabel
anchors.top: ssidLabel.bottom
anchors.left: parent.left
- anchors.margins: 5
- anchors.leftMargin: 40
+ anchors.margins: engine.mm(1)
+ anchors.leftMargin: engine.mm(6)
text: network.bssid
color: "#E6E6E6"
- font.pixelSize: ssidLabel.font.pixelSize * 0.5
+ font.pixelSize: ssidLabel.font.pixelSize * 0.8
}
Text {
id: flagsLabel
- x: 200
anchors.top: bssidLabel.top
+ anchors.left: bssidLabel.right
+ anchors.leftMargin: engine.mm(7)
text: (network.supportsWPA2 ? "WPA2 " : "")
+ (network.supportsWPA ? "WPA " : "")
+ (network.supportsWEP ? "WEP " : "")
+ (network.supportsWPS ? "WPS " : "");
color: "#E6E6E6"
- font.pixelSize: ssidLabel.font.pixelSize * 0.5
+ font.pixelSize: ssidLabel.font.pixelSize * 0.8
font.italic: true
}
Rectangle {
id: signalStrengthBar
- height: 20
- radius: 10
+ height: engine.mm(3)
+ radius: 20
antialiasing: true
- anchors.margins: 20
+ anchors.margins: engine.mm(2)
anchors.right: parent.right
anchors.top: parent.top
color: "#BF8888"
border.color: "#212126"
-
+ // ### TODO - Qt Wifi library should provide alternative methods
+ // of describing signal strength besides dBm.
property int strengthBarWidth: Math.max(100 + network.signalStrength, 0) / 100 * parent.width
onStrengthBarWidthChanged: {
- if (strengthBarWidth > parent.width * 0.7)
- signalStrengthBar.width = parent.width * 0.7
+ if (strengthBarWidth > parent.width * 0.55)
+ signalStrengthBar.width = parent.width * 0.55
else
signalStrengthBar.width = strengthBarWidth
}
@@ -135,19 +140,24 @@ Item {
TextField {
id: passwordInput
- y: 100
- height: 50
- width: 300
+ anchors.top: flagsLabel.bottom
+ anchors.topMargin: engine.mm(3)
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width * 0.36
+ height: font.pixelSize * 2.4
placeholderText: "Enter Password"
visible: !connected
- anchors.horizontalCenter: parent.horizontalCenter
- font.pixelSize: 18
+ font.pixelSize: engine.smallFontSize() * 0.8
+ echoMode: TextInput.Password
inputMethodHints: Qt.ImhNoPredictiveText
}
Button {
- style: root.buttonStyle
- y: passwordInput.visible ? passwordInput.y + passwordInput.height + 20 : passwordInput.y
+ id: connectionButton
+ style: SettingsButtonStyle {}
+ y: connected ? passwordInput.y
+ : passwordInput.y + passwordInput.height + engine.mm(2)
+ width: passwordInput.width
anchors.horizontalCenter: parent.horizontalCenter
text: connected ? "Disconnect" : "Connect"
onClicked: connected ? wifiManager.disconnect()
diff --git a/basicsuite/launchersettings/main.qml b/basicsuite/launchersettings/main.qml
index 085ec4d..c698aaf 100644
--- a/basicsuite/launchersettings/main.qml
+++ b/basicsuite/launchersettings/main.qml
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: For any questions to Digia, please use the contact form at
-** http://qt.digia.com/
+** http://www.qt.io
**
** This file is part of the examples of the Qt Enterprise Embedded.
**
@@ -38,133 +38,58 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-
-import QtQuick.Controls 1.0
-import QtQuick.Layouts 1.0
-import QtQuick.Controls.Styles 1.0
-import QtQuick.Controls.Private 1.0
-import QtQuick.Window 2.1
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls.Styles 1.2
+import QtQuick.Enterprise.VirtualKeyboard.Settings 1.2
+import Qt.labs.wifi 0.1 as Wifi
import B2Qt.Utils 1.0
Rectangle {
- id: root
- width: 1280
- height: 800
+ anchors.fill: parent
color: "#212126"
- property int margin: 10
- property alias buttonStyle: buttonStyle
-
- // ******************************* STYLES **********************************
- Component {
- id: buttonStyle
- ButtonStyle {
- panel: Item {
- implicitHeight: 50
- implicitWidth: 320
- BorderImage {
- anchors.fill: parent
- antialiasing: true
- border.bottom: 8
- border.top: 8
- border.left: 8
- border.right: 8
- anchors.margins: control.pressed ? -4 : 0
- source: control.pressed ? "images/button_pressed.png" : "images/button_default.png"
- Text {
- text: control.text
- anchors.centerIn: parent
- color: "white"
- font.pixelSize: 22
- renderType: Text.NativeRendering
- }
- }
- }
- }
- }
- // GroupBoxStyle currently is not available as a public API, so we write our own...
- Component {
- id: groupBoxStyle
- Style {
- // The margin from the content item to the groupbox
- padding {
- top: (control.title.length > 0 ? TextSingleton.implicitHeight : 0) + 30
- left: 8
- right: 8
- bottom: 8
- }
- // The groupbox frame
- property Component panel: Item {
- anchors.fill: parent
-
- Text {
- id: label
- anchors.bottom: borderImage.top
- anchors.margins: 2
- text: control.title
- font.pixelSize: 22
- color: "white"
- renderType: Text.NativeRendering
- }
-
- BorderImage {
- id: borderImage
- anchors.fill: parent
- anchors.topMargin: padding.top - 7
- source: "images/groupbox.png"
- border.left: 4
- border.right: 4
- border.top: 4
- border.bottom: 4
- }
- }
- }
- }
-
- // ******************************** UI ****************************************
- Loader { id: wifiControllerLoader; source: "WifiController.qml" }
Flickable {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: margin
- anchors.topMargin: 50
+ anchors.topMargin: engine.mm(5)
height: parent.height
- width: mainLayout.width
- contentHeight: mainLayout.height + 100
+ width: parent.width
+ contentHeight: mainLayout.height + engine.centimeter(2)
contentWidth: mainLayout.width
flickableDirection: Flickable.VerticalFlick
+ leftMargin: (width - contentWidth) * 0.5
ColumnLayout {
id: mainLayout
- // can not use size of "root" here, it will shrink UI when virtual keyboard is open
- width: Math.min(Screen.width, Screen.height)
+ width: Math.min(engine.screenWidth(), engine.screenHeight())
height: implicitHeight
anchors.left: parent.left
anchors.right: parent.right
+ spacing: engine.mm(4)
GroupBox {
id: powerOptions
title: "Power"
Layout.fillWidth: true
- style: groupBoxStyle
+ style: SettingsGroupBoxStyle {}
implicitWidth: 0
+ height: implicitHeight
RowLayout {
- id: powerButtonRow
-
anchors.fill: parent
Button {
- style: buttonStyle
+ style: SettingsButtonStyle {}
text: "Shut Down"
Layout.fillWidth: true
onClicked: B2QtDevice.powerOff();
}
Button {
- style: buttonStyle
+ style: SettingsButtonStyle {}
text: "Reboot"
Layout.fillWidth: true
onClicked: B2QtDevice.reboot();
@@ -175,19 +100,27 @@ Rectangle {
GroupBox {
id: displayOptions
title: "Display"
- style: groupBoxStyle
+ style: SettingsGroupBoxStyle {}
Layout.fillWidth: true
implicitWidth: 0
+ height: implicitHeight
GridLayout {
- id: displayGrid
-
rows: 2
flow: GridLayout.TopToBottom
anchors.fill: parent
- Label { text: "Brightness: "; font.pixelSize: 18; color: "white" }
- Label { text: "Display FPS: "; font.pixelSize: 18; color: "white" }
+ Label {
+ text: "Brightness: "
+ font.pixelSize: engine.smallFontSize() * 0.8
+ color: "white"
+ }
+
+ Label {
+ text: "Display FPS: "
+ font.pixelSize: engine.smallFontSize() * 0.8
+ color: "white"
+ }
Slider {
id: brightnessSlider
@@ -195,11 +128,53 @@ Rectangle {
minimumValue: 1
Layout.fillWidth: true
value: B2QtDevice.displayBrightness
+ style: SliderStyle {
+ handle: Rectangle {
+ anchors.centerIn: parent
+ color: "white"
+ border.color: "gray"
+ border.width: 2
+ width: engine.mm(6)
+ height: engine.mm(6)
+ radius: 20
+ }
+ }
}
CheckBox {
+ style: SettingsCheckBoxStyle {}
checked: engine.fpsEnabled
- onCheckedChanged: engine.fpsEnabled = checked;
+ onCheckedChanged: engine.fpsEnabled = checked
+ }
+ }
+ }
+
+ GroupBox {
+ id: vkbOptions
+ title: "Virtual Keyboard Style"
+ style: SettingsGroupBoxStyle {}
+ Layout.fillWidth: true
+
+ function updateVKBStyle(styleRadioButton) {
+ VirtualKeyboardSettings.styleName = styleRadioButton.text.toLowerCase()
+ }
+
+ Row {
+ spacing: engine.mm(6)
+ ExclusiveGroup { id: vkbStyleGroup }
+ RadioButton {
+ id: defaultStyle
+ style: SettingsRadioButtonStyle {}
+ text: "Default"
+ exclusiveGroup: vkbStyleGroup
+ onClicked: vkbOptions.updateVKBStyle(defaultStyle)
+ }
+ RadioButton {
+ id: retroStyle
+ style: SettingsRadioButtonStyle {}
+ text: "Retro"
+ exclusiveGroup: vkbStyleGroup
+ onClicked: vkbOptions.updateVKBStyle(retroStyle)
}
}
@@ -208,34 +183,49 @@ Rectangle {
property: "displayBrightness"
value: brightnessSlider.value
}
+
+ Component.onCompleted: {
+ if (VirtualKeyboardSettings.styleName == "default")
+ defaultStyle.checked = true
+ if (VirtualKeyboardSettings.styleName == "retro")
+ retroStyle.checked = true
+ }
}
GroupBox {
id: networkOptions
title: "Network"
- style: groupBoxStyle
+ style: SettingsGroupBoxStyle {}
Layout.fillWidth: true
implicitWidth: 0
+ height: implicitHeight
GridLayout {
- id: networkGrid
-
rows: 2
columns: 3
flow: GridLayout.TopToBottom
anchors.fill: parent
- Label { text: "Hostname: "; font.pixelSize: 18; color: "white" }
- Label { text: "IP address: "; font.pixelSize: 18; color: "white"}
+ Label {
+ text: "Hostname: "
+ font.pixelSize: engine.smallFontSize() * 0.8
+ color: "white"
+ }
+
+ Label {
+ text: "IP address: "
+ font.pixelSize: engine.smallFontSize() * 0.8
+ color: "white"
+ }
TextField {
id: hostname
- implicitHeight: hostnameButton.height - 8
text: B2QtDevice.hostname
placeholderText: "Enter hostname"
+ font.pixelSize: engine.smallFontSize()
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhNoPredictiveText
- font.pixelSize: 18
Layout.fillWidth: true
+ Layout.preferredHeight: font.pixelSize * 2.4
onAccepted: {
Qt.inputMethod.commit()
Qt.inputMethod.hide()
@@ -246,16 +236,15 @@ Rectangle {
Label {
text: B2QtDevice.ipAddress
- font.pixelSize: 18
+ font.pixelSize: engine.smallFontSize()
color: "white"
Layout.columnSpan: 2
}
Button {
id: hostnameButton
- style: buttonStyle
+ style: SettingsButtonStyle {}
text: "Change hostname"
- implicitWidth: 260
onClicked: hostname.accepted()
}
}
@@ -264,15 +253,23 @@ Rectangle {
GroupBox {
id: wifiOptions
title: "Wifi"
- style: groupBoxStyle
+ style: SettingsGroupBoxStyle {}
Layout.fillWidth: true
- }
+ visible: false
+
+ function createWifiGroupBox()
+ {
+ if (Wifi.Interface.wifiSupported()) {
+ var component = Qt.createComponent("WifiGroupBox.qml")
+ var wifi = component.createObject(wifiOptions.contentItem)
+ if (wifi)
+ wifiOptions.visible = true
+ else
+ print("Error creating WifiGroupBox")
+ }
+ }
- Component.onCompleted: {
- if (wifiControllerLoader.item != undefined)
- wifiControllerLoader.item.createWifiGroupBox()
- else
- wifiOptions.visible = false
+ Component.onCompleted: wifiOptions.createWifiGroupBox()
}
}
}
diff --git a/basicsuite/launchersettings/preview_l.jpg b/basicsuite/launchersettings/preview_l.jpg
index b9b232b..a5496b0 100644
--- a/basicsuite/launchersettings/preview_l.jpg
+++ b/basicsuite/launchersettings/preview_l.jpg
Binary files differ