1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

Context menu for statusbar

Summary:
This adds a simple context menu to the statusbar;
the only option it has is "Hide", which obviously hides
the statusbar the same way as if you were to go the view menu.

Reviewers: drosca

Reviewed By: drosca

Subscribers: drosca, falkon

Tags: #falkon

Differential Revision: https://phabricator.kde.org/D16158
This commit is contained in:
Patrick Flynn 2018-10-15 20:21:21 +02:00 committed by David Rosca
parent 907e2e4938
commit 6d445edb44
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 15 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include <QToolTip>
#include <QStylePainter>
#include <QTimer>
#include <QMouseEvent>
class StatusBarButton : public ClickableLabel
{
@ -241,3 +242,14 @@ void StatusBar::removeButton(AbstractButtonInterface *button)
delete m_widgets.take(button->id()).widget;
}
void StatusBar::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::RightButton) {
QMenu context;
context.addAction(tr("Hide"), m_window, &BrowserWindow::toggleShowStatusBar);
context.exec(QCursor::pos());
}
QStatusBar::mousePressEvent(event);
}

View File

@ -59,6 +59,9 @@ public:
void addButton(AbstractButtonInterface *button);
void removeButton(AbstractButtonInterface *button);
protected:
void mousePressEvent(QMouseEvent *event);
private:
BrowserWindow *m_window;
TipLabel *m_statusBarText;