Browse Source

- 统一接口

- 新增时钟样式vecto
master
mashiros 2 years ago
parent
commit
6cf739c5eb
  1. BIN
      Locales/zh.qm
  2. 756
      Locales/zh.ts
  3. 20
      package.json
  4. BIN
      preview/vecto_clock.png
  5. 9
      qml/Common.qml
  6. 112
      qml/ReflectionClock.qml
  7. 40
      qml/RoundClock.qml
  8. 116
      qml/SolarsClock.qml
  9. 59
      qml/TextClock.qml
  10. 628
      qml/VectoClock.qml
  11. 44
      qml/WidgetTemplate.qml
  12. 1
      qml/qmldir

BIN
Locales/zh.qm

Binary file not shown.

756
Locales/zh.ts

@ -0,0 +1,756 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>Common</name>
<message>
<location filename="qml/Common.qml" line="8"/>
<source>Light</source>
<translation></translation>
</message>
<message>
<location filename="qml/Common.qml" line="8"/>
<source>Normal</source>
<translation></translation>
</message>
<message>
<location filename="qml/Common.qml" line="8"/>
<source>Bold</source>
<translation></translation>
</message>
</context>
<context>
<name>ReflectionClock</name>
<message>
<location filename="qml/ReflectionClock.qml" line="16"/>
<source>Reflection Clock</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="292"/>
<location filename="qml/ReflectionClock.qml" line="318"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="302"/>
<source>Clock Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="357"/>
<source>Configuration</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="365"/>
<source>Hour Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="371"/>
<source>24 Hour Clock</source>
<translation>24</translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="379"/>
<location filename="qml/ReflectionClock.qml" line="414"/>
<location filename="qml/ReflectionClock.qml" line="458"/>
<source>Clock Background Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="385"/>
<location filename="qml/ReflectionClock.qml" line="420"/>
<location filename="qml/ReflectionClock.qml" line="465"/>
<source>Clock Font Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="393"/>
<location filename="qml/ReflectionClock.qml" line="428"/>
<location filename="qml/ReflectionClock.qml" line="474"/>
<source>Panel Background Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="399"/>
<location filename="qml/ReflectionClock.qml" line="434"/>
<location filename="qml/ReflectionClock.qml" line="481"/>
<source>Panel Font Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="408"/>
<source>Minute Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="443"/>
<source>Second Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/ReflectionClock.qml" line="450"/>
<source>Show</source>
<translation></translation>
</message>
</context>
<context>
<name>RoundClock</name>
<message>
<location filename="qml/RoundClock.qml" line="15"/>
<location filename="qml/RoundClock.qml" line="346"/>
<source>Round Clock</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="320"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="330"/>
<source>Clock Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="385"/>
<source>Configuration</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="393"/>
<source>Continuous Second Hand</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="401"/>
<source>Background Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="407"/>
<source>Background transparency</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="419"/>
<source>Hour Scale Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="425"/>
<source>Minute Scale Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="433"/>
<source>Hour Hand Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="439"/>
<source>Minute Hand Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/RoundClock.qml" line="445"/>
<source>Second Hand Color</source>
<translation></translation>
</message>
</context>
<context>
<name>SolarsClock</name>
<message>
<location filename="qml/SolarsClock.qml" line="15"/>
<location filename="qml/SolarsClock.qml" line="430"/>
<source>Solar Clock</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="404"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="414"/>
<source>Clock Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="469"/>
<source>Configuration</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="477"/>
<source>Background Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="483"/>
<source>Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="489"/>
<source>Transparency</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="502"/>
<source>Show Scale</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="508"/>
<source>Scale Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="518"/>
<source>Show Center</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="524"/>
<source>Center Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="531"/>
<source>Center Radius</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="545"/>
<source>Display Time</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="551"/>
<source>Font Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="558"/>
<source>Font Style</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="566"/>
<source>Font Weight</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="574"/>
<source>Font Size</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="588"/>
<source>Hour Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="594"/>
<location filename="qml/SolarsClock.qml" line="623"/>
<location filename="qml/SolarsClock.qml" line="652"/>
<location filename="qml/SolarsClock.qml" line="681"/>
<source>Star Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="603"/>
<location filename="qml/SolarsClock.qml" line="632"/>
<location filename="qml/SolarsClock.qml" line="661"/>
<location filename="qml/SolarsClock.qml" line="690"/>
<source>Show Orbit</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="609"/>
<location filename="qml/SolarsClock.qml" line="638"/>
<location filename="qml/SolarsClock.qml" line="667"/>
<location filename="qml/SolarsClock.qml" line="696"/>
<source>Orbit Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="617"/>
<source>Minute Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="646"/>
<source>Second Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/SolarsClock.qml" line="675"/>
<source>Millisecond Settings</source>
<translation></translation>
</message>
</context>
<context>
<name>TextClock</name>
<message>
<location filename="qml/TextClock.qml" line="15"/>
<location filename="qml/TextClock.qml" line="186"/>
<source>Text Clock</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="160"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="170"/>
<source>Clock Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="225"/>
<source>Configuration</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="233"/>
<source>Font Style</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="241"/>
<source>Font Weight</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="249"/>
<source>HighLight Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="255"/>
<source>Normal Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="261"/>
<source>Font Size</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="271"/>
<source>Letter Space</source>
<translation></translation>
</message>
<message>
<location filename="qml/TextClock.qml" line="281"/>
<source>Line Spacing</source>
<translation></translation>
</message>
</context>
<context>
<name>VectoClock</name>
<message>
<location filename="qml/VectoClock.qml" line="17"/>
<location filename="qml/VectoClock.qml" line="303"/>
<source>Vecto Clock</source>
<translation>Vecto时钟</translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="63"/>
<location filename="qml/VectoClock.qml" line="287"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="342"/>
<source>Configuration</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="350"/>
<source>Weekday Settings</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="356"/>
<location filename="qml/VectoClock.qml" line="423"/>
<location filename="qml/VectoClock.qml" line="553"/>
<source>Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="362"/>
<location filename="qml/VectoClock.qml" line="482"/>
<location filename="qml/VectoClock.qml" line="559"/>
<source>Font Size</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="372"/>
<location filename="qml/VectoClock.qml" line="492"/>
<location filename="qml/VectoClock.qml" line="569"/>
<source>Font Style</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="379"/>
<location filename="qml/VectoClock.qml" line="499"/>
<location filename="qml/VectoClock.qml" line="576"/>
<source>Font Weight</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="386"/>
<location filename="qml/VectoClock.qml" line="506"/>
<location filename="qml/VectoClock.qml" line="583"/>
<source>Letter Spacing</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="396"/>
<location filename="qml/VectoClock.qml" line="526"/>
<location filename="qml/VectoClock.qml" line="603"/>
<source>Y Offset</source>
<translation>Y偏移量</translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="406"/>
<location filename="qml/VectoClock.qml" line="536"/>
<source>Gap</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="417"/>
<source>Line Settings</source>
<translation>线</translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="429"/>
<source>Width</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="439"/>
<source>Position</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="450"/>
<source>Clock Settings</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="456"/>
<source>24 Hour Clock</source>
<translation>24</translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="462"/>
<source>Text Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="469"/>
<source>Background Visible</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="475"/>
<source>Background Color</source>
<translation></translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="516"/>
<location filename="qml/VectoClock.qml" line="593"/>
<source>X Offset</source>
<translation>X偏移量</translation>
</message>
<message>
<location filename="qml/VectoClock.qml" line="547"/>
<source>Date Settings</source>
<translation></translation>
</message>
</context>
<context>
<name>reflection_clock</name>
<message>
<source>Save</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Show</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Reset</source>
<translation type="vanished"></translation>
</message>
<message>
<source>24 Hour Clock</source>
<translation type="vanished">24</translation>
</message>
<message>
<source>Reflection Clock</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Hour Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Second Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Configuration</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Minute Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Panel Background Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Panel Font Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Clock Background Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Clock Font Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Clock Settings</source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>round_clock</name>
<message>
<source>Save</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Reset</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Second Hand Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Hour Scale Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Minute Scale Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Round Clock</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Configuration</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Background Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Hour Hand Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Continuous Second Hand</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Minute Hand Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Clock Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Background transparency</source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>solars_clock</name>
<message>
<source>Save</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Reset</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Center Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Background Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Transparency</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Hour Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Solar Clock</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Star Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Show Center</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Font Size</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Orbit Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Font Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Millisecond Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Second Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Configuration</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Scale Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Show Orbit</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Show Scale</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Minute Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Display Time</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Center Radius</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Clock Settings</source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>text_clock</name>
<message>
<source>Save</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Reset</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Letter Space</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Font Size</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Font Weight</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Text Clock</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Font Style</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Configuration</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Normal Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>HighLight Color</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Line Spacing</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Clock Settings</source>
<translation type="vanished"></translation>
</message>
</context>
</TS>

