소스 검색

Increase trailing margin for the theme picker selection checkmark

Before this, the checkmark aligned to the dropdown indicators. This increases
the spacing (to match that of the leading text) to indicate that the checkmark
is part of the content.

Sibling PR on auth: https://github.com/ente-io/auth/pull/31
Manav 2 년 전
부모
커밋
3c046f8d98
2개의 변경된 파일15개의 추가작업 그리고 5개의 파일을 삭제
  1. 14 5
      lib/ui/components/menu_item_widget.dart
  2. 1 0
      lib/ui/settings/theme_switch_widget.dart

+ 14 - 5
lib/ui/components/menu_item_widget.dart

@@ -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(),
         ],

+ 1 - 0
lib/ui/settings/theme_switch_widget.dart

@@ -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;