[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim/certmanager/lib/ui
From:       Marc Mutz <mutz () kde ! org>
Date:       2008-11-19 17:53:04
Message-ID: 1227117184.648668.6103.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 886620 by mutz:

Size the audit log window better (ask the text edit for the first paragraph's size, \
but limit to 2/3 of screen size)

 M  +9 -0      messagebox.cpp  


--- branches/kdepim/enterprise/kdepim/certmanager/lib/ui/messagebox.cpp \
#886619:886620 @@ -51,6 +51,7 @@
 #include <qtextedit.h>
 #include <qtextstream.h>
 #include <qvbox.h>
+#include <qapplication.h>
 
 #include <gpg-error.h>
 
@@ -89,6 +90,14 @@
 
     void setAuditLog( const QString & log ) {
         m_textEdit->setText( log );
+        const QRect rect = m_textEdit->paragraphRect( 0 );
+        kdDebug() << "setAuditLog: rect = " << rect;
+        if ( !rect.isValid() )
+            return;
+        QSize maxSize = qApp->desktop()->screenGeometry( this ).size() * 2 / 3 ;
+        if ( !maxSize.isValid() )
+            maxSize = QSize( 640, 480 );
+        m_textEdit->setMinimumSize( rect.size().boundedTo( maxSize ) );
     }
 
 private:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic