Merge pull request #791 from ente-io/tweak-trailing-margin-theme-picker
Increase trailing margin for the theme picker selection checkmark
This commit is contained in:
commit
71e4dbd083
|
@ -22,6 +22,9 @@ class MenuItemWidget extends StatefulWidget {
|
|||
final Color? trailingIconColor;
|
||||
final Widget? trailingWidget;
|
||||
final bool trailingIconIsMuted;
|
||||
|
||||
/// If provided, add this much extra spacing to the right of the trailing icon.
|
||||
final double trailingExtraMargin;
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onDoubleTap;
|
||||
final Color? menuItemColor;
|
||||
|
@ -46,6 +49,7 @@ class MenuItemWidget extends StatefulWidget {
|
|||
this.trailingIconColor,
|
||||
this.trailingWidget,
|
||||
this.trailingIconIsMuted = false,
|
||||
this.trailingExtraMargin = 0.0,
|
||||
this.onTap,
|
||||
this.onDoubleTap,
|
||||
this.menuItemColor,
|
||||
|
@ -177,11 +181,16 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
|
|||
),
|
||||
)
|
||||
: widget.trailingIcon != null
|
||||
? Icon(
|
||||
widget.trailingIcon,
|
||||
color: widget.trailingIconIsMuted
|
||||
? enteColorScheme.strokeMuted
|
||||
: widget.trailingIconColor,
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: widget.trailingExtraMargin,
|
||||
),
|
||||
child: Icon(
|
||||
widget.trailingIcon,
|
||||
color: widget.trailingIconIsMuted
|
||||
? enteColorScheme.strokeMuted
|
||||
: widget.trailingIconColor,
|
||||
),
|
||||
)
|
||||
: widget.trailingWidget ?? const SizedBox.shrink(),
|
||||
],
|
||||
|
|
|
@ -73,6 +73,7 @@ class _ThemeSwitchWidgetState extends State<ThemeSwitchWidget> {
|
|||
pressedColor: getEnteColorScheme(context).fillFaint,
|
||||
isExpandable: false,
|
||||
trailingIcon: currentThemeMode == themeMode ? Icons.check : null,
|
||||
trailingExtraMargin: 4,
|
||||
onTap: () async {
|
||||
AdaptiveTheme.of(context).setThemeMode(themeMode);
|
||||
currentThemeMode = themeMode;
|
||||
|
|
Loading…
Reference in a new issue