Update package

This commit is contained in:
qewer33 2021-12-20 19:23:27 +03:00
parent a0d8cb7b34
commit b15f62dabd
5 changed files with 14 additions and 68 deletions

Binary file not shown.

View file

@ -17,7 +17,7 @@
</entry> </entry>
<entry name="clockFontFamily" type="string"> <entry name="clockFontFamily" type="string">
<label>Sets the clock font family.</label> <label>Sets the clock font family.</label>
<default>ClearClock Default</default> <default>ccdefault</default>
</entry> </entry>
<entry name="clockBoldText" type="Bool"> <entry name="clockBoldText" type="Bool">
<label>Sets the clock font to bold.</label> <label>Sets the clock font to bold.</label>
@ -42,7 +42,7 @@
</entry> </entry>
<entry name="dayFontFamily" type="string"> <entry name="dayFontFamily" type="string">
<label>Sets the day font family.</label> <label>Sets the day font family.</label>
<default>ClearClock Default</default> <default>ccdefault</default>
</entry> </entry>
<entry name="dayBoldText" type="Bool"> <entry name="dayBoldText" type="Bool">
<label>Sets the day font to bold.</label> <label>Sets the day font to bold.</label>
@ -71,7 +71,7 @@
</entry> </entry>
<entry name="dateFontFamily" type="string"> <entry name="dateFontFamily" type="string">
<label>Sets the date font family.</label> <label>Sets the date font family.</label>
<default>ClearClock Default</default> <default>ccdefault</default>
</entry> </entry>
<entry name="dateBoldText" type="Bool"> <entry name="dateBoldText" type="Bool">
<label>Sets the date font to bold.</label> <label>Sets the date font to bold.</label>

View file

