From ca444e57757daffb6653ffea11402abe298a2272 Mon Sep 17 00:00:00 2001 From: reionwong Date: Thu, 1 Jul 2021 10:37:06 +0800 Subject: [PATCH] No clear selection when dragging text --- qmltermwidget/lib/TerminalDisplay.cpp | 9 +++++---- src/qml/main.qml | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/qmltermwidget/lib/TerminalDisplay.cpp b/qmltermwidget/lib/TerminalDisplay.cpp index 521a950..65fd41a 100644 --- a/qmltermwidget/lib/TerminalDisplay.cpp +++ b/qmltermwidget/lib/TerminalDisplay.cpp @@ -2052,11 +2052,12 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev) if ( ev->x() > dragInfo.start.x() + distance || ev->x() < dragInfo.start.x() - distance || ev->y() > dragInfo.start.y() + distance || ev->y() < dragInfo.start.y() - distance) { - // we've left the drag square, we can start a real drag operation now - emit isBusySelecting(false); // Ok.. we can breath again. + // we've left the drag square, we can start a real drag operation now + emit isBusySelecting(false); // Ok.. we can breath again. - _screenWindow->clearSelection(); - doDrag(); + // Reion: Don't clear selection. + // _screenWindow->clearSelection(); + doDrag(); } return; } diff --git a/src/qml/main.qml b/src/qml/main.qml index 0215ec2..14c9c8d 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -34,7 +34,7 @@ FishUI.Window { height: settings.height title: currentItem && currentItem.terminal ? currentItem.terminal.session.title : "" - header.height: 40 + FishUI.Units.smallSpacing + header.height: 46 property alias currentItem: _view.currentItem readonly property QMLTermWidget currentTerminal: currentItem.terminal @@ -48,8 +48,10 @@ FishUI.Window { } onClosing: { - settings.width = root.width - settings.height = root.height + if (!root.isMaximized) { + settings.width = root.width + settings.height = root.height + } // Exit prompt. for (var i = 0; i < tabsModel.count; ++i) {