mirror of
https://github.com/developersu/ClearClock.git
synced 2025-05-14 19:20:26 +03:00
Attempt to fix font and color config issues
This commit is contained in:
parent
b446c9c112
commit
a0d8cb7b34
5 changed files with 59 additions and 8 deletions
Binary file not shown.
|
@ -14,6 +14,6 @@ ConfigModel {
|
|||
ConfigCategory {
|
||||
name: i18n("Appearance")
|
||||
icon: "preferences-desktop-color"
|
||||
source: "configAppearance.qml"
|
||||
source: "config/configAppearance.qml"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,14 +67,14 @@ Item {
|
|||
id: fontsModel
|
||||
Component.onCompleted: {
|
||||
var arr = [] // use temp array to avoid constant binding stuff
|
||||
arr.push({
|
||||
"text": "ClearClock Default",
|
||||
"value": "ClearClock Default"
|
||||
})
|
||||
arr.push({
|
||||
"text": i18nc("Use default font", "Default"),
|
||||
"value": ""
|
||||
})
|
||||
arr.push({
|
||||
"text": "ClearClock Default",
|
||||
"value": "default"
|
||||
})
|
||||
|
||||
var fonts = Qt.fontFamilies()
|
||||
var foundIndex = 0
|
51
package/contents/ui/lib/ConfigColor.qml
Normal file
51
package/contents/ui/lib/ConfigColor.qml
Normal file
|
@ -0,0 +1,51 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -80,7 +80,7 @@ Item {
|
|||
text: Qt.formatTime(currentDateTime).replace(":", ".")
|
||||
|
||||
color: plasmoid.configuration.clockFontColor
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "ClearClock Default") fontOutfitBold.name
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "default") fontOutfitBold.name
|
||||
else plasmoid.configuration.clockFontFamily
|
||||
font.bold: plasmoid.configuration.clockBoldText
|
||||
font.italic: plasmoid.configuration.clockItalicText
|
||||
|
@ -95,7 +95,7 @@ Item {
|
|||
text: Qt.formatDate(currentDateTime, "dddd")
|
||||
|
||||
color: plasmoid.configuration.dayFontColor
|
||||
font.family: if (plasmoid.configuration.dayFontFamily === "ClearClock Default") fontSmooch.name
|
||||
font.family: if (plasmoid.configuration.dayFontFamily === "default") fontSmooch.name
|
||||
else plasmoid.configuration.dayFontFamily
|
||||
font.bold: plasmoid.configuration.daykBoldText
|
||||
font.italic: plasmoid.configuration.dayItalicText
|
||||
|
@ -111,7 +111,7 @@ Item {
|
|||
text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat)
|
||||
|
||||
color: plasmoid.configuration.dateFontColor
|
||||
font.family: if (plasmoid.configuration.dateFontFamily === "ClearClock Default") fontOutfitRegular.name
|
||||
font.family: if (plasmoid.configuration.dateFontFamily === "default") fontOutfitRegular.name
|
||||
else plasmoid.configuration.dateFontFamily
|
||||
font.bold: plasmoid.configuration.dateBoldText
|
||||
font.italic: plasmoid.configuration.dateItalicText
|
||||
|
|
Loading…
Reference in a new issue