C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 20s
JS/TS / lint (pull_request) Successful in 22s
Python / static (pull_request) Successful in 57s
Rust / fmt (pull_request) Successful in 1m2s
C++ / build (pull_request) Successful in 2m10s
Rust / build (pull_request) Successful in 1m50s
Rust / clippy (pull_request) Successful in 1m25s
Python / verify (pull_request) Successful in 2m58s
C++ / clang-tidy (pull_request) Successful in 7m8s
92 lines
2.3 KiB
QML
92 lines
2.3 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import Quickshell
|
|
import QtQuick
|
|
import ZShell.Config
|
|
import qs.Modules.Bar.Popouts
|
|
import qs.Components
|
|
|
|
Item {
|
|
id: root
|
|
|
|
readonly property int clampedExtent: Math.max(Config.bar.border, extent)
|
|
readonly property int contentThickness: Math.floor(Math.max(Config.bar.height, Tokens.bar.innerSize * (horizontal ? 1 : 1.5))) + padding * 2
|
|
readonly property int exclusiveZone: Config.bar.autoHide ? Config.bar.border : contentThickness
|
|
property real extent: fullscreen ? 0 : Config.bar.border
|
|
required property bool fullscreen
|
|
readonly property bool horizontal: position !== "left"
|
|
property bool isHovered
|
|
readonly property int padding: Math.max(Tokens.padding.small, Config.bar.border)
|
|
required property Wrapper popouts
|
|
required property ClipWrapper popoutsWrapper
|
|
required property string position
|
|
required property ShellScreen screen
|
|
readonly property bool shouldBeVisible: (!fullscreen && (!Config.bar.autoHide || visibilities.bar)) || isHovered
|
|
readonly property int vPadding: 6
|
|
required property PersistentProperties visibilities
|
|
|
|
function checkPopout(pos: real): void {
|
|
(content.item as Bar)?.checkPopout(pos);
|
|
}
|
|
|
|
function entryAt(pos: real): string {
|
|
return (content.item as Bar)?.entryAt(pos) ?? "";
|
|
}
|
|
|
|
implicitHeight: extent
|
|
implicitWidth: extent
|
|
visible: extent > Config.bar.border
|
|
|
|
states: State {
|
|
name: "visible"
|
|
when: root.shouldBeVisible
|
|
|
|
PropertyChanges {
|
|
root.extent: root.contentThickness
|
|
}
|
|
}
|
|
transitions: [
|
|
Transition {
|
|
from: ""
|
|
to: "visible"
|
|
|
|
Anim {
|
|
property: "extent"
|
|
target: root
|
|
}
|
|
},
|
|
Transition {
|
|
from: "visible"
|
|
to: ""
|
|
|
|
Anim {
|
|
property: "extent"
|
|
target: root
|
|
}
|
|
}
|
|
]
|
|
|
|
Loader {
|
|
id: content
|
|
|
|
active: root.shouldBeVisible || root.visible
|
|
anchors.bottom: root.position !== "bottom" ? parent.bottom : undefined
|
|
anchors.left: root.horizontal ? parent.left : undefined
|
|
anchors.right: parent.right
|
|
anchors.top: root.position !== "top" ? parent.top : undefined
|
|
height: root.contentThickness
|
|
width: root.contentThickness
|
|
|
|
sourceComponent: Bar {
|
|
fullscreen: root.fullscreen
|
|
height: root.contentThickness
|
|
horizontal: root.horizontal
|
|
isHovered: root.isHovered
|
|
popouts: root.popouts
|
|
popoutsWrapper: root.popoutsWrapper
|
|
screen: root.screen
|
|
visibilities: root.visibilities
|
|
}
|
|
}
|
|
}
|