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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user