20
package.json

@ -1,6 +1,6 @@
{
"name": "top.mashiros.widget.nclocks",
"version": "1.0.0",
"version": "1.0.1",
"title": {
"en": "Clock Collections Plugin",
@ -40,7 +40,7 @@
"zh": "太阳系时钟挂件"
},
"preview": "preview/solars_clock.png",
"entry": "solars_clock.qml"
"entry": "qml/SolarsClock.qml"
},
{
"location": "/nclocks/reflection",
@ -50,7 +50,7 @@
"zh": "倒影时钟挂件"
},
"preview": "preview/reflection_clock.png",
"entry": "reflection_clock.qml"
"entry": "qml/ReflectionClock.qml"
},
{
"location": "/nclocks/round",
@ -60,7 +60,7 @@
"zh": "圆盘时钟挂件"
},
"preview": "preview/round_clock.png",
"entry": "round_clock.qml"
"entry": "qml/RoundClock.qml"
},
{
"location": "/nclocks/text",
@ -70,7 +70,17 @@
"zh": "文字时钟挂件"
},
"preview": "preview/text_clock.png",
"entry": "text_clock.qml"
"entry": "qml/TextClock.qml"
},
{
"location": "/nclocks/vecto",
"catalog": "widget",
"title": {
"en": "Vecto Clock Widget",
"zh": "Vecto时钟挂件"
},
"preview": "preview/vecto_clock.png",
"entry": "qml/VectoClock.qml"
}
]
}

