bar: add config option to disable on selected screens (#920)
* modules/drawers: Added a bar config option to disable the bar on selected screens Extended the visualizer on screens that the bar is hidden * modules/drawers: surrounded barwrapper with a loader * fix/modules/drawers: fix a null reference missed to fix a reference to bar object to barLoader.item * modules/drawers: added regex support also reverted the barLoader, added a disabled property to BarLoader instead * fix: module/drawers: applied requested changes
This commit is contained in:
parent
11282f6abe
commit
24b313497f
4 changed files with 21 additions and 2 deletions
|
|
@ -400,6 +400,7 @@ default, you must create it manually.
|
|||
}
|
||||
]
|
||||
},
|
||||
"excludedScreens": [""],
|
||||
"activeWindow": {
|
||||
"inverted": false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ JsonObject {
|
|||
property Status status: Status {}
|
||||
property Clock clock: Clock {}
|
||||
property Sizes sizes: Sizes {}
|
||||
property list<string> excludedScreens: []
|
||||
|
||||
property list<var> entries: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,11 +12,12 @@ Item {
|
|||
required property ShellScreen screen
|
||||
required property PersistentProperties visibilities
|
||||
required property BarPopouts.Wrapper popouts
|
||||
required property bool disabled
|
||||
|
||||
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
|
||||
readonly property int exclusiveZone: !disabled && (Config.bar.persistent || visibilities.bar) ? contentWidth : Config.border.thickness
|
||||
readonly property bool shouldBeVisible: !disabled && (Config.bar.persistent || visibilities.bar || isHovered)
|
||||
property bool isHovered
|
||||
|
||||
function closeTray(): void {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,20 @@ Variants {
|
|||
id: scope
|
||||
|
||||
required property ShellScreen modelData
|
||||
readonly property bool barDisabled: {
|
||||
const regexChecker = /^\^.*\$$/;
|
||||
for (const filter of Config.bar.excludedScreens) {
|
||||
// If filter is a regex
|
||||
if (regexChecker.test(filter)) {
|
||||
if ((new RegExp(filter)).test(modelData.name))
|
||||
return true;
|
||||
} else {
|
||||
if (filter === modelData.name)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Exclusions {
|
||||
screen: scope.modelData
|
||||
|
|
@ -169,6 +183,8 @@ Variants {
|
|||
visibilities: visibilities
|
||||
popouts: panels.popouts
|
||||
|
||||
disabled: scope.barDisabled
|
||||
|
||||
Component.onCompleted: Visibilities.bars.set(scope.modelData, this)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue