Edited Menu behaviour on Mac, should hopefully close #129

- also improved visible clicks on ToolButtons
remotes/origin/falkon
nowrep 14 years ago
parent 456a8d3e77
commit eb0d24efd3
  1. 18
      src/app/qupzilla.cpp
  2. 5
      src/app/qupzilla.h
  3. 42
      src/other/aboutdialog.cpp
  4. 6
      src/tools/toolbutton.cpp

@ -90,6 +90,9 @@ QupZilla::QupZilla(StartBehaviour behaviour, QUrl startUrl)
, m_startingUrl(startUrl)
, m_startBehaviour(behaviour)
, m_menuBookmarksAction(0)
#ifdef Q_WS_MAC
, m_macMenuBar(new QMenuBar())
#endif
, m_actionPrivateBrowsing(0)
, m_statusBarMessage(new StatusBarMessage(this))
, m_sideBarWidth(0)
@ -261,19 +264,28 @@ void QupZilla::setupUi()
statusBar()->insertPermanentWidget(3, m_adblockIcon);
}
QMenuBar* QupZilla::menuBar() const
{
#ifdef Q_WS_MAC
return m_macMenuBar;
#else
return QMainWindow::menuBar();
#endif
}
void QupZilla::setupMenu()
{
// Standard actions - needed on Mac to be placed correctly in "application" menu
m_actionAbout = new QAction(QIcon(":/icons/qupzilla.png"), tr("&About QupZilla"), this);
m_actionAbout = new QAction(QIcon(":/icons/qupzilla.png"), tr("&About QupZilla"), 0);
m_actionAbout->setMenuRole(QAction::AboutRole);
connect(m_actionAbout, SIGNAL(triggered()), this, SLOT(aboutQupZilla()));
m_actionPreferences = new QAction(QIcon(":/icons/faenza/settings.png"), tr("Pr&eferences"), this);
m_actionPreferences = new QAction(QIcon(":/icons/faenza/settings.png"), tr("Pr&eferences"), 0);
m_actionPreferences->setMenuRole(QAction::PreferencesRole);
m_actionPreferences->setShortcut(QKeySequence("Ctrl+P"));
connect(m_actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences()));
m_actionQuit = new QAction(QIcon::fromTheme("application-exit"), tr("Quit"), this);
m_actionQuit = new QAction(QIcon::fromTheme("application-exit"), tr("Quit"), 0);
m_actionQuit->setMenuRole(QAction::QuitRole);
m_actionQuit->setShortcut(QKeySequence("Ctrl+Q"));
connect(m_actionQuit, SIGNAL(triggered()), this, SLOT(quitApp()));

@ -91,6 +91,8 @@ public:
void showNavigationWithFullscreen();
void saveSideBarWidth();
virtual QMenuBar* menuBar() const;
inline WebView* weView() const { WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(m_tabWidget->currentIndex())); if (!webTab) return 0; return webTab->view(); }
inline WebView* weView(int index) const { WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(index)); if (!webTab) return 0; return webTab->view(); }
inline LocationBar* locationBar() { return qobject_cast<LocationBar*>(m_tabWidget->locationBars()->currentWidget()); }
@ -232,6 +234,9 @@ private:
QMenu* m_menuClosedTabs;
QMenu* m_menuEncoding;
QAction* m_menuBookmarksAction;
#ifdef Q_WS_MAC
QMenuBar* m_macMenuBar;
#endif
QAction* m_actionAbout;
QAction* m_actionPreferences;

@ -76,24 +76,30 @@ void AboutDialog::showAuthors()
if (m_authorsHtml.isEmpty()) {
m_authorsHtml.append("<div style='margin:10px;'>");
m_authorsHtml.append(tr("<p><b>Main developer:</b><br/>%1 &lt;%2&gt;</p>").arg(QupZilla::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>"));
m_authorsHtml.append(tr("<p><b>Contributors:</b><br/>%1</p>").arg("Mladen Pejaković<br/>Bryan M Dunsmore<br/>Jan Rajnoha<br/>Daniele Cocca"));
m_authorsHtml.append(tr("<p><b>Translators:</b><br/>%1</p>").arg("Heimen Stoffels (Dutch)<br/>"
"Peter Vacula (Slovakia)<br/>"
"Ján Ďanovský (Slovakia)<br/>"
"Jonathan Hooverman (German)<br/>"
"Unink-Lio (Chinese)<br/>"
"Federico Fabiani (Italy)<br/>"
"Francesco Marinucci (Italy)<br/>"
"Jorge Sevilla (Spanish)<br/>"
"Michał Szymanowski (Polish)<br/>"
"Jérôme Giry (French)<br/>"
"Nicolas Ourceau (French)<br/>"
"Vasilis Tsivikis (Greek)<br/>"
"Alexander Maslov (Russian)<br/>"
"Oleg Brezhnev (Russian)<br/>"
"Sérgio Marques (Portuguese)<br/>"
"Mladen Pejaković (Serbian)"
));
m_authorsHtml.append(tr("<p><b>Contributors:</b><br/>%1</p>").arg(
"Mladen Pejaković<br/>"
"Bryan M Dunsmore<br/>"
"Jan Rajnoha<br/>"
"Daniele Cocca"
));
m_authorsHtml.append(tr("<p><b>Translators:</b><br/>%1</p>").arg(
"Heimen Stoffels (Dutch)<br/>"
"Peter Vacula (Slovakia)<br/>"
"Ján Ďanovský (Slovakia)<br/>"
"Jonathan Hooverman (German)<br/>"
"Unink-Lio (Chinese)<br/>"
"Federico Fabiani (Italy)<br/>"
"Francesco Marinucci (Italy)<br/>"
"Jorge Sevilla (Spanish)<br/>"
"Michał Szymanowski (Polish)<br/>"
"Jérôme Giry (French)<br/>"
"Nicolas Ourceau (French)<br/>"
"Vasilis Tsivikis (Greek)<br/>"
"Alexander Maslov (Russian)<br/>"
"Oleg Brezhnev (Russian)<br/>"
"Sérgio Marques (Portuguese)<br/>"
"Mladen Pejaković (Serbian)"
));
m_authorsHtml.append("</div>");
}
ui->textBrowser->setHtml(m_authorsHtml);

@ -82,11 +82,17 @@ void ToolButton::mousePressEvent(QMouseEvent* e)
return;
}
if (e->button() == Qt::MiddleButton) {
setDown(true);
}
QToolButton::mousePressEvent(e);
}
void ToolButton::mouseReleaseEvent(QMouseEvent* e)
{
setDown(false);
if (e->button() == Qt::MiddleButton && rect().contains(e->pos())) {
emit middleMouseClicked();
return;

Loading…
Cancel
Save