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