r24286 by jghali - Small fixes for StoryEditor::loadPrefs() + code style fixes

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 24 21:18:16 UTC 2020


Author: jghali
Date: Tue Nov 24 21:18:16 2020
New Revision: 24286

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24286
Log:
Small fixes for StoryEditor::loadPrefs() + code style fixes

Modified:
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24286&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Tue Nov 24 21:18:16 2020
@@ -1645,15 +1645,15 @@
 	int vwidth  = qMax(600, prefs->getInt("width", 600));
 	int vheight = qMax(400, prefs->getInt("height", 400));
 	// Check values against current screen size
-	QRect scr = this->screen()->geometry();
-	if ( vleft >= scr.width() )
-		vleft = 0;
-	if ( vtop >= scr.height() )
-		vtop = 64;
-	if ( vwidth >= scr.width() )
-		vwidth = qMax( 0, scr.width() - vleft );
-	if ( vheight >= scr.height() )
-		vheight = qMax( 0, scr.height() - vtop );
+	QRect scr = this->screen()->availableGeometry();
+	if (vleft >= scr.width())
+		vleft = scr.left();
+	if (vtop >= scr.height())
+		vtop = qMax(64, scr.top());
+	if (vwidth >= scr.width())
+		vwidth = qMax(0, scr.width() - vleft);
+	if (vheight >= scr.height())
+		vheight = qMax(0, scr.height() - vtop);
 	setGeometry(vleft, vtop, vwidth, vheight);
 	QByteArray state = "";
 	state = prefs->get("winstate","").toLatin1();




More information about the scribus-commit mailing list