Skip to content

Improve KeyPadButton text style resolution#123

Open
kxtxr wants to merge 2 commits intonaoki0719:mainfrom
kxtxr:main
Open

Improve KeyPadButton text style resolution#123
kxtxr wants to merge 2 commits intonaoki0719:mainfrom
kxtxr:main

Conversation

@kxtxr
Copy link
Copy Markdown

@kxtxr kxtxr commented Jul 1, 2025

Description

Improves the text style resolution logic in KeyPadButtonConfig to properly handle merging of custom button text styles with the default composed text style.

Changes

  • Enhanced the text style resolution in toButtonStyle() method
  • Add merging logic to ensure custom button text styles are properly combined with default styles

Problem Solved

Previously, when custom button styles were provided via buttonStyle, the resultant KeyPadButton's text style ignores user provided buttonStyle.textStyle and only uses composed.textStyle which may result in inconsistent UI. This change ensures that:

  • Custom text styles from buttonStyle are properly merged with the default composed text style
  • The merging order is correct (custom styles take precedence but don't completely override defaults e.g. fontFamily)
  • Proper fallback handling when either style is null

Testing

  • Verified that custom text styles work correctly with KeyPad buttons
  • Ensured backward compatibility with existing configurations
  • Tested various combinations of custom and default styles

This change improves the flexibility and reliability of text style customization for KeyPad buttons.

kxtxr added 2 commits July 1, 2025 03:04
- Update textStyle handling to merge buttonStyle's textStyle and composed textStyle based on widget states.
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