Skip to content

Add tooltips to the edit window formatting toolbar - #1161

Open
pasharm wants to merge 1 commit into
sabrogden:masterfrom
pasharm:feat/edit-toolbar-tooltips
Open

pasharm wants to merge 1 commit into
sabrogden:masterfrom
pasharm:feat/edit-toolbar-tooltips

Conversation

@pasharm

@pasharm pasharm commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

The formatting toolbar of the clip edit window has no tooltips, so some buttons are hard to tell apart: W (word wrap) for example, or the two indent buttons. The top toolbar of the same window already shows tooltips with shortcuts.

Changes

  • CRRECToolbar is created with TBSTYLE_TOOLTIPS. The toolbar registers every button with its tooltip and relays the mouse itself; CRulerRichEditCtrl::CreateToolbar only sets the texts. CreateToolbar also runs when the toolbar is recreated after a DPI change, so the tooltips come back with it.
  • The font name and size combos and the color picker sit over toolbar separators, so they get their own tools, the editable font combo also for its edit box. The toolbar does not relay mouse messages of these child windows, so the tools are added with TTF_SUBCLASS through TTM_ADDTOOL (CToolTipCtrl::AddTool does not set that flag).
  • Shortcuts handled in CRulerRichEditCtrl::PreTranslateMessage are shown the same way as on the top toolbar: Ctrl - B, Ctrl - I, Ctrl - U, Ctrl - W.
  • New strings in English.xml (EditToolbar*), with Russian and Ukrainian translations.

Testing

  • Built with MSBuild CP_Main_10.sln /p:Configuration=Release /p:Platform=x64.
  • Checked in the edit window with the Russian UI: every toolbar button, the font name combo (its edit box and its arrow), the font size combo and the color picker show their tooltip; the combos, the color picker and the buttons work as before.

The formatting toolbar of the clip edit window had no tooltips, so buttons
like W (word wrap) or the indent buttons were hard to tell apart. The top
toolbar of the same window already has them.

- The toolbar is created with TBSTYLE_TOOLTIPS, so it registers every
  button with its tooltip and relays the mouse itself; the editor only sets
  the texts, also when the toolbar is recreated after a DPI change.
- The font name and size combos and the color picker, which sit over
  toolbar separators, get their own tools. The toolbar does not relay
  mouse messages of its child windows, so these tools are added with
  TTF_SUBCLASS (CToolTipCtrl::AddTool does not set it).
- Shortcuts handled by the editor are shown the same way as on the top
  toolbar: Ctrl - B / I / U and Ctrl - W.
- New strings in English.xml, with Russian and Ukrainian translations.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant