1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-15 15:45:20 -04:00

feat(Notepad): Complete refactor - New popout mode & settings

- Add a full popout Notepad experience w/new layout settings
- New ability to choose the left or right side of the screen
- Add more safegaurds to preserve user data throughout
- New banner to show file reload/conflict handling
- New extensionless file support
- Polish settings with gap controls, compact buttons, and shortcuts help
This commit is contained in:
purian23
2026-06-14 20:20:36 -04:00
parent 9d1a81c93c
commit db56c8d74d
13 changed files with 1301 additions and 303 deletions
@@ -32,9 +32,20 @@ BasePill {
}
readonly property var notepadInstance: resolveNotepadInstance()
readonly property bool isActive: notepadInstance?.isVisible ?? false
readonly property bool popoutDefault: SettingsData.notepadDefaultMode === "popout"
readonly property bool isActive: popoutDefault ? (PopoutService.notepadPopout?.visible ?? false) : (notepadInstance?.isVisible ?? false)
property bool isAutoHideBar: false
function showActiveSurface() {
if (root.popoutDefault) {
PopoutService.openNotepadPopout();
return;
}
const instance = prepareNotepadInstance(root.notepadInstance);
if (instance && typeof instance.show === "function")
instance.show();
}
function prepareNotepadInstance(instance) {
if (instance)
instance.triggerUsesOverlayLayer = root.barUsesOverlayLayer;
@@ -75,20 +86,14 @@ BasePill {
function openTabByIndex(tabIndex) {
if (tabIndex < 0)
return;
const instance = prepareNotepadInstance(root.notepadInstance);
if (instance && typeof instance.show === "function") {
instance.show();
}
showActiveSurface();
Qt.callLater(() => {
NotepadStorageService.switchToTab(tabIndex);
});
}
function openNewNote() {
const instance = prepareNotepadInstance(root.notepadInstance);
if (instance && typeof instance.show === "function") {
instance.show();
}
showActiveSurface();
Qt.callLater(() => {
NotepadStorageService.createNewTab();
});
@@ -147,6 +152,10 @@ BasePill {
openContextMenu();
return;
}
if (root.popoutDefault) {
PopoutService.toggleNotepadPopout();
return;
}
const inst = prepareNotepadInstance(root.notepadInstance);
if (inst) {
inst.toggle();