Okular empty "Tools" context menu
AbandonedPublic

Authored by emateli on Jun 11 2017, 6:02 PM.

Details

Reviewers
aacid
Group Reviewers
Okular
Summary

Okular currently has a minor bug when using menubar style in the title bar or application menu widget.

The bug: If you right click on Okular's document UI you will be shown an empty "Tools" separator entry. This patch aims to fix that minor annoyance.

Test Plan
  1. Set menubar style to: "Title bar button" or "Application Menu Widget"
  2. Right click on Okular's document UI.

Expected: No "Tools" separator when there are no actions to be shown
Actual: An empty "Tools" menu item shows up.

For reference: https://imgur.com/a/xVjg3

Diff Detail

Repository
R223 Okular
Lint
Lint Skipped
Unit
Unit Tests Skipped
emateli created this revision.Jun 11 2017, 6:02 PM
aacid added a subscriber: aacid.Jun 14 2017, 10:18 PM

I don't agree with this patch, the global menu bar should not be setting actions to invisible, why is it doing that?

I think the bug is on their side not in Okular side

In D6185#116489, @aacid wrote:

I don't agree with this patch, the global menu bar should not be setting actions to invisible, why is it doing that?

I think the bug is on their side not in Okular side

It kind of makes sense for the menu bar actions to be unavailable since the menu is no longer inside the app, but rather in the title bar or in a panel widget, so you cannot really show/hide it anymore. And by "their side" I assume you mean the team that writes KDE Libraries?

Anyhow feel free to close this if you think the bug is not related to Okular.

In D6185#116489, @aacid wrote:

I don't agree with this patch, the global menu bar should not be setting actions to invisible, why is it doing that?

I think the bug is on their side not in Okular side

It kind of makes sense for the menu bar actions to be unavailable since the menu is no longer inside the app, but rather in the title bar or in a panel widget, so you cannot really show/hide it anymore.

Right, actually it's "visible all the time", so why are they hidden?

And by "their side" I assume you mean the team that writes KDE Libraries?

I don't think this is done in "KDE Libraries", but if it is, yes.

As far as I can tell from the source it's not Okular that it's doing the hiding of that specific action, but rather the underlying framework apparently. The action is visible again if you explicitly call setVisible(true) but as expected, it does nothing when invoked.

So even if it weren't hidden, showMenuBar action would not be working regardless since the menubar is not handled by Okular anymore. So I personally don't think that hiding or disabling it would be wrong,

aacid added a comment.Jun 18 2017, 9:21 PM

Hmmm, now you're saying something that doesn't make sense to me.

I wrote the code that hides the Show Menu Bar action and it explicitily sets the action as checked https://cgit.kde.org/kconfigwidgets.git/tree/src/kstandardaction.cpp#n122

Which frameworks version are you using? And which Qt?

I can see that the source you linked explicitly makes it checked, but If you inspect the state just before the if execution you'd see that it actually is not checked. Anyhow, if KStandartAction is supposed to handle this, then I guess the bug(if any) might be there and not in Okular after all. Just try it out on your own machine with menubar style set to "title bar".

Using:

  • KDE Frameworks 5.35.0
  • QMake version 3.1
  • Qt version 5.9.0
emateli changed the visibility from "Public (No Login Required)" to "All Users".Jun 19 2017, 6:24 PM
emateli changed the visibility from "All Users" to "Public (No Login Required)".Jun 20 2017, 10:33 AM
aacid added a comment.Jun 25 2017, 9:54 PM

the bug is actually in Shell::showEvent

This revision now requires changes to proceed.Jul 2 2017, 4:00 PM
emateli abandoned this revision.Jul 2 2017, 7:32 PM

Resolved by author