try to paint more pretty interface

This commit is contained in:
arcan1s 2015-01-08 02:00:59 +03:00
parent 54c5e7958a
commit 634b4c3b41
4 changed files with 188 additions and 39 deletions

View File

@ -29,8 +29,12 @@ Item {
property bool debug: NetctlAdds.isDebugEnabled() property bool debug: NetctlAdds.isDebugEnabled()
Grid { Column {
id: pageColumn
width: units.gridUnit * 25
QtControls.TabView { QtControls.TabView {
height: parent.height
width: parent.width
QtControls.Tab { QtControls.Tab {
title: i18n("About") title: i18n("About")
@ -55,6 +59,7 @@ Item {
} }
QtControls.Label { QtControls.Label {
anchors.top: parent.top
QtLayouts.Layout.fillWidth: true QtLayouts.Layout.fillWidth: true
font.capitalization: Font.SmallCaps font.capitalization: Font.SmallCaps
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter

View File

@ -16,7 +16,7 @@
***************************************************************************/ ***************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 1.0 as QtControls import QtQuick.Controls 1.3 as QtControls
import QtQuick.Controls.Styles 1.3 as QtStyles import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick.Layouts 1.0 as QtLayouts import QtQuick.Layouts 1.0 as QtLayouts
@ -28,6 +28,8 @@ Item {
id: appearancePage id: appearancePage
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: NetctlAdds.isDebugEnabled() property bool debug: NetctlAdds.isDebugEnabled()
property variant weight: { property variant weight: {
@ -48,13 +50,22 @@ Item {
property alias cfg_inactiveIconPath: inactiveIcon.text property alias cfg_inactiveIconPath: inactiveIcon.text
QtLayouts.ColumnLayout { Column {
QtLayouts.RowLayout { id: pageColumn
width: units.gridUnit * 25
Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Text align") text: i18n("Text align")
} }
QtControls.ComboBox { QtControls.ComboBox {
id: textAlign id: textAlign
width: parent.width * 2 / 3
textRole: "label" textRole: "label"
model: [ model: [
{ {
@ -85,36 +96,57 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font") text: i18n("Font")
} }
QtControls.Button { QtControls.Button {
id: selectFont id: selectFont
width: parent.width * 2 / 3
text: plasmoid.configuration.fontFamily text: plasmoid.configuration.fontFamily
onClicked: fontDialog.visible = true onClicked: fontDialog.visible = true
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font size") text: i18n("Font size")
} }
QtControls.SpinBox { QtControls.SpinBox {
id: fontSize id: fontSize
width: parent.width * 2 / 3
minimumValue: 8 minimumValue: 8
maximumValue: 24 maximumValue: 32
stepSize: 1 stepSize: 1
value: plasmoid.configuration.fontSize value: plasmoid.configuration.fontSize
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font weight") text: i18n("Font weight")
} }
QtControls.ComboBox { QtControls.ComboBox {
id: fontWeight id: fontWeight
width: parent.width * 2 / 3
textRole: "label" textRole: "label"
model: [ model: [
{ {
@ -149,12 +181,19 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font style") text: i18n("Font style")
} }
QtControls.ComboBox { QtControls.ComboBox {
id: fontStyle id: fontStyle
width: parent.width * 2 / 3
textRole: "label" textRole: "label"
model: [ model: [
{ {
@ -177,12 +216,19 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font color") text: i18n("Font color")
} }
QtControls.Button { QtControls.Button {
id: selectColor id: selectColor
width: parent.width * 2 / 3
style: QtStyles.ButtonStyle { style: QtStyles.ButtonStyle {
background: Rectangle { background: Rectangle {
color: plasmoid.configuration.fontColor color: plasmoid.configuration.fontColor
@ -193,16 +239,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Active icon") text: i18n("Active icon")
} }
QtControls.TextField { QtControls.TextField {
id: activeIcon id: activeIcon
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - activeIconButton.width
text: plasmoid.configuration.activeIconPath text: plasmoid.configuration.activeIconPath
} }
QtControls.Button { QtControls.Button {
id: activeIconButton
text: i18n("Browse") text: i18n("Browse")
onClicked: { onClicked: {
// FIXME: more clean directory definition // FIXME: more clean directory definition
@ -222,16 +276,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Inactive icon") text: i18n("Inactive icon")
} }
QtControls.TextField { QtControls.TextField {
id: inactiveIcon id: inactiveIcon
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - inactiveIconButton.width
text: plasmoid.configuration.inactiveIconPath text: plasmoid.configuration.inactiveIconPath
} }
QtControls.Button { QtControls.Button {
id: inactiveIconButton
text: i18n("Browse") text: i18n("Browse")
onClicked: { onClicked: {
// FIXME: more clean directory definition // FIXME: more clean directory definition

View File

@ -32,17 +32,27 @@ Item {
property variant cfg_dataengine: NetctlAdds.readDataEngineConfiguration() property variant cfg_dataengine: NetctlAdds.readDataEngineConfiguration()
QtLayouts.ColumnLayout { Column {
QtLayouts.RowLayout { id: pageColumn
width: units.gridUnit * 25
Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Path to netctl") text: i18n("Path to netctl")
} }
QtControls.TextField { QtControls.TextField {
id: netctlPath id: netctlPath
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - netctlPathButton.width
text: cfg_dataengine["NETCTLCMD"] text: cfg_dataengine["NETCTLCMD"]
} }
QtControls.Button { QtControls.Button {
id: netctlPathButton
text: i18n("Browse") text: i18n("Browse")
onClicked: netctlFileDialog.visible = true onClicked: netctlFileDialog.visible = true
} }
@ -57,16 +67,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Path to netctl-auto") text: i18n("Path to netctl-auto")
} }
QtControls.TextField { QtControls.TextField {
id: netctlAutoPath id: netctlAutoPath
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - netctlAutoPathButton.width
text: cfg_dataengine["NETCTLAUTOCMD"] text: cfg_dataengine["NETCTLAUTOCMD"]
} }
QtControls.Button { QtControls.Button {
id: netctlAutoPathButton
text: i18n("Browse") text: i18n("Browse")
onClicked: netctlAutoFileDialog.visible = true onClicked: netctlAutoFileDialog.visible = true
} }
@ -81,19 +99,25 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.CheckBox { QtControls.CheckBox {
id: extIp4 id: extIp4
height: parent.height
width: parent.width / 3
text: i18n("Check external IPv4") text: i18n("Check external IPv4")
checked: cfg_dataengine["EXTIP4"] == "true" checked: cfg_dataengine["EXTIP4"] == "true"
} }
QtControls.TextField { QtControls.TextField {
id: extIp4Path id: extIp4Path
enabled: extIp4.checked enabled: extIp4.checked
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - extIp4PathButton.width
text: cfg_dataengine["EXTIP4CMD"] text: cfg_dataengine["EXTIP4CMD"]
} }
QtControls.Button { QtControls.Button {
id: extIp4PathButton
enabled: extIp4.checked enabled: extIp4.checked
text: i18n("Browse") text: i18n("Browse")
onClicked: extIp4FileDialog.visible = true onClicked: extIp4FileDialog.visible = true
@ -109,19 +133,25 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.CheckBox { QtControls.CheckBox {
id: extIp6 id: extIp6
height: parent.height
width: parent.width / 3
text: i18n("Check external IPv6") text: i18n("Check external IPv6")
checked: cfg_dataengine["EXTIP6"] == "true" checked: cfg_dataengine["EXTIP6"] == "true"
} }
QtControls.TextField { QtControls.TextField {
id: extIp6Path id: extIp6Path
enabled: extIp6.checked enabled: extIp6.checked
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - extIp6PathButton.width
text: cfg_dataengine["EXTIP6CMD"] text: cfg_dataengine["EXTIP6CMD"]
} }
QtControls.Button { QtControls.Button {
id: extIp6PathButton
enabled: extIp6.checked enabled: extIp6.checked
text: i18n("Browse") text: i18n("Browse")
onClicked: extIp6FileDialog.visible = true onClicked: extIp6FileDialog.visible = true

View File

@ -16,7 +16,7 @@
***************************************************************************/ ***************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 1.0 as QtControls import QtQuick.Controls 1.3 as QtControls
import QtQuick.Dialogs 1.1 as QtDialogs import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick.Layouts 1.0 as QtLayouts import QtQuick.Layouts 1.0 as QtLayouts
@ -43,13 +43,23 @@ Item {
property alias cfg_textPattern: textPattern.text property alias cfg_textPattern: textPattern.text
QtLayouts.ColumnLayout { Column {
QtLayouts.RowLayout { id: pageColumn
width: units.gridUnit * 25
Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Auto update interval, msec") text: i18n("Auto update interval, msec")
} }
QtControls.SpinBox { QtControls.SpinBox {
id: autoUpdate id: autoUpdate
height: parent.height
width: parent.width * 2 / 3
minimumValue: 1000 minimumValue: 1000
maximumValue: 10000 maximumValue: 10000
stepSize: 500 stepSize: 500
@ -57,16 +67,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Path to GUI") text: i18n("Path to GUI")
} }
QtControls.TextField { QtControls.TextField {
id: guiPath id: guiPath
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - guiPathButton.width
text: plasmoid.configuration.guiPath text: plasmoid.configuration.guiPath
} }
QtControls.Button { QtControls.Button {
id: guiPathButton
text: i18n("Browse") text: i18n("Browse")
onClicked: guiFileDialog.visible = true onClicked: guiFileDialog.visible = true
} }
@ -81,18 +99,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.CheckBox { QtControls.CheckBox {
id: useHelper id: useHelper
height: parent.height
width: parent.width / 3
text: i18n("Use helper") text: i18n("Use helper")
} }
QtControls.TextField { QtControls.TextField {
id: helperPath id: helperPath
enabled: useHelper.checked enabled: useHelper.checked
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - helperPathButton.width
text: plasmoid.configuration.helperPath text: plasmoid.configuration.helperPath
} }
QtControls.Button { QtControls.Button {
id: helperPathButton
enabled: useHelper.checked enabled: useHelper.checked
text: i18n("Browse") text: i18n("Browse")
onClicked: helperFileDialog.visible = true onClicked: helperFileDialog.visible = true
@ -108,16 +132,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Path to netctl") text: i18n("Path to netctl")
} }
QtControls.TextField { QtControls.TextField {
id: netctlPath id: netctlPath
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - netctlPathButton.width
text: plasmoid.configuration.netctlPath text: plasmoid.configuration.netctlPath
} }
QtControls.Button { QtControls.Button {
id: netctlPathButton
text: i18n("Browse") text: i18n("Browse")
onClicked: netctlFileDialog.visible = true onClicked: netctlFileDialog.visible = true
} }
@ -132,16 +164,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.Label { QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Path to netctl-auto") text: i18n("Path to netctl-auto")
} }
QtControls.TextField { QtControls.TextField {
id: netctlAutoPath id: netctlAutoPath
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - netctlAutoPathButton.width
text: plasmoid.configuration.netctlAutoPath text: plasmoid.configuration.netctlAutoPath
} }
QtControls.Button { QtControls.Button {
id: netctlAutoPathButton
text: i18n("Browse") text: i18n("Browse")
onClicked: netctlAutoFileDialog.visible = true onClicked: netctlAutoFileDialog.visible = true
} }
@ -156,18 +196,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.CheckBox { QtControls.CheckBox {
id: useSudo id: useSudo
height: parent.height
width: parent.width / 3
text: i18n("Use sudo for netctl") text: i18n("Use sudo for netctl")
} }
QtControls.TextField { QtControls.TextField {
id: sudoPath id: sudoPath
enabled: useSudo.checked enabled: useSudo.checked
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - sudoPathButton.width
text: plasmoid.configuration.sudoPath text: plasmoid.configuration.sudoPath
} }
QtControls.Button { QtControls.Button {
id: sudoPathButton
enabled: useSudo.checked enabled: useSudo.checked
text: i18n("Browse") text: i18n("Browse")
onClicked: sudoFileDialog.visible = true onClicked: sudoFileDialog.visible = true
@ -183,18 +229,24 @@ Item {
} }
} }
QtLayouts.RowLayout { Row {
height: implicitHeight
width: parent.width
QtControls.CheckBox { QtControls.CheckBox {
id: useWifi id: useWifi
height: parent.height
width: parent.width / 3
text: i18n("Show 'Start WiFi menu'") text: i18n("Show 'Start WiFi menu'")
} }
QtControls.TextField { QtControls.TextField {
id: wifiPath id: wifiPath
enabled: useWifi.checked enabled: useWifi.checked
QtLayouts.Layout.fillWidth: true height: parent.height
width: parent.width * 2 / 3 - wifiPathButton.width
text: plasmoid.configuration.wifiPath text: plasmoid.configuration.wifiPath
} }
QtControls.Button { QtControls.Button {
id: wifiPathButton
enabled: useWifi.checked enabled: useWifi.checked
text: i18n("Browse") text: i18n("Browse")
onClicked: wifiFileDialog.visible = true onClicked: wifiFileDialog.visible = true
@ -212,7 +264,7 @@ Item {
QtControls.TextArea { QtControls.TextArea {
id: textPattern id: textPattern
QtLayouts.Layout.fillWidth: true width: parent.width
text: plasmoid.configuration.textPattern text: plasmoid.configuration.textPattern
} }
} }