refaktor
This commit is contained in:
+33
-2
@@ -1,12 +1,24 @@
|
||||
pragma Singleton
|
||||
import QtQuick 2.15
|
||||
import "./path"
|
||||
|
||||
QtObject {
|
||||
readonly property string configDir: ConfigPath.path
|
||||
readonly property string wallpaperDir: WallpaperPath.wallpaperDir
|
||||
|
||||
readonly property int small_spacing: 4
|
||||
readonly property int spacing: 8
|
||||
function small_spacing_fun(screenHeight) { return Math.floor(barHeight(screenHeight) / 16) }
|
||||
function spacing_fun(barH) { return Math.floor(barH / 8) }
|
||||
function big_spacing_fun(barH) { return Math.floor(barH / 6) }
|
||||
|
||||
readonly property int small_radius: 4
|
||||
readonly property int radius: 6
|
||||
function font_size(spaceHeight) { return Math.floor(spaceHeight * 0.75) }
|
||||
function font_size_small(spaceHeight) { return Math.floor(spaceHeight * 0.625) }
|
||||
|
||||
readonly property int small_radius: 8
|
||||
readonly property int radius: 16
|
||||
function small_radius_fun(barHeight) { return Math.floor(barHeight / 8) }
|
||||
function radius_fun(barHeight) { return Math.floor(barHeight / 4) }
|
||||
readonly property int big_radius: 10
|
||||
readonly property int border_width: 2
|
||||
|
||||
@@ -20,6 +32,25 @@ QtObject {
|
||||
return value * 0.4
|
||||
}
|
||||
|
||||
// Scale font/icon size relative to bar height
|
||||
function bigIconSize(barHeight) { return Math.floor(barHeight * 0.7) }
|
||||
function halfBigIconSize(barHeight) { return Math.floor(barHeight * 0.6) }
|
||||
function iconSize(barHeight) { return Math.floor(barHeight * 0.5) }
|
||||
function labelSize(barHeight) { return Math.floor(barHeight * 0.35) }
|
||||
function normalSpacing(screenHeight) { return Math.floor(barHeight(screenHeight) / 4) }
|
||||
function widgetSpacing(screenHeight) { return Math.floor(barHeight(screenHeight) / 8) }
|
||||
|
||||
function barHeight(screenHeight) {
|
||||
return Math.floor(screenHeight * barHeightRatio(screenHeight))
|
||||
}
|
||||
|
||||
// Resolution-aware bar height ratio
|
||||
function barHeightRatio(screenHeight) {
|
||||
return screenHeight >= 2160 ? 0.03 :
|
||||
screenHeight >= 1440 ? 0.035 :
|
||||
0.04
|
||||
}
|
||||
|
||||
// Tray
|
||||
readonly property int reload_interval: 10000
|
||||
readonly property int fast_reload_interval: 1000
|
||||
|
||||
Reference in New Issue
Block a user