Skip to content

allow to adjust button corner radius - #6532

Draft
toaster wants to merge 3 commits into
fyne-io:developfrom
toaster:feature/button_corner_radius
Draft

toaster wants to merge 3 commits into
fyne-io:developfrom
toaster:feature/button_corner_radius

Conversation

@toaster

@toaster toaster commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Description:

This PR allows to override the default button corner radius.
Thus, it is possible to create a circular button (e.g., with only an icon it).

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.

…m Button#CreateRenderer

This is also done in the renderer’s `#applyTheme` which is called in any case.
This can be used to apply custom corner radius to specific buttons.
Together with `canvas.RadiusMaximum` and `canvas.RadiusNone` it is
possible to create circular buttons (for squares) and rectangular ones
(without rounded corners).

The actual logic is only applied in the next commit to make the change
in the actual test expectation more obvious.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 59.454% (+0.005%) from 59.449% — toaster:feature/button_corner_radius into fyne-io:develop

@toaster
toaster marked this pull request as ready for review September 12, 2026 10:26
@andydotxyz

Copy link
Copy Markdown
Member

On reflection I have realised this is possible without the new API - using a ThemeOverride container and adjusting the SizeNameButtonRadius (or similar).

If we want to make a circle button specifically easier perhaps there is an intent based API we could add rather than exposing graphical tweaks on a widget API?

@toaster

toaster commented Sep 12, 2026

Copy link
Copy Markdown
Member Author

On reflection I have realised this is possible without the new API - using a ThemeOverride container and adjusting the SizeNameButtonRadius (or similar).

That’s still a hack, IMO.

If we want to make a circle button specifically easier perhaps there is an intent based API we could add rather than exposing graphical tweaks on a widget API?

I’ll think about this.

@toaster
toaster marked this pull request as draft September 12, 2026 13:00
@andydotxyz

Copy link
Copy Markdown
Member

On reflection I have realised this is possible without the new API - using a ThemeOverride container and adjusting the SizeNameButtonRadius (or similar).

That’s still a hack, IMO.

It probably is a hack if you're overriding theme to add a use-case requirement like "circle is a special button" but not if you're adjusting just this one button for some theme related desire.

Therefore if this circular/pill button is declarable in an intent/behaviour API instead of graphical tweaks then addressing this with a new API does make sense.

@toaster toaster mentioned this pull request Oct 11, 2026
4 tasks done
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.

3 participants