Depends on D21755.
This adds a new submenu to the View menu, which contains the existing Change Colors options.
There are menu items for every color mode, and one Normal Colors.
The menu is an ToggleActionMenu, so it can be plugged into the toolbar for quicker access.
The toolbar button always shows the last used color mode, so it can be enabled or disabled with one click.
This might be useful as soon as someone implements a useful Change Colors mode.
D21196 is related to this, because it gives the View Mode menu a similar usage pattern.
This also fixes 407217, because the button does toggle now. Additionally, every color mode can get a shortcut.
BUG: 407217
Screenshots from before can be found in D21196, or from the bug report: https://bugsfiles.kde.org/attachment.cgi?id=119841
Screenshot after (Left with Invert Colors and menubar menu, right with Normal Colors, and with/out toolbar button menu):
TODO
- Actions are not syncronized across tabs. Implement this feature in Part or PageView or where? See D21195#118908 (Normal in Okular)
- Assigning shortcuts doesn’t work. See D21195#464866 (Normal in Okular)
- Remove CheckableActionMenu by just adding the KActionMenu indepently to the KActionCollection, like done with the ‘Selection Tools’ button? See D21195#468175 (replaced by following)
- Use ToggleActionMenu instead of CheckableActionMenu.
- Show the current color mode in the toolbar button.
- Find Icons for ‘Change Dark & Light Colors’ and ‘Change Paper Color’
- Expose to D-Bus. See D21195#inline-119670
- Get the correct ‘&’ into the action text, not ‘&&’. See D21195#464938
- Cast to int or not? See D21195#inline-119107
Future
- Add ‘Invert Lightness’ color mode?