Browse Source

统一设置页面样式

master
mashiros 2 years ago
parent
commit
75d948494c
  1. 318
      reflection_clock.qml
  2. 192
      round_clock.qml
  3. 490
      solars_clock.qml
  4. 198
      text_clock.qml

318
reflection_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
@ -254,8 +255,6 @@ T.Widget {
visible: true
minimumWidth: 380
minimumHeight: 480
maximumWidth: minimumWidth
maximumHeight: minimumHeight
width: minimumWidth
height: minimumHeight
@ -263,193 +262,188 @@ T.Widget {
property var configuration
ColumnLayout {
id: root
Page {
id: cfg_page
anchors.fill: parent
anchors.margins: 16
anchors.topMargin: 0
Row {
spacing: 234
header: TitleBar {
text: qsTr("Settings")
ToolButton {
text: qsTr("Save")
onClicked: {
configuration = rootPreference.save();
widget.settings.styles = configuration;
styleDialog.active = false;
}
}
standardButtons: Dialog.Save | Dialog.Reset
ToolButton {
text: qsTr("Reset")
onClicked: {
rootPreference.load();
let cfg = rootPreference.save();
widget.settings.styles = cfg;
}
onAccepted: {
configuration = rootPreference.save();
widget.settings.styles = configuration;
styleDialog.active = false;
}
}
Label {
Layout.alignment: Qt.AlignCenter
text: qsTr("Settings")
font.pixelSize: 24
onReset: {
rootPreference.load();
let cfg = rootPreference.save();
widget.settings.styles = cfg;
}
}
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
ColumnLayout {
id: preferenceLayout
width: root.width
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
ColumnLayout {
id: root
anchors.fill: parent
anchors.margins: 16
anchors.topMargin: 0
label: qsTr("Configuration")
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
P.DialogPreference {
name: "Hour Settings"
label: qsTr("Hour Settings")
live: true
icon.name: "regular:\uf1de"
ColumnLayout {
id: preferenceLayout
width: root.width
P.SwitchPreference {
name: "Full Clock"
label: qsTr("24 Hour Clock")
defaultValue: true
}
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
P.Separator {}
label: qsTr("Configuration")
P.ColorPreference {
name: "Clock BG Color"
label: qsTr("Clock Background Color")
defaultValue: "#2196f3"
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
P.ColorPreference {
name: "Clock Font Color"
label: qsTr("Clock Font Color")
defaultValue: "#ffffff"
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: "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: "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.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.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.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.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;
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;
}
}
}

192
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;
}
header: TitleBar {
text: qsTr("Settings")
standardButtons: Dialog.Save | Dialog.Reset
onAccepted: {
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;
}
onReset: {
rootPreference.load();
let cfg = rootPreference.save();
widget.settings.styles = cfg;
}
}
Label {
Layout.alignment: Qt.AlignCenter
text: qsTr("Settings")
font.pixelSize: 24
}
ColumnLayout {
id: root
anchors.fill: parent
anchors.margins: 16
anchors.topMargin: 0
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
ColumnLayout {
id: preferenceLayout
width: root.width
ColumnLayout {
id: preferenceLayout
width: root.width
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
label: qsTr("Configuration")
label: qsTr("Configuration")
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
P.SwitchPreference {
name: "Sec Continue"
label: qsTr("Continuous Second Hand")
defaultValue: true
}
P.SwitchPreference {
name: "Sec Continue"
label: qsTr("Continuous Second Hand")
defaultValue: true
}
P.Separator {}
P.Separator {}
P.ColorPreference {
name: "BG Color"
label: qsTr("Background Color")
defaultValue: "#2196f3"
}
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.SliderPreference {
name: "BG Alpha"
label: qsTr("Background transparency")
from: 0
to: 100
stepSize: 1
defaultValue: 50
displayValue: value + "%"
}
P.Separator {}
P.Separator {}
P.ColorPreference {
name: "HGRID Color"
label: qsTr("Hour Scale Color")
defaultValue: "#fff"
}
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.ColorPreference {
name: "MGRID Color"
label: qsTr("Minute Scale Color")
defaultValue: "#fff"
}
P.Separator {}
P.Separator {}
P.ColorPreference {
name: "Hhand Color"
label: qsTr("Hour Hand Color")
defaultValue: "#fff"
}
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: "Mhand Color"
label: qsTr("Minute Hand Color")
defaultValue: "#fff"
}
P.ColorPreference {
name: "Shand Color"
label: qsTr("Second Hand Color")
defaultValue: "#F3A829"
}
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;
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;
}
}
}

490
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
}
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
ColumnLayout {
id: preferenceLayout
width: root.width
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
label: qsTr("Configuration")
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
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 + "%"
}
standardButtons: Dialog.Save | Dialog.Reset
P.Separator {}
P.SwitchPreference {
id: showClock
name: "Show Clock"
label: qsTr("Display Time")
defaultValue: true
}
onAccepted: {
configuration = rootPreference.save();
widget.settings.styles = configuration;
styleDialog.active = false;
}
P.ColorPreference {
name: "Clock Color"
label: qsTr("Font Color")
enabled: showClock.value
defaultValue: "#616161"
}
onReset: {
rootPreference.load();
let cfg = rootPreference.save();
widget.settings.styles = cfg;
}
}
P.SliderPreference {
name: "Font Size"
label: qsTr("Font Size")
enabled: showClock.value
from: 50
to: 100
stepSize: 1
defaultValue: 100
displayValue: value + "%"
}
}
ColumnLayout {
id: root
anchors.fill: parent
anchors.margins: 16
anchors.topMargin: 0
P.Separator {}
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
P.DialogPreference {
name: "Hour Settings"
label: qsTr("Hour Settings")
live: true
icon.name: "regular:\uf1de"
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
P.ColorPreference {
name: "Hstar Color"
label: qsTr("Star Color")
defaultValue: "#ffa000"
}
ColumnLayout {
id: preferenceLayout
width: root.width
P.Separator {}
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
P.SwitchPreference {
id: hour_settings_show_orbit
name: "Show Orbit"
label: qsTr("Show Orbit")
defaultValue: true
}
label: qsTr("Configuration")
P.ColorPreference {
name: "Horbit Color"
label: qsTr("Orbit Color")
enabled: hour_settings_show_orbit.value
defaultValue: "#616161"
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
}
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.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: min_settings_show_orbit
name: "Show Orbit"
label: qsTr("Show Orbit")
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: "Morbit Color"
label: qsTr("Orbit Color")
enabled: min_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.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.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.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.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;
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;
}
}
}

198
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;
}
header: TitleBar {
text: qsTr("Settings")
standardButtons: Dialog.Save | Dialog.Reset
onAccepted: {
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;
}
onReset: {
rootPreference.load();
let cfg = rootPreference.save();
widget.settings.styles = cfg;
}
}
Label {
Layout.alignment: Qt.AlignCenter
text: qsTr("Settings")
font.pixelSize: 24
}
ColumnLayout {
id: root
anchors.fill: parent
anchors.margins: 16
anchors.topMargin: 0
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
clip: true
contentWidth: preferenceLayout.implicitWidth
contentHeight: preferenceLayout.implicitHeight
ColumnLayout {
id: preferenceLayout
width: root.width
ColumnLayout {
id: preferenceLayout
width: root.width
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
P.PreferenceGroup {
id: rootPreference
Layout.fillWidth: true
label: qsTr("Configuration")
label: qsTr("Configuration")
onPreferenceEdited: {
widget.settings.styles = rootPreference.save();
}
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 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.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: "HighLight Color"
label: qsTr("HighLight Color")
defaultValue: "#FFF"
}
P.ColorPreference {
name: "Normal Color"
label: qsTr("Normal Color")
defaultValue: "#333333"
}
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: "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: "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)
}
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;
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…
Cancel
Save