[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdeui
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2005-06-04 12:06:23
Message-ID: 1117886783.750935.25803.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 422055 by aacid:
commit KSelectAction::setMaxComboViewCount( int n ) nobody oposed at k-c-d
M +9 -0 kactionclasses.cpp
M +8 -0 kactionclasses.h
--- trunk/KDE/kdelibs/kdeui/kactionclasses.cpp #422054:422055
@@ -335,6 +335,7 @@
m_menu = 0;
m_current = -1;
m_comboWidth = -1;
+ m_maxComboViewCount = -1;
}
bool m_edit;
bool m_menuAccelsEnabled;
@@ -342,6 +343,7 @@
int m_current;
int m_comboWidth;
QStringList m_list;
+ int m_maxComboViewCount;
QString makeMenuText( const QString &_text )
{
@@ -465,6 +467,12 @@
updateComboWidth( i );
}
+
+void KSelectAction::setMaxComboViewCount( int n )
+{
+ d->m_maxComboViewCount = n;
+}
+
QPopupMenu* KSelectAction::popupMenu() const
{
kdDebug(129) << "KAction::popupMenu()" << endl; // remove -- ellis
@@ -668,6 +676,7 @@
}
cb->setInsertionPolicy( QComboBox::NoInsertion );
QWhatsThis::add( cb, whatsThis() );
+ if ( d->m_maxComboViewCount != -1 ) cb->setSizeLimit( d->m_maxComboViewCount );
}
addContainer( bar, id_ );
--- trunk/KDE/kdelibs/kdeui/kactionclasses.h #422054:422055
@@ -462,6 +462,14 @@
* This returns the maximum width set by setComboWidth
*/
virtual int comboWidth() const;
+
+ /**
+ * Sets the maximum items that are visible at once if the action
+ * is a combobox, that is the number of items in the combobox's viewport
+ * Only works before the action is plugged
+ * @since 3.5
+ */
+ void setMaxComboViewCount( int n );
/**
* Returns a pointer to the popup menu used by this action.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic