mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01: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:
parent
9f6eb10ac2
commit
0b91cc1816
15
src/app/proxystyle.cpp
Normal file
15
src/app/proxystyle.cpp
Normal 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
20
src/app/proxystyle.h
Normal 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
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "commandlineoptions.h"
|
#include "commandlineoptions.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
#include "proxystyle.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
@ -52,6 +53,8 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainApplication app(cmdActions, argc, argv);
|
MainApplication app(cmdActions, argc, argv);
|
||||||
|
app.setStyle(new ProxyStyle());
|
||||||
|
|
||||||
if (app.isExited()) {
|
if (app.isExited()) {
|
||||||
// Not showing any output, otherwise XFCE shows "Failed to execute default browser. I/O error" error
|
// Not showing any output, otherwise XFCE shows "Failed to execute default browser. I/O error" error
|
||||||
// if (argc == 1) {
|
// if (argc == 1) {
|
||||||
|
@ -184,7 +184,8 @@ SOURCES += main.cpp\
|
|||||||
rss/rssicon.cpp \
|
rss/rssicon.cpp \
|
||||||
navigation/downicon.cpp \
|
navigation/downicon.cpp \
|
||||||
network/cabundleupdater.cpp \
|
network/cabundleupdater.cpp \
|
||||||
app/settings.cpp
|
app/settings.cpp \
|
||||||
|
app/proxystyle.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
3rdparty/qtwin.h \
|
3rdparty/qtwin.h \
|
||||||
@ -309,7 +310,8 @@ HEADERS += \
|
|||||||
rss/rssicon.h \
|
rss/rssicon.h \
|
||||||
navigation/downicon.h \
|
navigation/downicon.h \
|
||||||
network/cabundleupdater.h \
|
network/cabundleupdater.h \
|
||||||
app/settings.h
|
app/settings.h \
|
||||||
|
app/proxystyle.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
preferences/autofillmanager.ui \
|
preferences/autofillmanager.ui \
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "enhancedmenu.h"
|
#include "enhancedmenu.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
Menu::Menu(QWidget* parent)
|
Menu::Menu(QWidget* parent)
|
||||||
: QMenu(parent)
|
: QMenu(parent)
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QStyle>
|
||||||
|
|
||||||
class Action;
|
class Action;
|
||||||
class Menu : public QMenu
|
class Menu : public QMenu
|
||||||
|
Loading…
Reference in New Issue
Block a user