1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

Scrolling bookmarks menu whene there is alot of entries. Closes #175

- the same issue was also reported in #159
This commit is contained in:
nowrep 2012-01-15 12:35:29 +01:00
parent 9f6eb10ac2
commit 0b91cc1816
6 changed files with 43 additions and 4 deletions

15
src/app/proxystyle.cpp Normal file
View File

@ -0,0 +1,15 @@
#include "proxystyle.h"
ProxyStyle::ProxyStyle()
: QProxyStyle()
{
}
int ProxyStyle::styleHint(StyleHint hint, const QStyleOption* option, const QWidget* widget, QStyleHintReturn* returnData) const
{
if (hint == QStyle::SH_Menu_Scrollable) {
return 1;
}
return QProxyStyle::styleHint(hint, option, widget, returnData);
}

20
src/app/proxystyle.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef PROXYSTYLE_H
#define PROXYSTYLE_H
#include <QProxyStyle>
class ProxyStyle : public QProxyStyle
{
Q_OBJECT
public:
explicit ProxyStyle();
int styleHint(StyleHint hint, const QStyleOption* option = 0, const QWidget* widget = 0, QStyleHintReturn* returnData = 0) const;
signals:
public slots:
};
#endif // PROXYSTYLE_H

View File

@ -22,6 +22,7 @@
#include "commandlineoptions.h"
#include "mainapplication.h"
#include "proxystyle.h"
int main(int argc, char* argv[])
{
@ -52,6 +53,8 @@ int main(int argc, char* argv[])
}
MainApplication app(cmdActions, argc, argv);
app.setStyle(new ProxyStyle());
if (app.isExited()) {
// Not showing any output, otherwise XFCE shows "Failed to execute default browser. I/O error" error
// if (argc == 1) {

View File

@ -184,7 +184,8 @@ SOURCES += main.cpp\
rss/rssicon.cpp \
navigation/downicon.cpp \
network/cabundleupdater.cpp \
app/settings.cpp
app/settings.cpp \
app/proxystyle.cpp
HEADERS += \
3rdparty/qtwin.h \
@ -309,7 +310,8 @@ HEADERS += \
rss/rssicon.h \
navigation/downicon.h \
network/cabundleupdater.h \
app/settings.h
app/settings.h \
app/proxystyle.h
FORMS += \
preferences/autofillmanager.ui \

View File

@ -17,8 +17,6 @@
* ============================================================ */
#include "enhancedmenu.h"
#include <QDebug>
Menu::Menu(QWidget* parent)
: QMenu(parent)
{

View File

@ -20,6 +20,7 @@
#include <QMenu>
#include <QMouseEvent>
#include <QStyle>
class Action;
class Menu : public QMenu