D21755: [RFC] Replace ToolAction by a more universal “ToggleActionMenu”

Simone Gaiarin noreply at phabricator.kde.org
Fri Jun 21 21:25:22 BST 2019


simgunz added a comment.


  In D21755#483532 <https://phabricator.kde.org/D21755#483532>, @davidhurka wrote:
  
  > In D21755#482891 <https://phabricator.kde.org/D21755#482891>, @simgunz wrote:
  >
  > > I have tested this patch and added some inline comments. It seems to me that ToggleActionMenu requires way more external code to make it work, compared to ToolAction, which is quite automated. I think that some things could be made default in ToggleActionMenu, and some aspect hidden as well e.g. manage the QActionGroup internally without having the user have to manage it and set the action eveytime.
  >
  >
  > What would be a use case for an integrated QActionGroup? At least it couldn’t be used for the Selection Tools menu, because there are more mouse modes.
  
  
  Right. Haven't noticed that the mouse modes are more than three.
  
  > ToolAction bypasses the QActionGroup of KSelectAction by shadowing addAction().
  
  I think that this is more a bug than a feature. Adding `action->setActionGroup( selectableActionGroup() );` as first command of `addAction()` would make the action group and all the related methods work e.g. `actions()`.
  
  > When the actions are in a QActionGroup, triggering the checked action wouldn’t do anything. InstantPopupMode would make sense then.
  
  Not clear what you mean here.
  
  > 
  > 
  >> I tried it by only adding the actions to it and it does not work, no menu is shown. Adding the signal connection is also not enough. After that I gave up for now (I am lazy). But I think it needs to be a little more user-friendly.
  > 
  > Hmm. Did you click-and-hold?
  
  Maybe not.
  
  What I am probably not understanding is. Is `ToggleActionMenu` meant to be a general component that you want to use in other parts of KDE? Or is it just meant for Okular? If it is only used in Okular, where do you plan to use it besides than for the mouse actions? 
  What are the other modes in which it could work, besides the one presented in D21971 <https://phabricator.kde.org/D21971> i.e. as a replacement of ToolAction (basically a cleaner implementation of it).
  
  I never used KActionMenu so maybe I am missing something and creating an unuseful fuss :-) Thanks for the patience.

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D21755

To: davidhurka, #okular
Cc: simgunz, aacid, #vdg, okular-devel, fbampaloukas, joaonetto, tfella, ngraham, darcyshen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20190621/78b673ef/attachment-0001.html>


More information about the Okular-devel mailing list