[education/rkward] rkward/windows: Do not allow status messages to resize the window they are in.

Thomas Friedrichsmeier null at kde.org
Tue Jun 21 17:43:29 BST 2022


Git commit 43702e962e73f8c2e7cfb9596fc0f26a123fb7cb by Thomas Friedrichsmeier.
Committed on 21/06/2022 at 16:43.
Pushed by tfry into branch 'master'.

Do not allow status messages to resize the window they are in.

M  +5    -1    rkward/windows/rkmdiwindow.cpp

https://invent.kde.org/education/rkward/commit/43702e962e73f8c2e7cfb9596fc0f26a123fb7cb

diff --git a/rkward/windows/rkmdiwindow.cpp b/rkward/windows/rkmdiwindow.cpp
index f121d0c1..8cf43877 100644
--- a/rkward/windows/rkmdiwindow.cpp
+++ b/rkward/windows/rkmdiwindow.cpp
@@ -355,6 +355,7 @@ void RKMDIWindow::showStatusMessageNow() {
 
 	if (!status_message.isEmpty ()) {
 		status_popup_container->resize (size ());
+		status_popup_container->setMaximumWidth(width()); // also in resizeEvent(). Without this, extra long messages could force the whole preview window to resize, taking up all horziontal space.
 		status_popup_container->show ();
 		if (status_popup->text () == status_message) {
 			if (!status_popup->isVisible ()) status_popup->animatedShow ();  // it might have been closed by user. And no, simply show() is _not_ good enough. KF5 (5.15.0)
@@ -395,7 +396,10 @@ void RKMDIWindow::clearStatusMessage () {
 }
 
 void RKMDIWindow::resizeEvent (QResizeEvent*) {
-	if (status_popup_container && status_popup_container->isVisible ()) status_popup_container->resize (QSize(width(), status_popup->height () + 20));
+	if (status_popup_container && status_popup_container->isVisible ()) {
+		status_popup_container->setMaximumWidth(width());
+		status_popup_container->resize(QSize(width(), status_popup->height () + 20));
+	}
 }
 
 


More information about the rkward-tracker mailing list