mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
[Mac] Added some actions to menu of dock icon
This commit is contained in:
parent
0293a7bcd3
commit
d75ab566ef
@ -62,6 +62,7 @@
|
||||
#ifdef Q_OS_MAC
|
||||
#include "macmenureceiver.h"
|
||||
#include <QFileOpenEvent>
|
||||
#include <QMenu>
|
||||
#endif
|
||||
#include <QNetworkDiskCache>
|
||||
#include <QDesktopServices>
|
||||
@ -114,6 +115,7 @@ MainApplication::MainApplication(int &argc, char** argv)
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
, m_macMenuReceiver(0)
|
||||
, m_macDockMenu(0)
|
||||
#endif
|
||||
{
|
||||
#if defined(QZ_WS_X11) && !defined(NO_SYSTEM_DATAPATH)
|
||||
@ -639,6 +641,17 @@ QupZilla* MainApplication::makeNewWindow(Qz::BrowserWindow type, const QUrl &sta
|
||||
}
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
extern void qt_mac_set_dock_menu(QMenu* menu);
|
||||
|
||||
QMenu* MainApplication::macDockMenu()
|
||||
{
|
||||
if (!m_macDockMenu) {
|
||||
m_macDockMenu = new QMenu(0);
|
||||
qt_mac_set_dock_menu(m_macDockMenu);
|
||||
}
|
||||
return m_macDockMenu;
|
||||
}
|
||||
|
||||
MacMenuReceiver* MainApplication::macMenuReceiver()
|
||||
{
|
||||
if (!m_macMenuReceiver) {
|
||||
@ -1213,4 +1226,7 @@ QString MainApplication::tempPath() const
|
||||
MainApplication::~MainApplication()
|
||||
{
|
||||
delete m_uaManager;
|
||||
#ifdef Q_OS_MAC
|
||||
delete m_macDockMenu;
|
||||
#endif
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ class HTML5PermissionsManager;
|
||||
class Speller;
|
||||
#ifdef Q_OS_MAC
|
||||
class MacMenuReceiver;
|
||||
class QMenu;
|
||||
#endif
|
||||
|
||||
class QT_QUPZILLA_EXPORT MainApplication : public QtSingleApplication
|
||||
@ -130,6 +131,7 @@ public:
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
MacMenuReceiver* macMenuReceiver();
|
||||
QMenu* macDockMenu();
|
||||
bool event(QEvent* e);
|
||||
#endif
|
||||
|
||||
@ -205,6 +207,7 @@ private:
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
MacMenuReceiver* m_macMenuReceiver;
|
||||
QMenu* m_macDockMenu;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -628,6 +628,12 @@ void QupZilla::setupMenu()
|
||||
|
||||
m_superMenu->addSeparator();
|
||||
m_superMenu->addAction(new ActionCopy(m_actionQuit, this));
|
||||
#else
|
||||
ActionCopy* copyActionPrivateBrowsing = new ActionCopy(m_actionPrivateBrowsing);
|
||||
copyActionPrivateBrowsing->setText(copyActionPrivateBrowsing->text().remove(QLatin1Char('&')));
|
||||
mApp->macDockMenu()->addAction(copyActionPrivateBrowsing);
|
||||
mApp->macDockMenu()->addAction(m_menuFile->actions().at(1));
|
||||
mApp->macDockMenu()->addAction(m_menuFile->actions().at(0));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user