@ -10,6 +10,8 @@ import QtQuick.Dialogs 1.2
import org.kde.kirigami 2.3 as Kirigami import org.kde.kirigami 2.3 as Kirigami
import "../lib"
Item { Item {
id: appearancePage id: appearancePage
width: childrenRect.width width: childrenRect.width
@ -18,7 +20,7 @@ Item {
signal configurationChanged signal configurationChanged
property alias cfg_clockUse24hFormat: use24hFormat.checkState property alias cfg_clockUse24hFormat: use24hFormat.checkState
property string cfg_clockFontColor: clockFontColorRect.color property string cfg_clockFontColor: clockFontColor.value
property string cfg_clockFontFamily property string cfg_clockFontFamily
property alias cfg_clockBoldText: clockBoldCheckBox.checked property alias cfg_clockBoldText: clockBoldCheckBox.checked
property alias cfg_clockItalicText: clockItalicCheckBox.checked property alias cfg_clockItalicText: clockItalicCheckBox.checked
@ -39,6 +41,7 @@ Item {
property alias cfg_dateItalicText: dateItalicCheckBox.checked property alias cfg_dateItalicText: dateItalicCheckBox.checked
property alias cfg_dateFontSize: dateFontSizeSpinBox.value property alias cfg_dateFontSize: dateFontSizeSpinBox.value
function fixFontFamilyChange(id, comboBox) { function fixFontFamilyChange(id, comboBox) {
// HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined // HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined
if (id) { if (id) {
@ -73,7 +76,7 @@ Item {
}) })
arr.push({ arr.push({
"text": "ClearClock Default", "text": "ClearClock Default",
"value": "default" "value": "ccdefault"
}) })
var fonts = Qt.fontFamilies() var fonts = Qt.fontFamilies()

View file

@ -1,51 +0,0 @@
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Window 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import ".."
Button {
id: configColor
property alias horizontalAlignment: label.horizontalAlignment
property string configKey: ''
property string configValue: configKey ? plasmoid.configuration[configKey] : ""
property string defaultColor: ''
readonly property color value: configValue || defaultColor
onConfigValueChanged: {
if (configKey) {
plasmoid.configuration[configKey] = configValue
}
}
onClicked: dialog.open()
Rectangle {
anchors.fill: parent
color: configColor.value
border.width: 2
border.color: parent.containsMouse ? theme.highlightColor : "#BB000000"
}
ColorDialog {
id: dialog
visible: false
modality: Qt.WindowModal
title: configColor.label
showAlphaChannel: true
color: configColor.value
onCurrentColorChanged: {
if (visible && color != currentColor) {
configColor.configValue = currentColor
}
}
}
}

View file

@ -42,13 +42,6 @@ Item {
source: "../fonts/Smooch-Regular.ttf" source: "../fonts/Smooch-Regular.ttf"
} }
function max(a, b) {
if (a > b)
return a
else
return b
}
Plasmoid.fullRepresentation: ColumnLayout { Plasmoid.fullRepresentation: ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: -20 spacing: -20
@ -65,12 +58,13 @@ Item {
id: textMetricsDayLabel id: textMetricsDayLabel
font.family: dayLabel.font.family font.family: dayLabel.font.family
font.pixelSize: dayLabel.font.pixelSize font.pixelSize: dayLabel.font.pixelSize
font.bold: dayLabel.font.bold
text: " Wednesday " text: " Wednesday "
} }
Item { Item {
width: max(textMetricsClockLabel.width, textMetricsDayLabel.width) width: Math.max(textMetricsClockLabel.width, textMetricsDayLabel.width)
height: max(textMetricsClockLabel.height, textMetricsDayLabel.height) height: Math.max(textMetricsClockLabel.height, textMetricsDayLabel.height)
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
PlasmaComponents.Label { PlasmaComponents.Label {
@ -80,7 +74,7 @@ Item {
text: Qt.formatTime(currentDateTime).replace(":", ".") text: Qt.formatTime(currentDateTime).replace(":", ".")
color: plasmoid.configuration.clockFontColor color: plasmoid.configuration.clockFontColor
font.family: if (plasmoid.configuration.clockFontFamily === "default") fontOutfitBold.name font.family: if (plasmoid.configuration.clockFontFamily === "ccdefault") fontOutfitBold.name
else plasmoid.configuration.clockFontFamily else plasmoid.configuration.clockFontFamily
font.bold: plasmoid.configuration.clockBoldText font.bold: plasmoid.configuration.clockBoldText
font.italic: plasmoid.configuration.clockItalicText font.italic: plasmoid.configuration.clockItalicText
@ -95,7 +89,7 @@ Item {
text: Qt.formatDate(currentDateTime, "dddd") text: Qt.formatDate(currentDateTime, "dddd")
color: plasmoid.configuration.dayFontColor color: plasmoid.configuration.dayFontColor
font.family: if (plasmoid.configuration.dayFontFamily === "default") fontSmooch.name font.family: if (plasmoid.configuration.dayFontFamily === "ccdefault") fontSmooch.name
else plasmoid.configuration.dayFontFamily else plasmoid.configuration.dayFontFamily
font.bold: plasmoid.configuration.daykBoldText font.bold: plasmoid.configuration.daykBoldText
font.italic: plasmoid.configuration.dayItalicText font.italic: plasmoid.configuration.dayItalicText
@ -111,7 +105,7 @@ Item {
text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat) text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat)
color: plasmoid.configuration.dateFontColor color: plasmoid.configuration.dateFontColor
font.family: if (plasmoid.configuration.dateFontFamily === "default") fontOutfitRegular.name font.family: if (plasmoid.configuration.dateFontFamily === "ccdefault") fontOutfitRegular.name
else plasmoid.configuration.dateFontFamily else plasmoid.configuration.dateFontFamily
font.bold: plasmoid.configuration.dateBoldText font.bold: plasmoid.configuration.dateBoldText
font.italic: plasmoid.configuration.dateItalicText font.italic: plasmoid.configuration.dateItalicText