BIN
preview/vecto_clock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

9
qml/Common.qml

@ -0,0 +1,9 @@
pragma Singleton
import QtQuick 2.12
QtObject {
readonly property var fonts: Qt.fontFamilies()
readonly property var fontweight: [Font.Light, Font.Normal, Font.Bold]
readonly property var sfontweight: [qsTr("Light"), qsTr("Normal"), qsTr("Bold")]
}

112
reflection_clock.qml → qml/ReflectionClock.qml

@ -11,16 +11,40 @@ import NERvGear.Preferences 1.0 as P
T.Widget {
WidgetTemplate {
id: widget
solid: true
title: qsTr("Reflection Clock")
editing: styleDialog.active
resizable: true
version: "1.0.0"
defaultValues: {
"Hour Settings": {
"Full Clock": true,
"Clock BG Color": "#2196f3",
"Clock Font Color": "#ffffff",
"Panel BG Color": "#2196f3",
"Panel Font Color": "#ffffff"
},
"Min Settings": {
"Clock BG Color": "#2196f3",
"Clock Font Color": "#ffffff",
"Panel BG Color": "#2196f3",
"Panel Font Color": "#ffffff"
},
"Sec Settings": {
"Visible": true,
"Clock BG Color": "#ff006a",
"Clock Font Color": "#ffffff",
"Panel BG Color": "#ff006a",
"Panel Font Color": "#ffffff"
}
}
readonly property real minWH: Math.min(width/1.64, height)
readonly property real multi: minWH/220
readonly property bool full_clock: widget.settings.styles ? widget.settings.styles["Hour Settings"]["Full Clock"] : true
readonly property bool full_clock: widget.settings.styles["Hour Settings"]["Full Clock"]
property string am_pm: ""
Rectangle {
@ -45,7 +69,7 @@ T.Widget {
Rectangle {
id: hour_top
color: widget.settings.styles ? widget.settings.styles["Hour Settings"]["Clock BG Color"] : "#2196f3"
color: widget.settings.styles["Hour Settings"]["Clock BG Color"]
width: 100*multi
height: 80*multi
anchors.top: parent.top
@ -56,7 +80,11 @@ T.Widget {
Text {
id: hour_text
text: ""
color: widget.settings.styles ? widget.settings.styles["Hour Settings"]["Clock Font Color"] : "#ffffff"
style: Text.Outline
styleColor: "transparent"
color: widget.settings.styles["Hour Settings"]["Clock Font Color"]
anchors.centerIn: parent
font.pointSize: 35*multi
font.weight: Font.Light
@ -66,7 +94,7 @@ T.Widget {
Rectangle {
id: hour_bottom
color: widget.settings.styles ? widget.settings.styles["Hour Settings"]["Panel BG Color"] : "#2196f3"
color: widget.settings.styles["Hour Settings"]["Panel BG Color"]
width: 100*multi
height: 30*multi
anchors.top: hour_top.bottom
@ -76,7 +104,11 @@ T.Widget {
Text {
text: "HOURS"+am_pm
color: widget.settings.styles ? widget.settings.styles["Hour Settings"]["Panel Font Color"] : "#ffffff"
style: Text.Outline
styleColor: "transparent"
color: widget.settings.styles["Hour Settings"]["Panel Font Color"]
anchors.centerIn: parent
font.pointSize: 9*multi
font.weight: Font.Normal
@ -99,7 +131,7 @@ T.Widget {
Rectangle {
id: min_top
color: widget.settings.styles ? widget.settings.styles["Min Settings"]["Clock BG Color"] : "#2196f3"
color: widget.settings.styles["Min Settings"]["Clock BG Color"]
anchors.top: parent.top
anchors.topMargin: 0
anchors.left: parent.left
@ -110,7 +142,11 @@ T.Widget {
Text {
id: min_text
text: ""
color: widget.settings.styles ? widget.settings.styles["Min Settings"]["Clock Font Color"] : "#ffffff"
style: Text.Outline
styleColor: "transparent"
color: widget.settings.styles["Min Settings"]["Clock Font Color"]
anchors.centerIn: parent
font.pointSize: 35*multi
font.weight: Font.Light
@ -120,7 +156,7 @@ T.Widget {
Rectangle {
id: min_bottom
color: widget.settings.styles ? widget.settings.styles["Min Settings"]["Panel BG Color"] : "#2196f3"
color: widget.settings.styles["Min Settings"]["Panel BG Color"]
width: 100*multi
height: 30*multi
anchors.top: min_top.bottom
@ -130,7 +166,11 @@ T.Widget {
Text {
text: "MINUTES"
color: widget.settings.styles ? widget.settings.styles["Min Settings"]["Panel Font Color"] : "#ffffff"
style: Text.Outline
styleColor: "transparent"
color: widget.settings.styles["Min Settings"]["Panel Font Color"]
anchors.centerIn: parent
font.pointSize: 9*multi
font.weight: Font.Normal
@ -148,13 +188,13 @@ T.Widget {
anchors.topMargin: 0
anchors.left: min.right
anchors.leftMargin: 15*multi
visible: widget.settings.styles ? widget.settings.styles["Sec Settings"]["Visible"] : true
visible: widget.settings.styles["Sec Settings"]["Visible"]
width: 100*multi
height: 111*multi
Rectangle {
id: sec_top
color: widget.settings.styles ? widget.settings.styles["Sec Settings"]["Clock BG Color"] : "#ff006a"
color: widget.settings.styles["Sec Settings"]["Clock BG Color"]
width: 100*multi
height: 80*multi
anchors.top: parent.top
@ -165,7 +205,11 @@ T.Widget {
Text {
id: sec_text
text: ""
color: widget.settings.styles ? widget.settings.styles["Sec Settings"]["Clock Font Color"] : "#ffffff"
style: Text.Outline
styleColor: "transparent"
color: widget.settings.styles["Sec Settings"]["Clock Font Color"]
anchors.centerIn: parent
font.pointSize: 35*multi
font.weight: Font.Light
@ -175,7 +219,7 @@ T.Widget {
Rectangle {
id: sec_bottom
color: widget.settings.styles ? widget.settings.styles["Sec Settings"]["Panel BG Color"] : "#ff006a"
color: widget.settings.styles["Sec Settings"]["Panel BG Color"]
width: 100*multi
height: 30*multi
anchors.top: sec_top.bottom
@ -185,7 +229,11 @@ T.Widget {
Text {
text: "SECONDS"
color: widget.settings.styles ? widget.settings.styles["Sec Settings"]["Panel Font Color"] : "#ffffff"
style: Text.Outline
styleColor: "transparent"
color: widget.settings.styles["Sec Settings"]["Panel Font Color"]
anchors.centerIn: parent
font.pointSize: 9*multi
font.weight: Font.Normal
@ -321,7 +369,7 @@ T.Widget {
P.SwitchPreference {
name: "Full Clock"
label: qsTr("24 Hour Clock")
defaultValue: true
defaultValue: defaultValues["Hour Settings"]["Full Clock"]
}
P.Separator {}
@ -329,13 +377,13 @@ T.Widget {
P.ColorPreference {
name: "Clock BG Color"
label: qsTr("Clock Background Color")
defaultValue: "#2196f3"
defaultValue: defaultValues["Hour Settings"]["Clock BG Color"]
}
P.ColorPreference {
name: "Clock Font Color"
label: qsTr("Clock Font Color")
defaultValue: "#ffffff"
defaultValue: defaultValues["Hour Settings"]["Clock Font Color"]
}
P.Separator {}
@ -343,13 +391,13 @@ T.Widget {
P.ColorPreference {
name: "Panel BG Color"
label: qsTr("Panel Background Color")
defaultValue: "#2196f3"
defaultValue: defaultValues["Hour Settings"]["Panel BG Color"]
}
P.ColorPreference {
name: "Panel Font Color"
label: qsTr("Panel Font Color")
defaultValue: "#ffffff"
defaultValue: defaultValues["Hour Settings"]["Panel Font Color"]
}
}
@ -364,13 +412,13 @@ T.Widget {
P.ColorPreference {
name: "Clock BG Color"
label: qsTr("Clock Background Color")
defaultValue: "#2196f3"
defaultValue: defaultValues["Min Settings"]["Clock BG Color"]
}
P.ColorPreference {
name: "Clock Font Color"
label: qsTr("Clock Font Color")
defaultValue: "#ffffff"
defaultValue: defaultValues["Min Settings"]["Clock Font Color"]
}
P.Separator {}
@ -378,13 +426,13 @@ T.Widget {
P.ColorPreference {
name: "Panel BG Color"
label: qsTr("Panel Background Color")
defaultValue: "#2196f3"
defaultValue: defaultValues["Min Settings"]["Panel BG Color"]
}
P.ColorPreference {
name: "Panel Font Color"
label: qsTr("Panel Font Color")
defaultValue: "#ffffff"
defaultValue: defaultValues["Min Settings"]["Panel Font Color"]
}
}
@ -400,7 +448,7 @@ T.Widget {
id: cfg_sec_en
name: "Visible"
label: qsTr("Show")
defaultValue: true
defaultValue: defaultValues["Sec Settings"]["Visible"]
}
P.Separator {}
@ -409,14 +457,14 @@ T.Widget {
name: "Clock BG Color"
label: qsTr("Clock Background Color")
enabled: cfg_sec_en.value
defaultValue: "#ff006a"
defaultValue: defaultValues["Sec Settings"]["Clock BG Color"]
}
P.ColorPreference {
name: "Clock Font Color"
label: qsTr("Clock Font Color")
enabled: cfg_sec_en.value
defaultValue: "#ffffff"
defaultValue: defaultValues["Sec Settings"]["Clock Font Color"]
}
P.Separator {}
@ -425,22 +473,18 @@ T.Widget {
name: "Panel BG Color"
label: qsTr("Panel Background Color")
enabled: cfg_sec_en.value
defaultValue: "#ff006a"
defaultValue: defaultValues["Sec Settings"]["Panel BG Color"]
}
P.ColorPreference {
name: "Panel Font Color"
label: qsTr("Panel Font Color")
enabled: cfg_sec_en.value
defaultValue: "#ffffff"
defaultValue: defaultValues["Sec Settings"]["Panel Font Color"]
}
}
Component.onCompleted: {
if(!widget.settings.styles) {
configuration = rootPreference.save();
widget.settings.styles = configuration;
}
rootPreference.load(widget.settings.styles);
configuration = widget.settings.styles;
}

40
round_clock.qml → qml/RoundClock.qml

@ -10,18 +10,30 @@ import NERvGear.Preferences 1.0 as P
T.Widget {
WidgetTemplate {
id: widget
solid: true
title: qsTr("Round Clock")
editing: styleDialog.active
resizable: true
version: "1.0.0"
defaultValues: {
"Sec Continue": true,
"BG Color": "#2196f3",
"BG Alpha": 50,
"HGRID Color": "#ffffff",
"MGRID Color": "#ffffff",
"Hhand Color": "#ffffff",
"Mhand Color": "#ffffff",
"Shand Color": "#f3a829"
}
property real maxr: Math.min(width/2, height/2) -10
property real thour: 0
property real tmin: 0
property real tsec: 0
property var configs: widget.settings.styles ? widget.settings.styles : {"Sec Continue":true,"BG Color":"#2196f3","BG Alpha":50,"HGRID Color":"#ffffff","MGRID Color":"#ffffff","Hhand Color":"#ffffff","Mhand Color":"#ffffff","Shand Color":"#f3a829"}
property var configs: widget.settings.styles
onConfigsChanged: {
background.requestPaint();
@ -331,7 +343,7 @@ T.Widget {
anchors.fill: parent
header: TitleBar {
text: qsTr("Settings")
text: qsTr("Round Clock")
standardButtons: Dialog.Save | Dialog.Reset
@ -379,7 +391,7 @@ T.Widget {
P.SwitchPreference {
name: "Sec Continue"
label: qsTr("Continuous Second Hand")
defaultValue: true
defaultValue: defaultValues["Sec Continue"]
}
P.Separator {}
@ -387,7 +399,7 @@ T.Widget {
P.ColorPreference {
name: "BG Color"
label: qsTr("Background Color")
defaultValue: "#2196f3"
defaultValue: defaultValues["BG Color"]
}
P.SliderPreference {
@ -396,7 +408,7 @@ T.Widget {
from: 0
to: 100
stepSize: 1
defaultValue: 50
defaultValue: defaultValues["BG Alpha"]
displayValue: value + "%"
}
@ -405,13 +417,13 @@ T.Widget {
P.ColorPreference {
name: "HGRID Color"
label: qsTr("Hour Scale Color")
defaultValue: "#fff"
defaultValue: defaultValues["HGRID Color"]
}
P.ColorPreference {
name: "MGRID Color"
label: qsTr("Minute Scale Color")
defaultValue: "#fff"
defaultValue: defaultValues["MGRID Color"]
}
P.Separator {}
@ -419,26 +431,22 @@ T.Widget {
P.ColorPreference {
name: "Hhand Color"
label: qsTr("Hour Hand Color")
defaultValue: "#fff"
defaultValue: defaultValues["Hhand Color"]
}
P.ColorPreference {
name: "Mhand Color"
label: qsTr("Minute Hand Color")
defaultValue: "#fff"
defaultValue: defaultValues["Mhand Color"]
}
P.ColorPreference {
name: "Shand Color"
label: qsTr("Second Hand Color")
defaultValue: "#F3A829"
defaultValue: defaultValues["Shand Color"]
}
Component.onCompleted: {
if(!widget.settings.styles) {
configuration = rootPreference.save();
widget.settings.styles = configuration;
}
rootPreference.load(widget.settings.styles);
configuration = widget.settings.styles;
}

116
solars_clock.qml → qml/SolarsClock.qml

@ -10,14 +10,50 @@ import NERvGear.Preferences 1.0 as P
T.Widget {
WidgetTemplate {
id: widget
solid: true
title: qsTr("Solar Clock")
resizable: true
editing: styleDialog.active
version: "1.0.0"
defaultValues: {
"BG Settings": {
"BG Color": "#212121",
"BG Alpha": 100,
"Show HGrid": true,
"HGRID Color": "#616161",
"Show Center": true,
"Center Color": "#ffeb3b",