Bug 127004 - window gets resized beyond screen size to fit file name in status bar
Summary: window gets resized beyond screen size to fit file name in status bar
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-09 10:06 UTC by Daniel Frein
Modified: 2012-10-19 13:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Frein 2006-05-09 10:06:18 UTC
Version:           1.3.1 (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
OS:                Linux

Gwenview always shows the full file name in its main window's status bar and resizes the window accordingly. This is a problem because the window can become much bigger than your screen is. Also in full screen mode the window will be resized. In my case (font DejaVu Sans at 10 pt), a filename of 220 chars results in a "program specified minimum size: 1523 by 117" (as reported by xprop). The desired behavior would be to just cut the text for the status bar and not to resize the window. 

How to reproduce: create an image file with a very long file name and select this picture in gwenview. Now if the text does not fit in the statusbar, the whole window gets resized until it fits, not respecting the maximal screen size. 

This seems to be a regression bug which was already fixed three years ago in bug 69884 https://bugs.kde.org/show_bug.cgi?id=69884 but I did not find a way to reopen it; therefore I decided to open a new bug.
Comment 1 Konrad Urlichs 2006-09-21 12:52:00 UTC
I can confirm the described behavior on 
version 1.3.92 using KDE 3.5.4
I am not working with such large file names, but I can understand, that this might lead to problems.
Regards
Konrad
Comment 2 Aurelien Gateau 2006-10-17 12:34:51 UTC
SVN commit 596385 by gateau:

Do not show the name of the current file in the status bar: it's already shown
in the title bar and it was causing the mainwindow to be enlarged if the name
was very long.
BUG: 127004


 M  +3 -0      NEWS  
 M  +5 -6      app/mainwindow.cpp  


--- trunk/extragear/graphics/gwenview/NEWS #596384:596385
@@ -4,6 +4,9 @@
    129890)
  - Load JPEG rotated images using the right rotation directly instead of
    loading them first and rotate them after (Bug 117173)
+ - Do not show the name of the current file in the status bar: it's already
+   shown in the title bar and it was causing the mainwindow to be enlarged if
+   the name was very long (Bug 127004)
 
 2006.09.16 - v1.4.0
 - Fixes:
--- trunk/extragear/graphics/gwenview/app/mainwindow.cpp #596384:596385
@@ -785,27 +785,26 @@
 //
 //-----------------------------------------------------------------------
 void MainWindow::updateStatusInfo() {
-	QString txt;
+	QStringList tokens;
 
 	if ( KProtocolInfo::supportsListing(mFileViewController->url()) ) {
 		int pos = mFileViewController->shownFilePosition();
 		uint count = mFileViewController->fileCount();
 		if (count > 0) {
-			txt = i18n("%1/%2 - ").arg(pos+1).arg(count);
+			tokens << i18n("%1/%2").arg(pos+1).arg(count);
 		} else {
-			txt = i18n("No images");
+			tokens << i18n("No images");
 		}
 	}
 
 	QString filename = mDocument->filename();
-	txt += filename;
 
 	QSize size = mDocument->image().size();
 	if (!size.isEmpty()) {
-		txt += QString(" %1x%2").arg(size.width()).arg(size.height());
+		tokens << i18n("%1 x %2 pixels").arg(size.width()).arg(size.height());
 	}
 	
-	mSBDetailLabel->setText(txt);
+	mSBDetailLabel->setText(tokens.join(" - "));
 	setCaption(filename);
 }