NPill: allow to open left or right depending on
This commit is contained in:
parent
2498f0273d
commit
3683d3c29b
7 changed files with 73 additions and 11 deletions
|
|
@ -2,6 +2,7 @@ pragma Singleton
|
|||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Widgets
|
||||
|
||||
Singleton {
|
||||
|
|
@ -104,4 +105,24 @@ Singleton {
|
|||
function getAvailableWidgets() {
|
||||
return Object.keys(widgets)
|
||||
}
|
||||
|
||||
function getNPillDirection(widget) {
|
||||
try {
|
||||
if (widget.barSection === "leftSection") {
|
||||
return true
|
||||
} else if (widget.barSection === "rightSection") {
|
||||
return false
|
||||
} else {
|
||||
// middle section
|
||||
if (widget.sectionWidgetIndex < widget.sectionWidgetsCount / 2) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Logger.error(e)
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue