Set maximum height of genre combo to toolbutton height.

This commit is contained in:
craig.p.drummond
2013-09-12 18:41:13 +00:00
committed by craig.p.drummond
parent 99b9417fb5
commit 568d3cec22
2 changed files with 12 additions and 1 deletions

View File

@@ -28,6 +28,7 @@
13. Create a new SizeGrip class, so that we can force the size-grip on the main
window to have the same height as toolbuttons - this makes it align to the
bottom.
14. Set maximum height of genre combo to toolbutton height.
1.1.3
-----

View File

@@ -22,6 +22,7 @@
*/
#include "genrecombo.h"
#include "toolbutton.h"
#include "localize.h"
#ifndef Q_OS_WIN
#include "gtkproxystyle.h"
@@ -29,7 +30,7 @@
// Max number of items before we try to force a scrollbar in popup menu...
static const int constPopupItemCount=32;
static int tbHeight=-1;
GenreCombo::GenreCombo(QWidget *p)
: ComboBox(p)
{
@@ -39,6 +40,15 @@ GenreCombo::GenreCombo(QWidget *p)
#ifndef Q_OS_WIN
setProperty(GtkProxyStyle::constSlimComboProperty, true);
#endif
if (-1==tbHeight) {
ToolButton tb(parentWidget());
tb.setToolButtonStyle(Qt::ToolButtonIconOnly);
tb.setIcon(QIcon::fromTheme("ok"));
tb.ensurePolished();
tbHeight=tb.sizeHint().height();
}
setMaximumHeight(tbHeight);
}
void GenreCombo::update(const QSet<QString> &g)