[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/lib/kofficeui
From: Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date: 2006-01-12 13:44:12
Message-ID: 1137073452.459139.15238.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 497317 by nikolaus:
adjust the size of the undo/redo popup
M +15 -8 kocommandhistory.cpp
M +1 -0 kocommandhistory.h
--- trunk/koffice/lib/kofficeui/kocommandhistory.cpp #497316:497317
@@ -18,18 +18,21 @@
* Boston, MA 02110-1301, USA.
*/
-#include "kocommandhistory.h"
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+
+#include <kaction.h>
#include <kcommand.h>
-#include <kaction.h>
-#include <kstdaccel.h>
-#include <kstdaction.h>
#include <kdebug.h>
#include <klocale.h>
#include <kpopupmenu.h>
-#include <qlistbox.h>
#include <kshortcutlist.h>
-#include <qlabel.h>
+#include <kstdaccel.h>
+#include <kstdaction.h>
+#include "kocommandhistory.h"
+
KoListBox::KoListBox( QWidget *parent , const char *name , WFlags f)
: QListBox( parent, name, f)
{
@@ -50,6 +53,12 @@
}
}
+QSize KoListBox::sizeHint() const
+{
+ return QSize(QMIN(maxItemWidth() + verticalScrollBar()->width() + 4, 400),
+ QMIN(count() * itemHeight() + horizontalScrollBar()->height() + 4,300));
+}
+
class KoCommandHistory::KoCommandHistoryPrivate {
public:
KoCommandHistoryPrivate() {
@@ -89,7 +98,6 @@
m_undo = undo;
m_undoPopup = undo->popupMenu();
d->m_undoListBox = new KoListBox( m_undoPopup );
- d->m_undoListBox->resize( 200, 200);//todo fix me
d->m_undoListBox->setSelectionMode( QListBox::Multi );
m_undoPopup->insertItem(d->m_undoListBox);
@@ -111,7 +119,6 @@
m_redoPopup = redo->popupMenu();
d->m_redoListBox = new KoListBox( m_redoPopup );
d->m_redoListBox->setSelectionMode( QListBox::Multi );
- d->m_redoListBox->resize( 200, 200);//todo fix me
m_redoPopup->insertItem(d->m_redoListBox);
d->m_redoLabel = new QLabel( m_redoPopup);
--- trunk/koffice/lib/kofficeui/kocommandhistory.h #497316:497317
@@ -38,6 +38,7 @@
KoListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
protected:
virtual void contentsMouseMoveEvent ( QMouseEvent * );
+ virtual QSize sizeHint() const;
signals:
void changeNumberOfSelectedItem( int );
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic