davidhurka added a comment.

  I managed to test your patch now.
  
  Nice to see the ToggleActionMenu working, this is what I had in mind once. 
Now I see that it can behave somehow weird: When e. g. Ellipsis is selected, 
and you select again Ellipsis from the Geometric Shape button menu, it gets 
deselected, like if you simply clicked the toolbar button.
  
  The reason is that you connect to the action group. Then you don’t know 
whether the menu entry or the toolbar button was clicked.
  
  Do you think this is weird?

INLINE COMMENTS

> simgunz wrote in shell.cpp:370
> Initially I put that action in `part.rc`, while now I moved it to `shell.rc`. 
> This makes more sense given that the toolbar belongs to the main window 
> somehow owns the toolbars and I create this action in `Shell::setupActions()` 
> that makes more sense. The problem is that `setupActions` is called before 
> `setupGUI` and `createGUI` so the toolbar does not exist yet. To solve this I 
> have to call `toolBar( "mainToolBar" );` to force the creation of the toolbar 
> and so be able to "bind" the KToggleToolBarAction to an existing toolbar.

This (maybe) causes one problem now. The default is to open new documents in 
new windows.

Open a new document with the Open action of an existing shell, so a new Okular 
window appears. Open the annotation toolbar in both windows. Click Hide in the 
second window. -> Only the annotation toolbar in the first window is closed.

REPOSITORY
  R223 Okular

BRANCH
  new-annotation-toolbar_ToggleActionMenu

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

To: simgunz, #okular, #vdg, ngraham
Cc: andreashurka, yurchor, trickyricky26, simgunz, ltoscano, cfeck, aacid, 
davidhurka, knambiar, ngraham, tobiasdeiminger, okular-devel, johnzh, andisa, 
siddharthmanthan, maguirre, fbampaloukas, joaonetto, kezik, tfella, darcyshen

Reply via email to