Add flickcharm to combo box popup
This commit is contained in:
committed by
craig.p.drummond
parent
27abd9e257
commit
cb4c96ce28
@@ -313,10 +313,10 @@ set(CANTATA_SRCS ${CANTATA_CORE_SRCS}
|
||||
devices/deviceoptions.cpp
|
||||
widgets/treeview.cpp widgets/listview.cpp widgets/itemview.cpp widgets/autohidingsplitter.cpp widgets/timeslider.cpp
|
||||
widgets/actionlabel.cpp widgets/playqueueview.cpp widgets/groupedview.cpp widgets/actionitemdelegate.cpp widgets/textbrowser.cpp
|
||||
widgets/volumeslider.cpp widgets/genrecombo.cpp widgets/menubutton.cpp widgets/icons.cpp widgets/flickcharm.cpp
|
||||
widgets/toolbutton.cpp widgets/wizardpage.cpp widgets/statuslabel.cpp widgets/searchwidget.cpp widgets/messageoverlay.cpp
|
||||
widgets/basicitemdelegate.cpp widgets/sizegrip.cpp widgets/sizewidget.cpp widgets/servicestatuslabel.cpp widgets/spacerwidget.cpp
|
||||
widgets/songdialog.cpp widgets/stretchheaderview.cpp widgets/tableview.cpp widgets/songlabel.cpp widgets/thinsplitterhandle.cpp
|
||||
widgets/volumeslider.cpp widgets/genrecombo.cpp widgets/menubutton.cpp widgets/icons.cpp widgets/toolbutton.cpp widgets/wizardpage.cpp
|
||||
widgets/statuslabel.cpp widgets/searchwidget.cpp widgets/messageoverlay.cpp widgets/basicitemdelegate.cpp widgets/sizegrip.cpp
|
||||
widgets/sizewidget.cpp widgets/servicestatuslabel.cpp widgets/spacerwidget.cpp widgets/songdialog.cpp widgets/stretchheaderview.cpp
|
||||
widgets/tableview.cpp widgets/songlabel.cpp widgets/thinsplitterhandle.cpp
|
||||
context/lyricsettings.cpp context/ultimatelyricsprovider.cpp context/ultimatelyrics.cpp context/lyricsdialog.cpp
|
||||
context/contextwidget.cpp context/view.cpp context/artistview.cpp context/albumview.cpp context/songview.cpp context/contextengine.cpp
|
||||
context/wikipediaengine.cpp context/wikipediasettings.cpp context/othersettings.cpp context/contextsettings.cpp context/togglelist.cpp
|
||||
@@ -326,9 +326,8 @@ set(CANTATA_MOC_HDRS ${CANTATA_CORE_MOC_HDRS}
|
||||
gui/playbacksettings.h gui/serversettings.h gui/preferencesdialog.h gui/filesettings.h gui/interfacesettings.h gui/cachesettings.h
|
||||
gui/trayitem.h gui/coverdialog.h gui/searchpage.h
|
||||
widgets/treeview.h widgets/listview.h widgets/itemview.h widgets/autohidingsplitter.h widgets/timeslider.h widgets/actionlabel.h
|
||||
widgets/playqueueview.h widgets/groupedview.h widgets/actionitemdelegate.h widgets/volumeslider.h widgets/flickcharm.h
|
||||
widgets/genrecombo.h widgets/searchwidget.h widgets/messageoverlay.h widgets/servicestatuslabel.h widgets/stretchheaderview.h
|
||||
widgets/tableview.h
|
||||
widgets/playqueueview.h widgets/groupedview.h widgets/actionitemdelegate.h widgets/volumeslider.h widgets/genrecombo.h
|
||||
widgets/searchwidget.h widgets/messageoverlay.h widgets/servicestatuslabel.h widgets/stretchheaderview.h widgets/tableview.h
|
||||
context/togglelist.h context/ultimatelyrics.h context/ultimatelyricsprovider.h context/lyricsdialog.h
|
||||
context/contextwidget.h context/artistview.h context/albumview.h context/songview.h context/view.h context/contextengine.h
|
||||
context/wikipediaengine.h context/wikipediasettings.h context/othersettings.h context/lastfmengine.h context/metaengine.h
|
||||
|
||||
@@ -12,10 +12,10 @@ endif (ENABLE_QT5)
|
||||
add_library(support-core STATIC ${SUPPORT_CORE_MOC_SRCS} ${SUPPORT_CORE_SRCS})
|
||||
|
||||
if (NOT ENABLE_UBUNTU)
|
||||
set(SUPPORT_SRCS icon.cpp fancytabwidget.cpp messagewidget.cpp buddylabel.cpp action.cpp actioncollection.cpp
|
||||
set(SUPPORT_SRCS icon.cpp fancytabwidget.cpp messagewidget.cpp buddylabel.cpp action.cpp actioncollection.cpp flickcharm.cpp
|
||||
configuration.cpp lineedit.cpp gtkstyle.cpp spinner.cpp messagebox.cpp inputdialog.cpp thread.cpp squeezedtextlabel.cpp)
|
||||
|
||||
set(SUPPORT_MOC_HDRS fancytabwidget.h messagewidget.h inputdialog.h pagewidget.h action.h actioncollection.h)
|
||||
set(SUPPORT_MOC_HDRS fancytabwidget.h messagewidget.h inputdialog.h pagewidget.h action.h actioncollection.h flickcharm.h)
|
||||
|
||||
if (NOT WIN32)
|
||||
set(SUPPORT_SRCS ${SUPPORT_SRCS} windowmanager.cpp gtkproxystyle.cpp combobox.cpp shortcuthandler.cpp)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QDesktopWidget>
|
||||
#include <QApplication>
|
||||
#include "gtkstyle.h"
|
||||
#include "flickcharm.h"
|
||||
|
||||
// Max number of items before we try to force a scrollbar in popup menu...
|
||||
static int maxPopupItemCount=-1;
|
||||
@@ -73,6 +74,7 @@ void ComboBox::showPopup()
|
||||
}
|
||||
}
|
||||
QComboBox::showPopup();
|
||||
FlickCharm::self()->activateOn(view());
|
||||
|
||||
if (GtkStyle::isActive() && parentWidget() && view()->parentWidget() && count()>maxPopupItemCount) {
|
||||
// Also, if the size of the popup is more than required for 32 items, then
|
||||
|
||||
@@ -86,7 +86,7 @@ void FlickCharm::activateOn(QWidget *widget)
|
||||
}
|
||||
|
||||
QAbstractScrollArea *scrollArea = dynamic_cast<QAbstractScrollArea*>(widget);
|
||||
if (scrollArea) {
|
||||
if (scrollArea && !d->flickData.contains(scrollArea)) {
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
@@ -135,7 +135,7 @@ void FlickCharm::deactivateFrom(QWidget *widget)
|
||||
}
|
||||
|
||||
QAbstractScrollArea *scrollArea = dynamic_cast<QAbstractScrollArea*>(widget);
|
||||
if (scrollArea) {
|
||||
if (scrollArea && d->flickData.contains(scrollArea)) {
|
||||
QWidget *viewport = scrollArea->viewport();
|
||||
|
||||
viewport->removeEventFilter(this);
|
||||
Reference in New Issue
Block a user