internal: static bar width
This commit is contained in:
parent
d1b7993f97
commit
2be46ff65a
6 changed files with 12 additions and 12 deletions
|
|
@ -75,7 +75,7 @@ JsonObject {
|
|||
}
|
||||
|
||||
component Sizes: JsonObject {
|
||||
property int innerHeight: 30
|
||||
property int innerWidth: 40
|
||||
property int windowPreviewSize: 400
|
||||
property int trayMenuWidth: 300
|
||||
property int batteryWidth: 250
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ Singleton {
|
|||
path: `${Paths.stringify(Paths.config)}/shell.json`
|
||||
watchChanges: true
|
||||
onFileChanged: reload()
|
||||
onAdapterUpdated: writeAdapter()
|
||||
|
||||
JsonAdapter {
|
||||
id: adapter
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ ColumnLayout {
|
|||
required property ShellScreen screen
|
||||
required property PersistentProperties visibilities
|
||||
required property BarPopouts.Wrapper popouts
|
||||
readonly property int padding: Math.max(Appearance.padding.smaller, Config.border.thickness)
|
||||
readonly property int vPadding: Appearance.padding.large
|
||||
|
||||
function checkPopout(y: real): void {
|
||||
|
|
@ -171,8 +170,6 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.leftMargin: root.padding
|
||||
Layout.rightMargin: root.padding
|
||||
|
||||
// Cursed ahh thing to add padding to first and last enabled components
|
||||
Layout.topMargin: findFirstEnabled() === this ? root.vPadding : 0
|
||||
|
|
@ -180,5 +177,6 @@ ColumnLayout {
|
|||
|
||||
visible: enabled
|
||||
active: enabled
|
||||
asynchronous: true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ Item {
|
|||
required property PersistentProperties visibilities
|
||||
required property BarPopouts.Wrapper popouts
|
||||
|
||||
readonly property int exclusiveZone: Config.bar.persistent || visibilities.bar ? content.implicitWidth : Config.border.thickness
|
||||
readonly property int padding: Math.max(Appearance.padding.smaller, Config.border.thickness)
|
||||
readonly property int contentWidth: Config.bar.sizes.innerWidth + padding * 2
|
||||
readonly property int exclusiveZone: Config.bar.persistent || visibilities.bar ? contentWidth : Config.border.thickness
|
||||
readonly property bool shouldBeVisible: Config.bar.persistent || visibilities.bar || isHovered
|
||||
property bool isHovered
|
||||
|
||||
|
|
@ -26,14 +28,13 @@ Item {
|
|||
|
||||
visible: width > Config.border.thickness
|
||||
implicitWidth: Config.border.thickness
|
||||
implicitHeight: content.implicitHeight
|
||||
|
||||
states: State {
|
||||
name: "visible"
|
||||
when: root.shouldBeVisible
|
||||
|
||||
PropertyChanges {
|
||||
root.implicitWidth: content.implicitWidth
|
||||
root.implicitWidth: root.contentWidth
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,13 +68,15 @@ Item {
|
|||
Loader {
|
||||
id: content
|
||||
|
||||
Component.onCompleted: active = Qt.binding(() => root.shouldBeVisible || root.visible)
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
|
||||
active: root.shouldBeVisible || root.visible
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: Bar {
|
||||
width: root.contentWidth
|
||||
screen: root.screen
|
||||
visibilities: root.visibilities
|
||||
popouts: root.popouts
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ StyledRect {
|
|||
radius: Appearance.rounding.full
|
||||
|
||||
clip: true
|
||||
implicitWidth: iconColumn.implicitWidth + Appearance.padding.normal * 2
|
||||
implicitWidth: Config.bar.sizes.innerWidth
|
||||
implicitHeight: iconColumn.implicitHeight + Appearance.padding.normal * 2
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ StyledRect {
|
|||
clip: true
|
||||
visible: width > 0 && height > 0 // To avoid warnings about being visible with no size
|
||||
|
||||
implicitWidth: layout.implicitWidth + Math.floor(Appearance.padding.normal * 1.8)
|
||||
implicitWidth: Config.bar.sizes.innerWidth
|
||||
implicitHeight: layout.implicitHeight + (Config.bar.tray.background ? Appearance.padding.normal : Appearance.padding.small) * 2
|
||||
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, Config.bar.tray.background ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue