1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-11 06:49:37 -04:00

feat(IPC): Add dbar toggleReveal logic for autohide modes

This commit is contained in:
purian23
2026-05-09 23:49:25 -04:00
parent c6a1473d2f
commit 1ec0311086
5 changed files with 62 additions and 3 deletions

View File

@@ -699,6 +699,26 @@ Item {
return barConfig.autoHide ? "BAR_MANUAL_HIDE_SUCCESS" : "BAR_AUTO_HIDE_SUCCESS";
}
function toggleReveal(selector: string, value: string): string {
const {
barConfig,
error
} = getBarConfig(selector, value);
if (error)
return error;
if (!barConfig.autoHide)
return "BAR_AUTO_HIDE_DISABLED";
if (!(barConfig.visible ?? true)) {
SettingsData.updateBarConfig(barConfig.id, {
visible: true
});
SettingsData.setBarIpcReveal(barConfig.id, true);
return "BAR_REVEAL_SUCCESS";
}
const revealed = SettingsData.toggleBarIpcReveal(barConfig.id);
return revealed ? "BAR_REVEAL_SUCCESS" : "BAR_TUCK_SUCCESS";
}
function getPosition(selector: string, value: string): string {
const {
barConfig,