Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] Revert pin to favorite change

Neeraj Gupta95127e6bcda0
diff --git a/auth/lib/l10n/arb/app_en.arb b/auth/lib/l10n/arb/app_en.arb
index a43d430e40..cc4139fc34 100644
--- a/auth/lib/l10n/arb/app_en.arb
+++ b/auth/lib/l10n/arb/app_en.arb
@@ -451,9 +451,8 @@
"customEndpoint": "Connected to {endpoint}",
"pinText": "Pin",
"unpinText": "Unpin",
- "fav": "Favorite",
+
"favorites": "Favorites",
- "unfav": "Unfavorite",
"favoritedCodeMessage": "{code} has been added to favorites",
"unfavoritedCodeMessage": "{code} has been removed from favorites",
"tags": "Tags",
diff --git a/auth/lib/ui/code_widget.dart b/auth/lib/ui/code_widget.dart
index f8247b9bff..a350f3c67b 100644
--- a/auth/lib/ui/code_widget.dart
+++ b/auth/lib/ui/code_widget.dart
@@ -25,6 +25,7 @@ import 'package:ente_auth/utils/totp_util.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_context_menu/flutter_context_menu.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:logging/logging.dart';
import 'package:move_to_background/move_to_background.dart';
@@ -114,27 +115,20 @@ class _CodeWidgetState extends State<CodeWidget> {
final l10n = context.l10n;
Widget getCardContents(AppLocalizations l10n) {
- // final bool isFavorite = widget.code.isPinned;
return Stack(
children: [
- // if (isFavorite)
- // Align(
- // alignment: Alignment.topRight,
- // child: Icon(
- // Icons.star,
- // color: colorScheme.pinnedBgColor,
- // size: widget.isCompactMode ? 16 : 24,
- // ),
- // //
- // // child: CustomPaint(
- // // painter: PinBgPainter(
- // // color: colorScheme.pinnedBgColor,
- // // ),
- // // size: widget.isCompactMode
- // // ? const Size(24, 24)
- // // : const Size(39, 39),
- // // ),
- // ),
+ if (widget.code.isPinned)
+ Align(
+ alignment: Alignment.topRight,
+ child: CustomPaint(
+ painter: PinBgPainter(
+ color: colorScheme.pinnedBgColor,
+ ),
+ size: widget.isCompactMode
+ ? const Size(24, 24)
+ : const Size(39, 39),
+ ),
+ ),
if (widget.code.isTrashed && kDebugMode)
Align(
alignment: Alignment.topLeft,
@@ -181,11 +175,13 @@ class _CodeWidgetState extends State<CodeWidget> {
Align(
alignment: Alignment.topRight,
child: Padding(
- padding: const EdgeInsets.only(top: 2, right: 2),
- child: Icon(
- Icons.star,
- color: colorScheme.primary700.withOpacity(0.4),
- size: widget.isCompactMode ? 12 : 20,
+ padding: widget.isCompactMode
+ ? const EdgeInsets.only(right: 4, top: 4)
+ : const EdgeInsets.only(right: 6, top: 6),
+ child: SvgPicture.asset(
+ "assets/svg/pin-card.svg",
+ width: widget.isCompactMode ? 8 : null,
+ height: widget.isCompactMode ? 8 : null,
),
),
),
@@ -278,10 +274,11 @@ class _CodeWidgetState extends State<CodeWidget> {
),
if (!widget.code.isTrashed)
MenuItem(
- label: widget.code.isPinned ? l10n.unfav : l10n.fav,
+ label:
+ widget.code.isPinned ? l10n.unpinText : l10n.pinText,
icon: widget.code.isPinned
- ? Icons.star_border
- : Icons.star_border_outlined,
+ ? Icons.push_pin
+ : Icons.push_pin_outlined,
onSelected: () => _onPinPressed(null),
),
if (!widget.code.isTrashed)
diff --git a/auth/lib/ui/components/code_selection_actions_widget.dart b/auth/lib/ui/components/code_selection_actions_widget.dart
index 676fa3b801..be2d17db1b 100644
--- a/auth/lib/ui/components/code_selection_actions_widget.dart
+++ b/auth/lib/ui/components/code_selection_actions_widget.dart
@@ -58,9 +58,9 @@ class _CodeSelectionActionsWidgetState
items.add(
SelectionActionButton(
labelText: widget.code.isPinned
- ? context.l10n.unfav
- : context.l10n.fav,
- icon: widget.code.isPinned ? Icons.star_outline : Icons.star,
+ ? context.l10n.unpinText
+ : context.l10n.pinText,
+ icon: widget.code.isPinned ? Icons.push_pin_outlined : Icons.pin,
onTap: widget.onPin,
),
);