[LyX/master] Use Alt-Escape to float and unfloat dock widgets.

Richard Kimberly Heck rikiheck at lyx.org
Wed Jul 26 17:12:06 UTC 2023


commit 926ae84921dbb99f925546f8f93d1790b945ef8e
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Wed Jul 26 14:24:37 2023 -0400

    Use Alt-Escape to float and unfloat dock widgets.
    
    For some reason, redocking is not working for me at all. This
    key seems free.
---
 lib/RELEASE-NOTES             |    3 +++
 src/frontends/qt/DockView.cpp |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index f47805b..a31b722 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -48,6 +48,9 @@
   creating a link (and are only available when hyperref is used). There is a 
   checkbox "No Hyperlink" for this purpose.
 
+* Alt-Escape can be used to 'float' and redock widgets like the table of contents
+  or source view.
+
 !!Documents compilation process and images conversion
 
 * LyX now uses utf8 encoding per default for all languages. This does
diff --git a/src/frontends/qt/DockView.cpp b/src/frontends/qt/DockView.cpp
index d6ba3c0..ef204e2 100644
--- a/src/frontends/qt/DockView.cpp
+++ b/src/frontends/qt/DockView.cpp
@@ -49,6 +49,12 @@ void DockView::keyPressEvent(QKeyEvent * ev)
 		}
 		mw->activateWindow();
 		mw->setFocus();
+		Qt::KeyboardModifiers mod = ev->modifiers();
+		if (mod & Qt::AltModifier) {
+			(setFloating(!isFloating()));
+			ev->accept();
+			return;
+		}
 		if (isFloating())
 			hide();
 		ev->accept();


More information about the lyx-cvs mailing list