统一设置页面样式
This commit is contained in:
parent
9509c53f9a
commit
75d948494c
@ -5,6 +5,7 @@ import QtQuick.Layouts 1.12
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import NERvGear 1.0 as NVG
|
||||
import NERvGear.Controls 1.0
|
||||
import NERvGear.Templates 1.0 as T
|
||||
import NERvGear.Preferences 1.0 as P
|
||||
|
||||
@ -254,8 +255,6 @@ T.Widget {
|
||||
visible: true
|
||||
minimumWidth: 380
|
||||
minimumHeight: 480
|
||||
maximumWidth: minimumWidth
|
||||
maximumHeight: minimumHeight
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
@ -263,194 +262,189 @@ T.Widget {
|
||||
|
||||
property var configuration
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
Page {
|
||||
id: cfg_page
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
Row {
|
||||
spacing: 234
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Save")
|
||||
onClicked: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Reset")
|
||||
onClicked: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
header: TitleBar {
|
||||
text: qsTr("Settings")
|
||||
font.pixelSize: 24
|
||||
|
||||
standardButtons: Dialog.Save | Dialog.Reset
|
||||
|
||||
onAccepted: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
|
||||
onReset: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ColumnLayout {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
|
||||
label: qsTr("Configuration")
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
label: qsTr("Configuration")
|
||||
|
||||
P.DialogPreference {
|
||||
name: "Hour Settings"
|
||||
label: qsTr("Hour Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
|
||||
P.SwitchPreference {
|
||||
name: "Full Clock"
|
||||
label: qsTr("24 Hour Clock")
|
||||
defaultValue: true
|
||||
P.DialogPreference {
|
||||
name: "Hour Settings"
|
||||
label: qsTr("Hour Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.SwitchPreference {
|
||||
name: "Full Clock"
|
||||
label: qsTr("24 Hour Clock")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock BG Color"
|
||||
label: qsTr("Clock Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Font Color"
|
||||
label: qsTr("Clock Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel BG Color"
|
||||
label: qsTr("Panel Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel Font Color"
|
||||
label: qsTr("Panel Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock BG Color"
|
||||
label: qsTr("Clock Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
P.DialogPreference {
|
||||
name: "Min Settings"
|
||||
label: qsTr("Minute Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Font Color"
|
||||
label: qsTr("Clock Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
P.ColorPreference {
|
||||
name: "Clock BG Color"
|
||||
label: qsTr("Clock Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Font Color"
|
||||
label: qsTr("Clock Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel BG Color"
|
||||
label: qsTr("Panel Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel Font Color"
|
||||
label: qsTr("Panel Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel BG Color"
|
||||
label: qsTr("Panel Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
P.DialogPreference {
|
||||
name: "Sec Settings"
|
||||
label: qsTr("Second Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.SwitchPreference {
|
||||
id: cfg_sec_en
|
||||
name: "Visible"
|
||||
label: qsTr("Show")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock BG Color"
|
||||
label: qsTr("Clock Background Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ff006a"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Font Color"
|
||||
label: qsTr("Clock Font Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel BG Color"
|
||||
label: qsTr("Panel Background Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ff006a"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel Font Color"
|
||||
label: qsTr("Panel Font Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel Font Color"
|
||||
label: qsTr("Panel Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.DialogPreference {
|
||||
name: "Min Settings"
|
||||
label: qsTr("Minute Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock BG Color"
|
||||
label: qsTr("Clock Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Font Color"
|
||||
label: qsTr("Clock Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel BG Color"
|
||||
label: qsTr("Panel Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel Font Color"
|
||||
label: qsTr("Panel Font Color")
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.DialogPreference {
|
||||
name: "Sec Settings"
|
||||
label: qsTr("Second Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.SwitchPreference {
|
||||
id: cfg_sec_en
|
||||
name: "Visible"
|
||||
label: qsTr("Show")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock BG Color"
|
||||
label: qsTr("Clock Background Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ff006a"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Font Color"
|
||||
label: qsTr("Clock Font Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel BG Color"
|
||||
label: qsTr("Panel Background Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ff006a"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Panel Font Color"
|
||||
label: qsTr("Panel Font Color")
|
||||
enabled: cfg_sec_en.value
|
||||
defaultValue: "#ffffff"
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
218
round_clock.qml
218
round_clock.qml
@ -4,6 +4,7 @@ import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import NERvGear 1.0 as NVG
|
||||
import NERvGear.Controls 1.0
|
||||
import NERvGear.Templates 1.0 as T
|
||||
import NERvGear.Preferences 1.0 as P
|
||||
|
||||
@ -139,7 +140,7 @@ T.Widget {
|
||||
renderTarget: Canvas.FramebufferObject
|
||||
renderStrategy: Canvas.Cooperative
|
||||
|
||||
rotation: thour*30+tmin*0.5+tsec*0.6/60
|
||||
rotation: thour*30+tmin*0.5+tsec*0.01
|
||||
|
||||
onWidthChanged: {
|
||||
requestPaint();
|
||||
@ -318,8 +319,6 @@ T.Widget {
|
||||
visible: true
|
||||
minimumWidth: 380
|
||||
minimumHeight: 540
|
||||
maximumWidth: minimumWidth
|
||||
maximumHeight: minimumHeight
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
@ -327,127 +326,122 @@ T.Widget {
|
||||
|
||||
property var configuration
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
Page {
|
||||
id: cfg_page
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
Row {
|
||||
spacing: 234
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Save")
|
||||
onClicked: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Reset")
|
||||
onClicked: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
header: TitleBar {
|
||||
text: qsTr("Settings")
|
||||
font.pixelSize: 24
|
||||
|
||||
standardButtons: Dialog.Save | Dialog.Reset
|
||||
|
||||
onAccepted: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
|
||||
onReset: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ColumnLayout {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
|
||||
label: qsTr("Configuration")
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
label: qsTr("Configuration")
|
||||
|
||||
P.SwitchPreference {
|
||||
name: "Sec Continue"
|
||||
label: qsTr("Continuous Second Hand")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "BG Color"
|
||||
label: qsTr("Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "BG Alpha"
|
||||
label: qsTr("Background transparency")
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 50
|
||||
displayValue: value + "%"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "HGRID Color"
|
||||
label: qsTr("Hour Scale Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "MGRID Color"
|
||||
label: qsTr("Minute Scale Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Hhand Color"
|
||||
label: qsTr("Hour Hand Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Mhand Color"
|
||||
label: qsTr("Minute Hand Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Shand Color"
|
||||
label: qsTr("Second Hand Color")
|
||||
defaultValue: "#F3A829"
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
|
||||
P.SwitchPreference {
|
||||
name: "Sec Continue"
|
||||
label: qsTr("Continuous Second Hand")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "BG Color"
|
||||
label: qsTr("Background Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "BG Alpha"
|
||||
label: qsTr("Background transparency")
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 50
|
||||
displayValue: value + "%"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "HGRID Color"
|
||||
label: qsTr("Hour Scale Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "MGRID Color"
|
||||
label: qsTr("Minute Scale Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Hhand Color"
|
||||
label: qsTr("Hour Hand Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Mhand Color"
|
||||
label: qsTr("Minute Hand Color")
|
||||
defaultValue: "#fff"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Shand Color"
|
||||
label: qsTr("Second Hand Color")
|
||||
defaultValue: "#F3A829"
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
492
solars_clock.qml
492
solars_clock.qml
@ -4,6 +4,7 @@ import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import NERvGear 1.0 as NVG
|
||||
import NERvGear.Controls 1.0
|
||||
import NERvGear.Templates 1.0 as T
|
||||
import NERvGear.Preferences 1.0 as P
|
||||
|
||||
@ -378,8 +379,6 @@ T.Widget {
|
||||
visible: true
|
||||
minimumWidth: 400
|
||||
minimumHeight: 660
|
||||
maximumWidth: minimumWidth
|
||||
maximumHeight: minimumHeight
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
@ -387,280 +386,275 @@ T.Widget {
|
||||
|
||||
property var configuration
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
Page {
|
||||
id: cfg_page
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
Row {
|
||||
spacing: 270
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Save")
|
||||
onClicked: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Reset")
|
||||
onClicked: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
header: TitleBar {
|
||||
text: qsTr("Settings")
|
||||
font.pixelSize: 24
|
||||
|
||||
standardButtons: Dialog.Save | Dialog.Reset
|
||||
|
||||
onAccepted: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
|
||||
onReset: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ColumnLayout {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
|
||||
label: qsTr("Configuration")
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
label: qsTr("Configuration")
|
||||
|
||||
P.DialogPreference {
|
||||
name: "BG Settings"
|
||||
label: qsTr("Background Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "BG Color"
|
||||
label: qsTr("Color")
|
||||
defaultValue: "#212121"
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "BG Alpha"
|
||||
label: qsTr("Transparency")
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 100
|
||||
displayValue: value + "%"
|
||||
P.DialogPreference {
|
||||
name: "BG Settings"
|
||||
label: qsTr("Background Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "BG Color"
|
||||
label: qsTr("Color")
|
||||
defaultValue: "#212121"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "BG Alpha"
|
||||
label: qsTr("Transparency")
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 100
|
||||
displayValue: value + "%"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: show_hgrid
|
||||
name: "Show HGrid"
|
||||
label: qsTr("Show Scale")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "HGRID Color"
|
||||
label: qsTr("Scale Color")
|
||||
enabled: show_hgrid.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: showCenter
|
||||
name: "Show Center"
|
||||
label: qsTr("Show Center")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Center Color"
|
||||
label: qsTr("Center Color")
|
||||
enabled: showCenter.value
|
||||
defaultValue: "#ffeb3b"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Center Radius"
|
||||
label: qsTr("Center Radius")
|
||||
enabled: showCenter.value
|
||||
from: 30
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 85
|
||||
displayValue: value + "%"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: showClock
|
||||
name: "Show Clock"
|
||||
label: qsTr("Display Time")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Color"
|
||||
label: qsTr("Font Color")
|
||||
enabled: showClock.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Font Size"
|
||||
label: qsTr("Font Size")
|
||||
enabled: showClock.value
|
||||
from: 50
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 100
|
||||
displayValue: value + "%"
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: show_hgrid
|
||||
name: "Show HGrid"
|
||||
label: qsTr("Show Scale")
|
||||
defaultValue: true
|
||||
P.DialogPreference {
|
||||
name: "Hour Settings"
|
||||
label: qsTr("Hour Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Hstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#ffa000"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: hour_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Horbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: hour_settings_show_orbit.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "HGRID Color"
|
||||
label: qsTr("Scale Color")
|
||||
enabled: show_hgrid.value
|
||||
defaultValue: "#616161"
|
||||
P.DialogPreference {
|
||||
name: "Min Settings"
|
||||
label: qsTr("Minute Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Mstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#ff5722"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: min_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Morbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: min_settings_show_orbit.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
P.DialogPreference {
|
||||
name: "Sec Settings"
|
||||
label: qsTr("Second Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.SwitchPreference {
|
||||
id: showCenter
|
||||
name: "Show Center"
|
||||
label: qsTr("Show Center")
|
||||
defaultValue: true
|
||||
P.ColorPreference {
|
||||
name: "Sstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: sec_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Sorbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: sec_settings_show_orbit.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Center Color"
|
||||
label: qsTr("Center Color")
|
||||
enabled: showCenter.value
|
||||
defaultValue: "#ffeb3b"
|
||||
P.DialogPreference {
|
||||
name: "MSec Settings"
|
||||
label: qsTr("Millisecond Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "MSstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#9e9e9e"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: msec_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "MSorbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: msec_settings_show_orbit.value
|
||||
defaultValue: "#9e9e9e"
|
||||
}
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Center Radius"
|
||||
label: qsTr("Center Radius")
|
||||
enabled: showCenter.value
|
||||
from: 30
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 85
|
||||
displayValue: value + "%"
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: showClock
|
||||
name: "Show Clock"
|
||||
label: qsTr("Display Time")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Clock Color"
|
||||
label: qsTr("Font Color")
|
||||
enabled: showClock.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Font Size"
|
||||
label: qsTr("Font Size")
|
||||
enabled: showClock.value
|
||||
from: 50
|
||||
to: 100
|
||||
stepSize: 1
|
||||
defaultValue: 100
|
||||
displayValue: value + "%"
|
||||
}
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.DialogPreference {
|
||||
name: "Hour Settings"
|
||||
label: qsTr("Hour Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Hstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#ffa000"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: hour_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Horbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: hour_settings_show_orbit.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
}
|
||||
|
||||
P.DialogPreference {
|
||||
name: "Min Settings"
|
||||
label: qsTr("Minute Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Mstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#ff5722"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: min_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Morbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: min_settings_show_orbit.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
}
|
||||
|
||||
P.DialogPreference {
|
||||
name: "Sec Settings"
|
||||
label: qsTr("Second Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Sstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#2196f3"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: sec_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Sorbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: sec_settings_show_orbit.value
|
||||
defaultValue: "#616161"
|
||||
}
|
||||
}
|
||||
|
||||
P.DialogPreference {
|
||||
name: "MSec Settings"
|
||||
label: qsTr("Millisecond Settings")
|
||||
live: true
|
||||
icon.name: "regular:\uf1de"
|
||||
|
||||
P.ColorPreference {
|
||||
name: "MSstar Color"
|
||||
label: qsTr("Star Color")
|
||||
defaultValue: "#9e9e9e"
|
||||
}
|
||||
|
||||
P.Separator {}
|
||||
|
||||
P.SwitchPreference {
|
||||
id: msec_settings_show_orbit
|
||||
name: "Show Orbit"
|
||||
label: qsTr("Show Orbit")
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "MSorbit Color"
|
||||
label: qsTr("Orbit Color")
|
||||
enabled: msec_settings_show_orbit.value
|
||||
defaultValue: "#9e9e9e"
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
216
text_clock.qml
216
text_clock.qml
@ -5,6 +5,7 @@ import QtQuick.Layouts 1.12
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import NERvGear 1.0 as NVG
|
||||
import NERvGear.Controls 1.0
|
||||
import NERvGear.Templates 1.0 as T
|
||||
import NERvGear.Preferences 1.0 as P
|
||||
|
||||
@ -161,8 +162,6 @@ T.Widget {
|
||||
visible: true
|
||||
minimumWidth: 380
|
||||
minimumHeight: 580
|
||||
maximumWidth: minimumWidth
|
||||
maximumHeight: minimumHeight
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
@ -170,127 +169,122 @@ T.Widget {
|
||||
|
||||
property var configuration
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
Page {
|
||||
id: cfg_page
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
Row {
|
||||
spacing: 234
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Save")
|
||||
onClicked: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: qsTr("Reset")
|
||||
onClicked: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
header: TitleBar {
|
||||
text: qsTr("Settings")
|
||||
font.pixelSize: 24
|
||||
|
||||
standardButtons: Dialog.Save | Dialog.Reset
|
||||
|
||||
onAccepted: {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
styleDialog.active = false;
|
||||
}
|
||||
|
||||
onReset: {
|
||||
rootPreference.load();
|
||||
let cfg = rootPreference.save();
|
||||
widget.settings.styles = cfg;
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ColumnLayout {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 0
|
||||
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
clip: true
|
||||
contentWidth: preferenceLayout.implicitWidth
|
||||
contentHeight: preferenceLayout.implicitHeight
|
||||
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
id: preferenceLayout
|
||||
width: root.width
|
||||
|
||||
label: qsTr("Configuration")
|
||||
P.PreferenceGroup {
|
||||
id: rootPreference
|
||||
Layout.fillWidth: true
|
||||
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
label: qsTr("Configuration")
|
||||
|
||||
P.SelectPreference {
|
||||
name: "Font Name"
|
||||
label: qsTr("Font Style")
|
||||
icon.name: "solid:\uf1fc"
|
||||
defaultValue: 408
|
||||
model: fonts
|
||||
}
|
||||
|
||||
P.SelectPreference {
|
||||
name: "Font Weight"
|
||||
label: qsTr("Font Weight")
|
||||
icon.name: "solid:\uf1fc"
|
||||
defaultValue: 0
|
||||
model: sfontweight
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "HighLight Color"
|
||||
label: qsTr("HighLight Color")
|
||||
defaultValue: "#FFF"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Normal Color"
|
||||
label: qsTr("Normal Color")
|
||||
defaultValue: "#333333"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Font Size"
|
||||
label: qsTr("Font Size")
|
||||
from: 1
|
||||
to: 40
|
||||
stepSize: 1
|
||||
defaultValue: 20
|
||||
displayValue: value
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Letter Space"
|
||||
label: qsTr("Letter Space")
|
||||
from: 1
|
||||
to: 40
|
||||
stepSize: 1
|
||||
defaultValue: 20
|
||||
displayValue: value
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Line Height"
|
||||
label: qsTr("Line Spacing")
|
||||
from: 0.8
|
||||
to: 2
|
||||
stepSize: 0.1
|
||||
defaultValue: 1.5
|
||||
displayValue: value.toFixed(1)
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
onPreferenceEdited: {
|
||||
widget.settings.styles = rootPreference.save();
|
||||
}
|
||||
|
||||
P.SelectPreference {
|
||||
name: "Font Name"
|
||||
label: qsTr("Font Style")
|
||||
icon.name: "solid:\uf1fc"
|
||||
defaultValue: 408
|
||||
model: fonts
|
||||
}
|
||||
|
||||
P.SelectPreference {
|
||||
name: "Font Weight"
|
||||
label: qsTr("Font Weight")
|
||||
icon.name: "solid:\uf1fc"
|
||||
defaultValue: 0
|
||||
model: sfontweight
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "HighLight Color"
|
||||
label: qsTr("HighLight Color")
|
||||
defaultValue: "#FFF"
|
||||
}
|
||||
|
||||
P.ColorPreference {
|
||||
name: "Normal Color"
|
||||
label: qsTr("Normal Color")
|
||||
defaultValue: "#333333"
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Font Size"
|
||||
label: qsTr("Font Size")
|
||||
from: 1
|
||||
to: 40
|
||||
stepSize: 1
|
||||
defaultValue: 20
|
||||
displayValue: value
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Letter Space"
|
||||
label: qsTr("Letter Space")
|
||||
from: 1
|
||||
to: 40
|
||||
stepSize: 1
|
||||
defaultValue: 20
|
||||
displayValue: value
|
||||
}
|
||||
|
||||
P.SliderPreference {
|
||||
name: "Line Height"
|
||||
label: qsTr("Line Spacing")
|
||||
from: 0.8
|
||||
to: 2
|
||||
stepSize: 0.1
|
||||
defaultValue: 1.5
|
||||
displayValue: value.toFixed(1)
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!widget.settings.styles) {
|
||||
configuration = rootPreference.save();
|
||||
widget.settings.styles = configuration;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
rootPreference.load(widget.settings.styles);
|
||||
configuration = widget.settings.styles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user