Skip to content

Commit

Permalink
Use filled buttons with a grey fill and an outline (#288)
Browse files Browse the repository at this point in the history
* Use filled buttons with a grey fill and an outline

* add disabled bg color
  • Loading branch information
Feichtmeier authored Feb 22, 2023
1 parent 5421347 commit 28311f8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/src/themes/common_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,20 @@ ElevatedButtonThemeData _getElevatedButtonThemeData({
);
}

FilledButtonThemeData _getFilledButtonThemeData(
Color backgroundColor,
Color foregroundColor,
FilledButtonThemeData _createFilledButtonThemeData(
ColorScheme colorScheme,
) {
return FilledButtonThemeData(
style: FilledButton.styleFrom(
backgroundColor: backgroundColor.withOpacity(0.3),
foregroundColor: foregroundColor,
disabledBackgroundColor: colorScheme.onSurface.withOpacity(0.06),
backgroundColor: colorScheme.onSurface.withOpacity(0.05),
surfaceTintColor: colorScheme.onSurface.withOpacity(0.05),
foregroundColor: colorScheme.onSurface,
visualDensity: _commonButtonStyle.visualDensity,
elevation: 0,
shadowColor: Colors.transparent,
shape: RoundedRectangleBorder(
side: BorderSide(color: colorScheme.outline),
borderRadius: BorderRadius.circular(kButtonRadius),
),
),
Expand Down Expand Up @@ -438,9 +440,8 @@ ThemeData createYaruLightTheme({
color: elevatedButtonColor ?? primaryColor,
textColor: elevatedButtonTextColor,
),
filledButtonTheme: _getFilledButtonThemeData(
elevatedButtonColor ?? primaryColor,
colorScheme.onSurface,
filledButtonTheme: _createFilledButtonThemeData(
colorScheme,
),
textButtonTheme: _createTextButtonThemeData(colorScheme),
switchTheme: _getSwitchThemeData(colorScheme, Brightness.light),
Expand Down Expand Up @@ -547,9 +548,8 @@ ThemeData createYaruDarkTheme({
applyElevationOverlayColor: true,
buttonTheme: _buttonThemeData,
textButtonTheme: _createTextButtonThemeData(colorScheme),
filledButtonTheme: _getFilledButtonThemeData(
elevatedButtonColor ?? primaryColor,
colorScheme.onSurface,
filledButtonTheme: _createFilledButtonThemeData(
colorScheme,
),
elevatedButtonTheme: _getElevatedButtonThemeData(
color: elevatedButtonColor ?? primaryColor,
Expand Down

0 comments on commit 28311f8

Please sign in to comment.