Context menu for statusbar
ClosedPublic

Authored by ghost46 on Oct 12 2018, 3:35 PM.

Details

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.

Update:
Name: Patrick Flynn
Email: patrick_dev2000@outlook.com

Diff Detail

Repository
R875 Falkon
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ghost46 created this revision.Oct 12 2018, 3:35 PM
Restricted Application added a subscriber: falkon. · View Herald TranscriptOct 12 2018, 3:35 PM
ghost46 requested review of this revision.Oct 12 2018, 3:35 PM
drosca requested changes to this revision.Oct 12 2018, 3:38 PM
drosca added a subscriber: drosca.
drosca added inline comments.
src/lib/other/statusbar.cpp
248

event->button() == Qt::RightButton)

249

This leaks, create it on stack instead (QMenu context;).

253

Just:

`context.addAction(tr("Hide"), m_window, &BrowserWindow::toggleShowStatusBar);

This revision now requires changes to proceed.Oct 12 2018, 3:38 PM

Made changes to fix the leak and to simplify the code. Also fixed formatting to match coding conventions.

drosca accepted this revision.Oct 15 2018, 4:17 PM

Your full name + email please, so I can push it for you.

This revision is now accepted and ready to land.Oct 15 2018, 4:17 PM
ghost46 edited the summary of this revision. (Show Details)Oct 15 2018, 4:20 PM

The patch doesn't apply:

INFO  Base commit is not in local repository; trying to fetch.
Created and checked out branch arcpatch-D16158.
Checking patch src/lib/other/statusbar.cpp...
error: while searching for:
void StatusBar::mousePressEvent(QMouseEvent *event)
{
    if (event->button()==Qt::RightButton) {
        QMenu *context = new QMenu;
        QAction *hide_bar = new QAction(tr("Hide"),this);
        connect(hide_bar,&QAction::triggered,m_window,&BrowserWindow::toggleShowStatusBar);
        context->addAction(hide_bar);
        context->exec(QCursor::pos());
    }
    QStatusBar::mousePressEvent(event);
error: patch failed: src/lib/other/statusbar.cpp:245
Applying patch src/lib/other/statusbar.cpp with 1 reject...
Rejected hunk #1.

Please update patch against master HEAD, instead of differences between from your first patch version.

Ok, I believe I fixed the issue, it should reflect the latest changes versus the master HEAD.

This revision was automatically updated to reflect the committed changes.