Summary: | wrong KMessageBox resizing in detailedError() | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Konstantinos Smanis <konstantinos.smanis> |
Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alvarenga, andresbajotierra, cfeck, konstantinos.smanis, lueck, ogoffart |
Priority: | NOR | ||
Version: | 4.2 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
The wrongly-sized messagebox.
The correctly-sized messagebox (how it should be by default). |
Description
Konstantinos Smanis
2009-05-18 11:57:32 UTC
Created attachment 33795 [details]
The wrongly-sized messagebox.
Created attachment 33796 [details]
The correctly-sized messagebox (how it should be by default).
Just a note: as I mentioned, if KMessageBox::error() is used instead with the identical text, the dialog defaults to the screenshot #2 (https://bugs.kde.org/attachment.cgi?id=33796) but it has fixed size (because we fall into the first case as can be seen here: http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/kmessagebox_8cpp-source.html#l00288). Screenshot #2 was created by clicking twice on the "Details" button (this seems to resize the messagebox properly) Here using: Qt: 4.5.1 (qt-copy 971295) KDE: 4.2.92 (KDE 4.2.92 (KDE 4.3 >= 20090617)) kdelibs svn rev. 984425 / kdebase svn rev. 984427 on ArchLinux i686 - Kernel 2.6.29.4 I can reproduce this bug. It seems the "bug" is inside "KDialog::setDetailsWidgetVisible" When the dialog is created and it will show details, this functions is called with "false" as parameter. Therefore an "adjustSize()" call is done, even when the layout may be still not valid (delayed layouting) causing the dialog to resize to a bad minimum. KDialog minimum sizes seems to be weird and layouts not being honored. A rather simple patch, only call adjustSize() if there is a valid layout(): Index: kdialog.cpp =================================================================== --- kdialog.cpp (revision 984425) +++ kdialog.cpp (working copy) @@ -826,10 +826,11 @@ if ( d->mDetailsWidget ) d->mDetailsWidget->hide(); - if ( layout() ) + if ( layout() ) { layout()->activate(); + adjustSize(); + } - adjustSize(); } d->mSettingDetails = false; --- This will not avoid the dialog to be resized to minimum (even hiding the text), but it will show the dialog properly the first time. I still think some better patch/fix to the whole situation should be done. @Olivier: what do you think? Regards Can we get this in for KDE 4.4 please? The current dialog window for all the detailed* is terrible. I tested and can confirm Dario's patch to be working as explained: "This will not avoid the dialog to be resized to minimum (even hiding the text), but it will show the dialog properly the first time." Can we push it for 4.7 please? @ Dario: Tested your patch, it shows the dialog properly the first time Please file a Review Request, thanks. Can someone else create the review ? I don't have a devel environment to recreate and test the patch. Thanks *** Bug 277873 has been marked as a duplicate of this bug. *** Git commit bd953f345b2413a4437340d7b9b414e61afba23f by Burkhard Lück. Committed on 03/08/2011 at 17:05. Pushed by lueck into branch 'KDE/4.7'. Resize KMessageBox::detailedError at start to display all text Quoting the BR: 'When using KMessageBox::detailedError() it sometimes doesn't resize properly to show all the text' commit this on behalf of Dario Andres (https://bugs.kde.org/show_bug.cgi?id=193097#c9) CCBUG:193097 REVIEW:101931 (cherry picked from commit 370d3ed6e5153fc61b774cf2640acc72d334033d) M +3 -2 kdeui/dialogs/kdialog.cpp http://commits.kde.org/kdelibs/bd953f345b2413a4437340d7b9b414e61afba23f Git commit 370d3ed6e5153fc61b774cf2640acc72d334033d by Burkhard Lück. Committed on 03/08/2011 at 17:05. Pushed by lueck into branch 'master'. Resize KMessageBox::detailedError at start to display all text Quoting the BR: 'When using KMessageBox::detailedError() it sometimes doesn't resize properly to show all the text' commit this on behalf of Dario Andres (https://bugs.kde.org/show_bug.cgi?id=193097#c9) BUG:193097 REVIEW:101931 M +3 -2 kdeui/dialogs/kdialog.cpp http://commits.kde.org/kdelibs/370d3ed6e5153fc61b774cf2640acc72d334033d |