mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
taskpanel: Use the form factor to define the position we are on
Instead of the panel state itself. That would arrive at different points in the event and sometimes plasma would set the offset to the horizontal panel. This should remove this case by only setting the offset when the panel is in the state that needs it.
This commit is contained in:
parent
8335934aef
commit
1554008648
1 changed files with 4 additions and 8 deletions
|
|
@ -249,19 +249,15 @@ PlasmaCore.ColorScope {
|
|||
}
|
||||
}
|
||||
|
||||
function resetOffsets() {
|
||||
Window.onWindowChanged: {
|
||||
if (!Window.window)
|
||||
return;
|
||||
|
||||
if (state === "landscape") {
|
||||
Window.window.offset = Qt.binding(() => {
|
||||
// FIXME: find a more precise way to determine the top panel height
|
||||
Window.window.offset = PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing
|
||||
} else {
|
||||
Window.window.offset = 0
|
||||
}
|
||||
return plasmoid.formFactor === PlasmaCore.Types.Vertical ? PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing : 0
|
||||
});
|
||||
}
|
||||
Window.onWindowChanged: resetOffsets()
|
||||
onStateChanged: resetOffsets()
|
||||
|
||||
states: [
|
||||
State {
|
||||
|
|
|
|||
Loading…
Reference in a new issue