Bar: compact mode works pretty well but need some more testing.
This commit is contained in:
parent
93c674f356
commit
ac1902c76a
27 changed files with 169 additions and 88 deletions
|
|
@ -121,6 +121,12 @@ Singleton {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Upgrade the density of the bar so the look stay the same for people who upgrade.
|
||||
if (adapter.settingsVersion == 2) {
|
||||
adapter.bar.density = "comfortable"
|
||||
adapter.settingsVersion++
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
|
|
@ -259,13 +265,14 @@ Singleton {
|
|||
JsonAdapter {
|
||||
id: adapter
|
||||
|
||||
property int settingsVersion: 2
|
||||
property int settingsVersion: 3
|
||||
|
||||
// bar
|
||||
property JsonObject bar: JsonObject {
|
||||
property string position: "top" // "top", "bottom", "left", or "right"
|
||||
property real backgroundOpacity: 1.0
|
||||
property list<string> monitors: []
|
||||
property string density: "default" // "compact", "default", "comfortable"
|
||||
|
||||
// Floating bar settings
|
||||
property bool floating: false
|
||||
|
|
|
|||
|
|
@ -75,6 +75,26 @@ Singleton {
|
|||
property real sliderWidth: 200
|
||||
|
||||
// Bar Dimensions
|
||||
property real barHeight: (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 39 : 37
|
||||
property real capsuleHeight: Math.round(barHeight * 0.73)
|
||||
property real barHeight: {
|
||||
if (Settings.data.bar.density === "compact") {
|
||||
return (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 25 : 23
|
||||
}
|
||||
if (Settings.data.bar.density === "default") {
|
||||
return (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 29 : 27
|
||||
}
|
||||
if (Settings.data.bar.density === "comfortable") {
|
||||
return (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 39 : 37
|
||||
}
|
||||
}
|
||||
property real capsuleHeight: {
|
||||
if (Settings.data.bar.density === "compact") {
|
||||
return barHeight
|
||||
}
|
||||
if (Settings.data.bar.density === "default") {
|
||||
return barHeight
|
||||
}
|
||||
if (Settings.data.bar.density === "comfortable") {
|
||||
return Math.round(barHeight * 0.73)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue