mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +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:
parent
907e2e4938
commit
6d445edb44
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user