From 568d3cec2275f4e40c8d5e6acca2ebc3a74761d6 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Thu, 12 Sep 2013 18:41:13 +0000 Subject: [PATCH] Set maximum height of genre combo to toolbutton height. --- ChangeLog | 1 + widgets/genrecombo.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a0d19c62a..efb65a24a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 ----- diff --git a/widgets/genrecombo.cpp b/widgets/genrecombo.cpp index 6863270e1..6875b1ff3 100644 --- a/widgets/genrecombo.cpp +++ b/widgets/genrecombo.cpp @@ -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 &g)