bar/clock: allow hiding icon (#484)
* bar(clock): allow hiding the calendar icon * loader + showCalendarIcon -> showIcon --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
This commit is contained in:
parent
4b9643a802
commit
fc3b08f6cb
3 changed files with 20 additions and 6 deletions
|
|
@ -219,6 +219,9 @@ default, you must create it manually.
|
|||
}
|
||||
},
|
||||
"bar": {
|
||||
"clock": {
|
||||
"showIcon": true
|
||||
},
|
||||
"dragThreshold": 20,
|
||||
"entries": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ JsonObject {
|
|||
property Workspaces workspaces: Workspaces {}
|
||||
property Tray tray: Tray {}
|
||||
property Status status: Status {}
|
||||
property Clock clock: Clock {}
|
||||
property Sizes sizes: Sizes {}
|
||||
|
||||
property list<var> entries: [
|
||||
|
|
@ -77,6 +78,10 @@ JsonObject {
|
|||
property bool showBattery: true
|
||||
}
|
||||
|
||||
component Clock: JsonObject {
|
||||
property bool showIcon: true
|
||||
}
|
||||
|
||||
component Sizes: JsonObject {
|
||||
property int innerWidth: 40
|
||||
property int windowPreviewSize: 400
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.components
|
||||
import qs.services
|
||||
import qs.config
|
||||
|
|
@ -10,13 +12,17 @@ Column {
|
|||
|
||||
spacing: Appearance.spacing.small
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
text: "calendar_month"
|
||||
color: root.colour
|
||||
|
||||
Loader {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
active: Config.bar.clock.showIcon
|
||||
visible: active
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
text: "calendar_month"
|
||||
color: root.colour
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue