diff --git a/ClearClock.tar.gz b/ClearClock.tar.gz index 0fd2bf7..a2a54f9 100644 Binary files a/ClearClock.tar.gz and b/ClearClock.tar.gz differ diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index 4d419e7..afd4a81 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -17,7 +17,7 @@ - ClearClock Default + ccdefault @@ -42,7 +42,7 @@ - ClearClock Default + ccdefault @@ -71,7 +71,7 @@ - ClearClock Default + ccdefault diff --git a/package/contents/ui/config/configAppearance.qml b/package/contents/ui/config/configAppearance.qml index f8b0b8a..71ca4a5 100644 --- a/package/contents/ui/config/configAppearance.qml +++ b/package/contents/ui/config/configAppearance.qml @@ -10,6 +10,8 @@ import QtQuick.Dialogs 1.2 import org.kde.kirigami 2.3 as Kirigami +import "../lib" + Item { id: appearancePage width: childrenRect.width @@ -18,7 +20,7 @@ Item { signal configurationChanged property alias cfg_clockUse24hFormat: use24hFormat.checkState - property string cfg_clockFontColor: clockFontColorRect.color + property string cfg_clockFontColor: clockFontColor.value property string cfg_clockFontFamily property alias cfg_clockBoldText: clockBoldCheckBox.checked property alias cfg_clockItalicText: clockItalicCheckBox.checked @@ -39,6 +41,7 @@ Item { property alias cfg_dateItalicText: dateItalicCheckBox.checked property alias cfg_dateFontSize: dateFontSizeSpinBox.value + function fixFontFamilyChange(id, comboBox) { // HACK by the time we populate our model and/or the ComboBox is finished the value is still undefined if (id) { @@ -73,7 +76,7 @@ Item { }) arr.push({ "text": "ClearClock Default", - "value": "default" + "value": "ccdefault" }) var fonts = Qt.fontFamilies() diff --git a/package/contents/ui/lib/ConfigColor.qml b/package/contents/ui/lib/ConfigColor.qml deleted file mode 100644 index 2af46c8..0000000 --- a/package/contents/ui/lib/ConfigColor.qml +++ /dev/null @@ -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 - } - } - } -} diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index a5d08ec..6a0d62d 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -42,13 +42,6 @@ Item { source: "../fonts/Smooch-Regular.ttf" } - function max(a, b) { - if (a > b) - return a - else - return b - } - Plasmoid.fullRepresentation: ColumnLayout { anchors.fill: parent spacing: -20 @@ -65,12 +58,13 @@ Item { id: textMetricsDayLabel font.family: dayLabel.font.family font.pixelSize: dayLabel.font.pixelSize + font.bold: dayLabel.font.bold text: " Wednesday " } Item { - width: max(textMetricsClockLabel.width, textMetricsDayLabel.width) - height: max(textMetricsClockLabel.height, textMetricsDayLabel.height) + width: Math.max(textMetricsClockLabel.width, textMetricsDayLabel.width) + height: Math.max(textMetricsClockLabel.height, textMetricsDayLabel.height) Layout.alignment: Qt.AlignCenter PlasmaComponents.Label { @@ -80,7 +74,7 @@ Item { text: Qt.formatTime(currentDateTime).replace(":", ".") 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 font.bold: plasmoid.configuration.clockBoldText font.italic: plasmoid.configuration.clockItalicText @@ -95,7 +89,7 @@ Item { text: Qt.formatDate(currentDateTime, "dddd") 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 font.bold: plasmoid.configuration.daykBoldText font.italic: plasmoid.configuration.dayItalicText @@ -111,7 +105,7 @@ Item { text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat) 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 font.bold: plasmoid.configuration.dateBoldText font.italic: plasmoid.configuration.dateItalicText