Skip to content

Square button corners and keyboard press feedback - #7

Open
sheep-farm wants to merge 9 commits into
omacom:masterfrom
sheep-farm:square-buttons
Open

Square button corners and keyboard press feedback#7
sheep-farm wants to merge 9 commits into
omacom:masterfrom
sheep-farm:square-buttons

Conversation

@sheep-farm

@sheep-farm sheep-farm commented Aug 20, 2026

Copy link
Copy Markdown

Removes rounded corners from keypad buttons and adds a visible press feedback effect that also triggers when typing on the physical keyboard, matching Omarchy's flat aesthetic.

When % follows any pending operator, show the running total with the
percent applied as soon as % is pressed:

- 200 + 10% displays 220
- 200 − 10% displays 180
- 200 × 10% displays 20
- 200 ÷ 10% displays 2000

The evaluated expression is preserved as "200 + 10%" instead of the
intermediate "200 + 20", making the calculation easier to read. On its
own, x% still divides by 100.
When a long number forced the display font to shrink, the Text item's
implicit height shrank with it and the number crept upward. Give the
display its own area below the expression, align the text to the bottom
of that area, and raise the minimum pixel size from 22 to 32 so long
results still look like part of the display instead of a tiny label.
Reads two optional display preferences from ~/.config/Omacom/omacalc.conf:

- decimalSeparator (dot/comma) lets numbers be typed and shown with a
  Brazilian-style comma instead of a period. Internal parsing and math
  stay locale-independent; only the presented digits and the decimal
  key label change.
- fixedDecimalPlaces rounds non-integer results to a fixed number of
  decimals (e.g. 10 / 3 -> 3.33), while whole-number results keep
  showing as plain integers. Left unset, formatting is unchanged.

Chained operands and expressions reflect the same rounding as the
result they came from, instead of leaking full floating-point
precision.
@sheep-farm sheep-farm changed the title Use square button corners Use cantos quadrados nos botões Aug 20, 2026
@sheep-farm sheep-farm changed the title Use cantos quadrados nos botões Use square button corners Aug 20, 2026
@sheep-farm sheep-farm changed the title Use square button corners Square button corners and keyboard press feedback Aug 20, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed the four commits this branch adds on top of b0a077caf79d80 plus the three press-feedback commits. The square corners and the keyboard-driven feedback both read as correct, every keyboard branch maps to a real button (including the ASCII - against the minus button's key, and . regardless of the displayed separator), and ./bin/build and ./bin/test are green on Qt 6.11.1: 23 passed, 0 failed.

Three things worth acting on.

Squash the feedback commits. c447131, d64c8e0 and e574d9c all carry the subject "Add press feedback to keypad buttons" with an empty body, and e574d9c has the same tree as d64c8e0. Merged as it stands, the history records three identical steps for one change. af79d80 is fine standing on its own.

The pressed state can stick on. Keys.onReleased at src/Main.qml:119 is the only thing that ever clears win.activeKey. Hold a key, switch away from the window, and release it there: the release never reaches face, so that button stays drawn pressed — scaled and lit — until the next keyboard release. Using the mouse does not clear it either. Clearing on loss of focus or window activation as well as on release closes that off.

/tests-build/ in .gitignore matches nothing. bin/test builds into $ROOT/build-tests, which line 2 already ignores, and bin/build uses $ROOT/build. Running both, the only directories created were build/ and build-tests/.

Smaller: win.activeKey holds a single key and any key release clears it, so pressing % as Shift+5 and letting go of Shift first drops the highlight while 5 is still down. Cosmetic, fix it only if it bothers you.

One worry that turned out not to be real, so you do not need to chase it: scaling the root Rectangle to 0.97 also scales the child MouseArea, which looks like it should drop clicks landing within a pixel of a button's edge. It does not. I checked on Qt 6.11.1 with a scene reproducing the geometry and clicked still fires for a press-and-release one pixel inside the original edge, even with the pressed scale exaggerated to 0.5.

Finally, a note for whoever merges rather than for you: this branch also carries PRs 1, 2 and 3, so merging it merges those as well.

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.

2 participants