diff --git a/gui/main-kf5.qml b/gui/main-kf5.qml index 506aafe..d7aa7e9 100644 --- a/gui/main-kf5.qml +++ b/gui/main-kf5.qml @@ -708,6 +708,12 @@ ApplicationWindow { } } + // --- Window shortcuts --- + Shortcut { + sequence: "Ctrl+N" + onActivated: activator.NewWindow() + } + // --- Split pane shortcuts --- Shortcut { sequence: "Ctrl+\\" @@ -819,6 +825,10 @@ ApplicationWindow { property string paneCwd: "" property int chatOffset: 0 + // Per-session draft text storage + property var _drafts: ({}) + property string _prevSessionId: "" + Component.onCompleted: { // Create a dedicated ChatBlockModel for this pane paneModel = Qt.createQmlObject( @@ -844,7 +854,20 @@ ApplicationWindow { } } - onSessionIdChanged: refreshPaneChat() + onSessionIdChanged: { + // Save draft from previous session + if (_prevSessionId !== "") { + _drafts[_prevSessionId] = panePrompt.text + } + refreshPaneChat() + // Restore draft for new session (or empty) + if (sessionId !== "") { + panePrompt.text = _drafts[sessionId] || "" + } else { + panePrompt.text = "" + } + _prevSessionId = sessionId + } Connections { target: dbus diff --git a/gui/main.cpp b/gui/main.cpp index ed5daa8..2a45637 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -148,6 +148,7 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("dbus", dbus); engine.rootContext()->setContextProperty("theme", theme); engine.rootContext()->setContextProperty("chatModel", chatModel); + engine.rootContext()->setContextProperty("activator", &activator); engine.rootContext()->setContextProperty("systemTrayAvailable", QSystemTrayIcon::isSystemTrayAvailable()); diff --git a/gui/main.qml b/gui/main.qml index 25be535..fac6395 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -529,6 +529,12 @@ ApplicationWindow { } } + // --- Window shortcuts --- + Shortcut { + sequence: "Ctrl+N" + onActivated: activator.NewWindow() + } + // --- Split pane shortcuts --- Shortcut { sequence: "Ctrl+\\"