bar: occupied workspaces no need for layout
Can just use anchors and bindings instead
This commit is contained in:
parent
4359b7447b
commit
2be8327d16
1 changed files with 9 additions and 6 deletions
|
|
@ -5,7 +5,7 @@ import "root:/config"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
BoxLayout {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property bool vertical
|
required property bool vertical
|
||||||
|
|
@ -13,9 +13,8 @@ BoxLayout {
|
||||||
required property var occupied
|
required property var occupied
|
||||||
required property int groupOffset
|
required property int groupOffset
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
opacity: BarConfig.workspaces.occupiedBg ? 1 : 0
|
opacity: BarConfig.workspaces.occupiedBg ? 1 : 0
|
||||||
spacing: 0
|
|
||||||
z: -1
|
z: -1
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
@ -37,9 +36,13 @@ BoxLayout {
|
||||||
topRightRadius: roundRight
|
topRightRadius: roundRight
|
||||||
bottomRightRadius: roundRight
|
bottomRightRadius: roundRight
|
||||||
|
|
||||||
// Ugh stupid size errors on reload
|
x: root.workspaces[index]?.x ?? 0
|
||||||
Layout.preferredWidth: root.vertical ? BarConfig.sizes.innerHeight : root.workspaces[index]?.width ?? 1
|
y: root.workspaces[index]?.y ?? 0
|
||||||
Layout.preferredHeight: root.vertical ? root.workspaces[index]?.height ?? 1 : BarConfig.sizes.innerHeight
|
width: root.vertical ? BarConfig.sizes.innerHeight : root.workspaces[index]?.width ?? 1
|
||||||
|
height: root.vertical ? root.workspaces[index]?.height ?? 1 : BarConfig.sizes.innerHeight
|
||||||
|
|
||||||
|
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
||||||
|
anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue