Skip to content

Change the text size with Ctrl and the plus and minus keys - #21

Open
meirdick wants to merge 2 commits into
omacom:masterfrom
meirdick:text-size-shortcuts
Open

Change the text size with Ctrl and the plus and minus keys#21
meirdick wants to merge 2 commits into
omacom:masterfrom
meirdick:text-size-shortcuts

Conversation

@meirdick

Copy link
Copy Markdown

Omawrite follows the desktop text size, so today the only way to make the
writing bigger or smaller is to change it for the whole desktop. This adds
the shortcuts most apps have:

  • Ctrl+= makes the text bigger, Ctrl+- makes it smaller, Ctrl+0 puts it
    back to the default. Ctrl++ works too, for layouts that reach plus through
    Shift.
  • Ctrl and the mouse wheel does the same. A touchpad pinch arrives the same
    way, so the deltas add up to a notch before the zoom moves.
  • The steps are the ones Chromium and Firefox use, from 50% to 300%.

The zoom multiplies the desktop text size rather than replacing it, so
omarchy display text size still works and still re-flows without a restart.
The chosen size is saved and restored on the next start. The footer shows the
current size while you change it.

The second commit fixes something the shortcuts make easy to see: the save and
open icons in the footer stayed 16px while the text beside them scaled. They
now scale along with it.

Tests cover the zoom steps, the saved size, and the editor and footer sizes at
a given text scale. bin/test passes, and I ran the built app on Omarchy to
check the shortcuts, the wheel, and the footer.

Omawrite followed the desktop text size, so changing the writing size
meant leaving the app. Ctrl+= and Ctrl+- now step the text along the
zoom ladder a browser uses, Ctrl+0 returns to the default, and Ctrl and
the wheel does the same as it scrolls. The zoom multiplies the desktop
text size rather than replacing it, and is remembered between sessions.
The save and open icons stayed 16px while the status text beside them
followed the text size, which the zoom shortcuts make easy to notice.
The icons are drawn on a 16px grid, so the canvas now paints at the
scaled size and the hit area grows with it.
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