mirror of
https://github.com/developersu/ClearClock.git
synced 2025-05-14 19:20:26 +03:00
Added compatibility für plasma 6
This commit is contained in:
parent
168c07824a
commit
eb41f6bb14
6 changed files with 26 additions and 22 deletions
|
@ -6,7 +6,7 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12 as QtControls
|
||||
import QtQuick.Layouts 1.12 as QtLayouts
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import org.kde.kirigami 2.3 as Kirigami
|
||||
|
||||
|
@ -155,7 +155,7 @@ Item {
|
|||
cfg_clockFontColor = colorValue
|
||||
}
|
||||
|
||||
fontValue: cgf_clockFontFamily
|
||||
fontValue: cfg_clockFontFamily
|
||||
onFontValueChanged: {
|
||||
cfg_clockFontFamily = fontValue
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ Item {
|
|||
cfg_dayFontColor = colorValue
|
||||
}
|
||||
|
||||
fontValue: cgf_dayFontFamily
|
||||
fontValue: cfg_dayFontFamily
|
||||
onFontValueChanged: {
|
||||
cfg_dayFontFamily = fontValue
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ Item {
|
|||
cfg_dateFontColor = colorValue
|
||||
}
|
||||
|
||||
fontValue: cgf_dateFontFamily
|
||||
fontValue: cfg_dateFontFamily
|
||||
onFontValueChanged: {
|
||||
cfg_dateFontFamily = fontValue
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import QtQuick.Layouts 1.12 as QtLayouts
|
|||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Dialogs
|
||||
|
||||
QtControls.Button {
|
||||
id: clockFontColorButton
|
||||
|
@ -33,10 +33,12 @@ QtControls.Button {
|
|||
ColorDialog {
|
||||
id: dialog
|
||||
title: "Select Background Color"
|
||||
color: value
|
||||
showAlphaChannel: true
|
||||
selectedColor: value
|
||||
options: {
|
||||
ShowAlphaChannel: true
|
||||
}
|
||||
onAccepted: {
|
||||
value = dialog.color
|
||||
value = selectedColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
import QtQuick 2.4
|
||||
import QtQuick.Controls 2.12 as QtControls
|
||||
import QtQuick.Layouts 1.12 as QtLayouts
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import org.kde.kirigami 2.3 as Kirigami
|
||||
|
||||
import "."
|
||||
|
||||
|
@ -39,7 +41,7 @@ QtLayouts.RowLayout {
|
|||
QtControls.ComboBox {
|
||||
id: fontFamilyComboBox
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
QtLayouts.Layout.minimumWidth: units.gridUnit * 10
|
||||
QtLayouts.Layout.minimumWidth: Kirigami.Units.gridUnit * 10
|
||||
model: fontModel
|
||||
textRole: "text"
|
||||
currentIndex: fontValue
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import QtQuick 2.4
|
||||
import QtQuick.Controls 2.12 as QtControls
|
||||
import QtQuick.Layouts 1.12 as QtLayouts
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import "."
|
||||
|
||||
|
|
|
@ -5,27 +5,28 @@
|
|||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtGraphicalEffects 1.12
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import org.kde.plasma.plasma5support as Plasma5Support
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.plasmoid 2.0
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
|
||||
Item {
|
||||
PlasmoidItem {
|
||||
id: root
|
||||
|
||||
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
|
||||
preferredRepresentation: fullRepresentation
|
||||
Plasmoid.backgroundHints: PlasmaCore.Types.ConfigurableBackground
|
||||
|
||||
readonly property date currentDateTime: dataSource.data.Local ? dataSource.data.Local.DateTime : new Date()
|
||||
|
||||
PlasmaCore.DataSource {
|
||||
Plasma5Support.DataSource {
|
||||
id: dataSource
|
||||
engine: "time"
|
||||
connectedSources: ["Local"]
|
||||
interval: plasmoid.configuration.clockShowSeconds ? 1000 : 60000
|
||||
intervalAlignment: plasmoid.configuration.clockShowSeconds ? PlasmaCore.Types.NoAlignment : PlasmaCore.Types.AlignToMinute
|
||||
intervalAlignment: plasmoid.configuration.clockShowSeconds ? Plasma5Support.Types.NoAlignment : Plasma5Support.Types.AlignToMinute
|
||||
}
|
||||
|
||||
FontLoader {
|
||||
|
@ -43,7 +44,7 @@ Item {
|
|||
source: "../fonts/Smooch-Regular.ttf"
|
||||
}
|
||||
|
||||
Plasmoid.fullRepresentation: ColumnLayout {
|
||||
fullRepresentation: ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: -20
|
||||
|
||||
|
@ -73,7 +74,7 @@ Item {
|
|||
id: clockLabel
|
||||
anchors.centerIn: parent
|
||||
|
||||
property var textFormat: {
|
||||
property var getTextFormat: {
|
||||
var AMPM = plasmoid.configuration.clockUse24hFormat ? "" : " AP"
|
||||
if (plasmoid.configuration.clockShowSeconds)
|
||||
return Qt.formatTime(currentDateTime, "hh.mm.ss" + AMPM).split(".").join(plasmoid.configuration.clockSeparator)
|
||||
|
@ -81,7 +82,7 @@ Item {
|
|||
return Qt.formatTime(currentDateTime, "hh.mm" + AMPM).split(".").join(plasmoid.configuration.clockSeparator)
|
||||
}
|
||||
|
||||
text: textFormat
|
||||
text: getTextFormat
|
||||
|
||||
color: plasmoid.configuration.clockFontColor
|
||||
font.family: if (plasmoid.configuration.clockFontFamily === "ccdefault") fontOutfitBold.name
|
||||
|
@ -110,7 +111,7 @@ Item {
|
|||
color: plasmoid.configuration.dayFontColor
|
||||
font.family: if (plasmoid.configuration.dayFontFamily === "ccdefault") fontSmooch.name
|
||||
else plasmoid.configuration.dayFontFamily
|
||||
font.bold: plasmoid.configuration.daykBoldText
|
||||
font.bold: plasmoid.configuration.dayBoldText
|
||||
font.italic: plasmoid.configuration.dayItalicText
|
||||
font.pixelSize: plasmoid.configuration.dayFontSize
|
||||
|
||||
|
|
|
@ -18,6 +18,5 @@
|
|||
"Version": "0.3",
|
||||
"Website": "https://github.com/qewer33/ClearClock"
|
||||
},
|
||||
"X-Plasma-API": "declarativeappletscript",
|
||||
"X-Plasma-MainScript": "ui/main.qml"
|
||||
"X-Plasma-API-Minimum-Version": "6.0"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue