- Dont allow buttons in main widow to recieve focus.
- Use Ctrl+G as short-cut to show genre combo popup.
This commit is contained in:
committed by
craig.p.drummond
parent
a5f0e4f08b
commit
3daec7916c
@@ -75,6 +75,8 @@
|
||||
loading.
|
||||
43. Mpodiy seems to require integer parameters to be quoted.
|
||||
44. Only react to back or home action is listviews if view is visible!
|
||||
45. Dont allow buttons in main widow to recieve focus.
|
||||
46. Use Ctrl+G as short-cut to show genre combo popup.
|
||||
|
||||
1.2.2
|
||||
-----
|
||||
|
||||
@@ -44,8 +44,6 @@ public:
|
||||
virtual ~ComboBox() { }
|
||||
|
||||
void setEditable(bool editable);
|
||||
|
||||
private:
|
||||
void showPopup();
|
||||
void hidePopup();
|
||||
|
||||
|
||||
@@ -24,16 +24,27 @@
|
||||
#include "genrecombo.h"
|
||||
#include "toolbutton.h"
|
||||
#include "localize.h"
|
||||
#include "actioncollection.h"
|
||||
#include "action.h"
|
||||
|
||||
// Max number of items before we try to force a scrollbar in popup menu...
|
||||
static const int constPopupItemCount=32;
|
||||
|
||||
static Action *action=0;
|
||||
|
||||
GenreCombo::GenreCombo(QWidget *p)
|
||||
: ComboBox(p)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||
update(QSet<QString>());
|
||||
setEditable(false);
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
if (!action) {
|
||||
action=ActionCollection::get()->createAction("genrefilter", i18n("Filter On Genre"), 0);
|
||||
action->setShortcut(Qt::ControlModifier+Qt::Key_G);
|
||||
}
|
||||
addAction(action);
|
||||
connect(action, SIGNAL(triggered()), SLOT(showEntries()));
|
||||
}
|
||||
|
||||
void GenreCombo::update(const QSet<QString> &g)
|
||||
@@ -92,6 +103,13 @@ void GenreCombo::update(const QSet<QString> &g)
|
||||
setAttribute(Qt::WA_TransparentForMouseEvents, count()<2);
|
||||
}
|
||||
|
||||
void GenreCombo::showEntries()
|
||||
{
|
||||
if (isVisible()) {
|
||||
showPopup();
|
||||
}
|
||||
}
|
||||
|
||||
void GenreCombo::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
if (count()>1) {
|
||||
|
||||
@@ -41,6 +41,9 @@ public:
|
||||
public Q_SLOTS:
|
||||
void update(const QSet<QString> &g);
|
||||
|
||||
private Q_SLOTS:
|
||||
void showEntries();
|
||||
|
||||
private:
|
||||
QSet<QString> genres;
|
||||
};
|
||||
|
||||
@@ -37,6 +37,7 @@ ToolButton::ToolButton(QWidget *parent)
|
||||
#ifdef Q_OS_MAC
|
||||
setStyleSheet("QToolButton {border: 0}");
|
||||
#endif
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
}
|
||||
|
||||
void ToolButton::paintEvent(QPaintEvent *e)
|
||||
|
||||
Reference in New Issue
Block a user