diff --git a/applets/binary-clock/package/contents/config/main.xml b/applets/binary-clock/package/contents/config/main.xml
--- a/applets/binary-clock/package/contents/config/main.xml
+++ b/applets/binary-clock/package/contents/config/main.xml
@@ -18,6 +18,9 @@
false
+
+ 4
+
false
diff --git a/applets/binary-clock/package/contents/ui/BinaryClock.qml b/applets/binary-clock/package/contents/ui/BinaryClock.qml
--- a/applets/binary-clock/package/contents/ui/BinaryClock.qml
+++ b/applets/binary-clock/package/contents/ui/BinaryClock.qml
@@ -37,40 +37,38 @@
Item {
id: main
- readonly property real w1: (main.height-5*units.smallSpacing)*dots/4
+ readonly property int gridThickness: plasmoid.configuration.gridThickness
+ readonly property int base: plasmoid.configuration.showBcdFormat ? 10 : 16
+ readonly property bool showOffLeds: plasmoid.configuration.showOffLeds
+ readonly property bool showGrid: plasmoid.configuration.showGrid
+ readonly property int formFactor: plasmoid.formFactor
+ readonly property bool constrained: formFactor == PlasmaCore.Types.Vertical || formFactor == PlasmaCore.Types.Horizontal
+ readonly property bool showSeconds: root.showSeconds
- Layout.minimumWidth: w1 < 20 ? 20 : w1
+ readonly property int dots: showSeconds ? 6 : 4
+ readonly property int dotSize: plasmoid.formFactor == PlasmaCore.Types.Horizontal
+ ? (height-(showGrid ? 5 : 3)*gridThickness)/4 // for horizontal taskbar
+ : (width-(dots+(showGrid ? 1 : -1))*gridThickness)/dots // for vertical taskbar
+ readonly property real appletWidth: dots*dotSize+gridThickness*(dots+(showGrid ? 3 : 1))
+
+ Layout.minimumWidth: Math.max(20, appletWidth)
Layout.maximumWidth: Infinity
Layout.preferredWidth: Layout.minimumWidth
- Layout.minimumHeight: 16+(units.smallSpacing*5)
+ Layout.minimumHeight: 16+(gridThickness*5)
//Layout.maximumHeight: vertical ? Layout.minimumHeight : Infinity
//Layout.preferredHeight: Layout.minimumHeight
- readonly property int formFactor: plasmoid.formFactor
-
- readonly property bool constrained: formFactor == PlasmaCore.Types.Vertical || formFactor == PlasmaCore.Types.Horizontal
-
- readonly property bool showSeconds: root.showSeconds
-
readonly property int hours: root.hours
readonly property int minutes: root.minutes
readonly property int seconds: root.seconds
- readonly property bool showOffLeds: plasmoid.configuration.showOffLeds
- readonly property bool showGrid: plasmoid.configuration.showGrid
-
- readonly property int base: plasmoid.configuration.showBcdFormat ? 10 : 16
-
- readonly property int dots: showSeconds ? 6 : 4
-
readonly property color onColor: plasmoid.configuration.useCustomColorForActive ? plasmoid.configuration.customColorForActive : theme.textColor
readonly property color offColor: plasmoid.configuration.useCustomColorForInactive ? plasmoid.configuration.customColorForInactive : Qt.rgba(onColor.r, onColor.g, onColor.b, 0.4)
readonly property color gridColor: plasmoid.configuration.useCustomColorForGrid ? plasmoid.configuration.customColorForGrid : Qt.rgba(onColor.r, onColor.g, onColor.b, 0.6)
- readonly property int dotSize: Math.min((height-5*units.smallSpacing)/4, (width-(dots+1)*units.smallSpacing)/dots)
- readonly property real displayTop: (height - 4*dotSize-3*units.smallSpacing)/2
- readonly property real displayLeft: (width - dots*dotSize-(dots-1)*units.smallSpacing)/2
+ readonly property real displayTop: (height - 4*dotSize-3*gridThickness)/2
+ readonly property real displayLeft: (width - dots*dotSize-(dots-1)*gridThickness)/2
/* displaying calendar after clicking binary clock applet */
MouseArea {
@@ -87,53 +85,53 @@
val: hours/base
}
DotColumn {
- x: displayLeft+(dotSize+units.smallSpacing)
+ x: displayLeft+(dotSize+gridThickness)
y: displayTop
val: hours%base
}
/* minutes */
DotColumn {
- x: displayLeft+(dotSize+units.smallSpacing)*2
+ x: displayLeft+(dotSize+gridThickness)*2
y: displayTop
val: minutes/base
}
DotColumn {
- x: displayLeft+(dotSize+units.smallSpacing)*3
+ x: displayLeft+(dotSize+gridThickness)*3
y: displayTop
val: minutes%base
}
/* seconds */
DotColumn {
- x: displayLeft+(dotSize+units.smallSpacing)*4
+ x: displayLeft+(dotSize+gridThickness)*4
y: displayTop
val: seconds/base
visible: showSeconds
}
DotColumn {
- x: displayLeft+(dotSize+units.smallSpacing)*5
+ x: displayLeft+(dotSize+gridThickness)*5
y: displayTop
val: seconds%base
visible: showSeconds
}
/* upper grid border */
Rectangle {
- x: displayLeft-units.smallSpacing
- y: displayTop-units.smallSpacing
- width: dots*(dotSize+units.smallSpacing)+units.smallSpacing
- height: units.smallSpacing
+ x: displayLeft-gridThickness
+ y: displayTop-gridThickness
+ width: dots*(dotSize+gridThickness)+gridThickness
+ height: gridThickness
visible: showGrid
color: gridColor
}
/* left grid border */
Rectangle {
- x: displayLeft-units.smallSpacing
+ x: displayLeft-gridThickness
y: displayTop
- width: units.smallSpacing
- height: 4*(dotSize+units.smallSpacing)
+ width: gridThickness
+ height: 4*(dotSize+gridThickness)
visible: showGrid
color: gridColor
}
diff --git a/applets/binary-clock/package/contents/ui/Dot.qml b/applets/binary-clock/package/contents/ui/Dot.qml
--- a/applets/binary-clock/package/contents/ui/Dot.qml
+++ b/applets/binary-clock/package/contents/ui/Dot.qml
@@ -44,17 +44,17 @@
x: 0
y: main.dotSize
width: main.dotSize
- height: units.smallSpacing
+ height: main.gridThickness
color: main.gridColor
}
/* right border for each square */
Rectangle {
visible: main.showGrid
x: main.dotSize
y: 0
- width: units.smallSpacing
- height: main.dotSize+units.smallSpacing
+ width: main.gridThickness
+ height: main.dotSize+main.gridThickness
color: main.gridColor
}
}
diff --git a/applets/binary-clock/package/contents/ui/DotColumn.qml b/applets/binary-clock/package/contents/ui/DotColumn.qml
--- a/applets/binary-clock/package/contents/ui/DotColumn.qml
+++ b/applets/binary-clock/package/contents/ui/DotColumn.qml
@@ -34,19 +34,19 @@
}
Dot {
x: 0
- y: (dotSize+units.smallSpacing)
+ y: (dotSize+main.gridThickness)
val: parent.val
bit: 4
}
Dot {
x: 0
- y: 2*(dotSize+units.smallSpacing)
+ y: 2*(dotSize+main.gridThickness)
val: parent.val
bit: 2
}
Dot {
x: 0
- y: 3*(dotSize+units.smallSpacing)
+ y: 3*(dotSize+main.gridThickness)
val: parent.val
bit: 1
}
diff --git a/applets/binary-clock/package/contents/ui/configGeneral.qml b/applets/binary-clock/package/contents/ui/configGeneral.qml
--- a/applets/binary-clock/package/contents/ui/configGeneral.qml
+++ b/applets/binary-clock/package/contents/ui/configGeneral.qml
@@ -35,6 +35,7 @@
property alias cfg_showOffLeds: showOffLedsCheckBox.checked
property alias cfg_showSeconds: showSecondsCheckBox.checked
property alias cfg_showBcdFormat: showBcdFormatCheckBox.checked
+ property alias cfg_gridThickness: gridThicknessSpinBox.value
property alias cfg_useCustomColorForActive: useCustomColorForActiveCheckBox.checked
property alias cfg_customColorForActive: customColorForActive.color
property alias cfg_useCustomColorForInactive: useCustomColorForInactiveCheckBox.checked
@@ -83,7 +84,6 @@
}
RowLayout {
-
QtControls.CheckBox {
id: useCustomColorForInactiveCheckBox
text: i18nc("@option:check", "Inactive LEDs")
@@ -96,7 +96,6 @@
}
RowLayout {
-
QtControls.CheckBox {
id: useCustomColorForGridCheckBox
text: i18nc("@option:check", "Grid")
@@ -107,4 +106,17 @@
enabled: useCustomColorForGridCheckBox.checked
}
}
+
+
+ Item {
+ Kirigami.FormData.isSection:true
+ }
+
+ RowLayout {
+ Kirigami.FormData.label:i18n("Grid thickness")
+
+ QtControls.SpinBox {
+ id: gridThicknessSpinBox
+ }
+ }
}