Skip to content

Commit

Permalink
YaruTitleBarThemeData: fix buttonPadding type (#544)
Browse files Browse the repository at this point in the history
Another LTR-only EdgeInsets slipped in. Change it to EdgeInsetsGeometry
to support RTL-aware EdgeInsetsDirectional too.
  • Loading branch information
jpnurmi committed Jan 19, 2023
1 parent 02bf209 commit 345fec1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/controls/yaru_title_bar_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class YaruTitleBarThemeData extends ThemeExtension<YaruTitleBarThemeData>
final bool? centerTitle;
final double? titleSpacing;
final double? buttonSpacing;
final EdgeInsets? buttonPadding;
final EdgeInsetsGeometry? buttonPadding;
final MaterialStateProperty<Color?>? foregroundColor;
final MaterialStateProperty<Color?>? backgroundColor;
final TextStyle? titleTextStyle;
Expand All @@ -50,7 +50,7 @@ class YaruTitleBarThemeData extends ThemeExtension<YaruTitleBarThemeData>
bool? centerTitle,
double? titleSpacing,
double? buttonSpacing,
EdgeInsets? buttonPadding,
EdgeInsetsGeometry? buttonPadding,
MaterialStateProperty<Color?>? foregroundColor,
MaterialStateProperty<Color?>? backgroundColor,
TextStyle? titleTextStyle,
Expand Down Expand Up @@ -84,7 +84,8 @@ class YaruTitleBarThemeData extends ThemeExtension<YaruTitleBarThemeData>
centerTitle: t < 0.5 ? centerTitle : o?.centerTitle,
titleSpacing: lerpDouble(titleSpacing, o?.titleSpacing, t),
buttonSpacing: lerpDouble(buttonSpacing, o?.buttonSpacing, t),
buttonPadding: EdgeInsets.lerp(buttonPadding, o?.buttonPadding, t),
buttonPadding:
EdgeInsetsGeometry.lerp(buttonPadding, o?.buttonPadding, t),
foregroundColor: MaterialStateProperty.lerp<Color?>(
foregroundColor,
o?.foregroundColor,
Expand Down

0 comments on commit 345fec1

Please sign in to comment.