davidhurka marked 2 inline comments as done.
davidhurka added a comment.

  I have added CheckableActionMenu, which cuts the default action connection 
between the KActionMenu itself and the toolbar button. Now it is possible to 
make the toolbar button checkable, but not the submenu.
  
  But the toolbar button (QToolButton) pops up a menu which I don’t really 
understand. It is a menu consisting of the default action (ok so far) and the 
KActionMenu itself as submenu (not ok). F6824299: 
Screenshot_2019-05-15_15:03:40.png <https://phabricator.kde.org/F6824299>
  
  I have one idea how this submenu gets there: KActionMenu::createWidget sets 
the KActionMenu as default action for the QToolButton.
  Now the popup menu works fine. As soon as CheckableActionMenu::createWidget 
sets a new default action, this menu becomes a submenu (?).
  
  QToolButton::setMenu() has no effect, and QToolButton::menu() always returns 
nullptr.
  
  So, default action of the toolbar button works, menu works not.
  
  Someone an idea how I can keep the correct menu?

INLINE COMMENTS

> pageview.cpp:761
> +        a->setCheckable( true );
> +        a->setData( int( id ) );
> +        d->aColorModeMenu->addAction( a );

Can I use Okular::SettingsCore::EnumRenderMode::type somehow for the action 
data, without casting it to int?

> GB_2 wrote in pageview.cpp:672
> No, we always use three dots.
> This item should have the `configure` icon BTW.

Ok I’ll add that.

REPOSITORY
  R223 Okular

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

To: davidhurka, #okular, #vdg
Cc: GB_2, davidre, aacid, ngraham, okular-devel, joaonetto, tfella, darcyshen

Reply via email to