Skip to content

Add a Remember last tool preference - #60

Merged
faetalize merged 1 commit into
masterfrom
feat/15-remember-last-tool
Nov 3, 2026
Merged

faetalize merged 1 commit into
masterfrom
feat/15-remember-last-tool

Conversation

@faetalize

Copy link
Copy Markdown
Owner

Summary

  • Adds a "Remember last tool" switch under Preferences → General, off by default. Its subtitle is "Also preserves tool settings".
  • When on, a new window starts with the tool the last closed window had selected, along with each tool's size, colour and fill, and the blur type.
  • Turning the switch off removes the saved tool, so turning it back on doesn't bring back an old one.
  • The tool is saved when an image window closes, not on every change. Video and empty windows don't save, so they can't overwrite a real one.
  • Settings are stored in their own [last_tool] group in settings.ini. Tools are saved by name, not number, so adding a tool later won't shift sizes onto the wrong tool.
  • If the last tool was Recognize text, the next screenshot opens in it and starts text recognition straight away.
  • README gets one line pointing to the new option.

Closes #15

Testing

  • New last-tool test suite (tests/test-last-tool.c): round trip of tool, widths, colours, fill and blur type; invalid values ignored; saving beside existing preferences keeps them and survives a preferences rewrite.
  • Full test suite: all 15 suites pass.
  • Manual check in a headless Broadway session with a real window: a yellow 16 px brush is restored in the next window; switching the preference off drops the [last_tool] group and the next window starts on the default brush at 8 px.
  • Not run: real Wayland desktop session, and the screenshot → Recognize text path end to end.

Off by default. When on, a new window starts with the tool the last
closed one had picked, and every tool's size, colour and fill, plus the
blur type. Closes #15.

The tool is saved when an image window goes, not on every change, so
dragging the size slider doesn't write the file over and over. A window
with no picture or a video never had tools to change, so it doesn't save
and can't overwrite a window that did.

It sits in its own [last_tool] group of settings.ini, with tools named
rather than numbered so adding a tool later doesn't shift the sizes onto
the wrong ones. Switching the preference off drops the group, so
switching it on again doesn't bring back an old tool.
@faetalize
faetalize merged commit a173faf into master Nov 3, 2026
2 checks passed
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.

[Feature] remember previous tool and settings

1 participant