Skip to content

armgit / ente

Public Imported from GitHub
0

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

Align search and support typography

AmanRajSinghMourya97ea397f2fc9
diff --git a/mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart b/mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart
index 71abc667b5..f0563b7ed9 100644
--- a/mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart
@@ -193,7 +193,7 @@ class _SettingsSearchPageState extends State<SettingsSearchPage> {
const SizedBox(height: 8),
Text(
AppLocalizations.of(context).suggestions,
- style: TextStyles.bodyBold.copyWith(
+ style: TextStyles.large.copyWith(
color: context.componentColors.textBase,
),
),
@@ -263,8 +263,8 @@ class _SettingsSearchPageState extends State<SettingsSearchPage> {
padding: const EdgeInsets.only(top: 12, bottom: 8),
child: Text(
entry.sectionKey,
- style: TextStyles.mini.copyWith(
- color: context.componentColors.textLight,
+ style: TextStyles.large.copyWith(
+ color: context.componentColors.textBase,
),
),
),
diff --git a/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart b/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart
index 162f6975e6..8738fe9fa6 100644
--- a/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart
@@ -143,8 +143,8 @@ class HelpSupportPage extends StatelessWidget {
return Padding(
padding: const EdgeInsets.only(left: Spacing.sm, top: 6, bottom: 6),
child: Text(
- title.toUpperCase(),
- style: TextStyles.mini.copyWith(color: colors.textLight),
+ title,
+ style: TextStyles.large.copyWith(color: colors.textBase),
),
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart b/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart
index de5ff68524..75ab8e5979 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart
@@ -1,3 +1,4 @@
+import "package:ente_components/ente_components.dart";
import 'package:ente_pure_utils/ente_pure_utils.dart';
import 'package:flutter/material.dart';
import "package:intl/intl.dart";
@@ -31,7 +32,7 @@ class SearchResultWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final heroTagPrefix = searchResult.heroTag();
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
final colorScheme = getEnteColorScheme(context);
return SizedBox(
@@ -68,7 +69,7 @@ class SearchResultWidget extends StatelessWidget {
),
title: Text(
searchResult.name(),
- style: textTheme.body,
+ style: TextStyles.body.copyWith(color: colors.textBase),
overflow: TextOverflow.ellipsis,
),
subtitle: FutureBuilder<int>(
@@ -85,14 +86,14 @@ class SearchResultWidget extends StatelessWidget {
: count.toString();
return Text(
label != null ? "$label \u2022 $countText" : countText,
- style: textTheme.smallMuted,
+ style: TextStyles.mini.copyWith(color: colors.textLight),
overflow: TextOverflow.ellipsis,
);
}
if (label != null) {
return Text(
label,
- style: textTheme.smallMuted,
+ style: TextStyles.mini.copyWith(color: colors.textLight),
overflow: TextOverflow.ellipsis,
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart b/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart
index 4eee5f123e..f23a6bf63c 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart
@@ -323,11 +323,17 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
- child: Text(
- state.title,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: state.textStyle,
+ child: Align(
+ alignment: Alignment.centerLeft,
+ child: TooltipComponent(
+ message: state.title,
+ child: Text(
+ state.title,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: state.textStyle,
+ ),
+ ),
),
),
const SizedBox(width: Spacing.md),
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/searchable_item.dart b/mobile/apps/photos/lib/ui/viewer/search/result/searchable_item.dart
index e88f8a64ce..d444d506a2 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/searchable_item.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/searchable_item.dart
@@ -1,3 +1,4 @@
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
import "package:intl/intl.dart";
@@ -32,7 +33,7 @@ class SearchableItemWidget extends StatelessWidget {
//SearchResultPage
const additionalPrefix = "searchable_item";
final heroTagPrefix = additionalPrefix + searchResult.heroTag();
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
final colorScheme = getEnteColorScheme(context);
final result = searchResult;
final bool isCluster =
@@ -78,7 +79,7 @@ class SearchableItemWidget extends StatelessWidget {
? const SizedBox.shrink()
: Text(
searchResult.name(),
- style: textTheme.body,
+ style: TextStyles.body.copyWith(color: colors.textBase),
overflow: TextOverflow.ellipsis,
),
subtitle: FutureBuilder<int>(
@@ -91,7 +92,7 @@ class SearchableItemWidget extends StatelessWidget {
count: noOfMemories,
formattedCount: NumberFormat().format(noOfMemories),
),
- style: textTheme.smallMuted,
+ style: TextStyles.mini.copyWith(color: colors.textLight),
overflow: TextOverflow.ellipsis,
);
} else {
@@ -121,7 +122,7 @@ class SearchableItemPlaceholder extends StatelessWidget {
}
final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return ThumbnailListItem(
backgroundColor: thumbnailListItemBackgroundColor(context),
onTap: sectionType.ctaOnTap(context),
@@ -134,7 +135,10 @@ class SearchableItemPlaceholder extends StatelessWidget {
child: Icon(sectionType.getCTAIcon(), color: colorScheme.strokeMuted),
),
),
- title: Text(sectionType.getCTAText(context), style: textTheme.body),
+ title: Text(
+ sectionType.getCTAText(context),
+ style: TextStyles.body.copyWith(color: colors.textBase),
+ ),
);
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart b/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
index 44adf63ec3..b4b6deb087 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
@@ -1,5 +1,6 @@
import "dart:async";
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import 'package:flutter/material.dart';
import "package:flutter_animate/flutter_animate.dart";
@@ -361,7 +362,7 @@ class _SearchResultsSectionWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
final showTypeLabel = results.length > 1;
final children = <Widget>[];
for (int i = 0; i < results.length; i++) {
@@ -408,7 +409,10 @@ class _SearchResultsSectionWidget extends StatelessWidget {
),
),
const SizedBox(width: 10),
- Text(title, style: textTheme.bodyBold),
+ Text(
+ title,
+ style: TextStyles.large.copyWith(color: colors.textBase),
+ ),
],
),
),
diff --git a/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart b/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart
index b52d9c8d3b..71c6323b32 100644
--- a/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search_tab/contacts_section.dart
@@ -1,7 +1,7 @@
import "dart:async";
import "package:dotted_border/dotted_border.dart";
-import "package:ente_components/theme/text_styles.dart";
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
import "package:photos/core/constants.dart";
@@ -122,7 +122,7 @@ class _ContactsSectionState extends State<ContactsSection> {
@override
Widget build(BuildContext context) {
if (_contactSearchResults.isEmpty) {
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return Padding(
padding: const EdgeInsets.only(left: 12, right: 8, bottom: 24),
child: Row(
@@ -133,16 +133,14 @@ class _ContactsSectionState extends State<ContactsSection> {
children: [
Text(
SectionType.contacts.sectionTitle(context),
- style: TextStyles.h2.copyWith(
- color: textTheme.largeBold.color,
- ),
+ style: TextStyles.h2.copyWith(color: colors.textBase),
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.only(left: 4),
child: Text(
SectionType.contacts.getEmptyStateText(context),
- style: textTheme.smallMuted,
+ style: TextStyles.body.copyWith(color: colors.textLight),
),
),
],
@@ -203,7 +201,7 @@ class ContactRecommendation extends StatefulWidget {
class _ContactRecommendationState extends State<ContactRecommendation> {
@override
Widget build(BuildContext context) {
- final enteTextTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
final personId =
widget.contactSearchResult.params[kPersonParamID] as String?;
final contactUserId =
@@ -257,7 +255,7 @@ class _ContactRecommendationState extends State<ContactRecommendation> {
children: [
Text(
widget.contactSearchResult.name(),
- style: enteTextTheme.small,
+ style: TextStyles.body.copyWith(color: colors.textBase),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
@@ -279,6 +277,7 @@ class ContactCTA extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final colors = context.componentColors;
final enteColorScheme = getEnteColorScheme(context);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.5),
@@ -319,7 +318,7 @@ class ContactCTA extends StatelessWidget {
const SizedBox(height: 10.5),
Text(
AppLocalizations.of(context).invite,
- style: getEnteTextTheme(context).smallFaint,
+ style: TextStyles.body.copyWith(color: colors.textLighter),
),
],
),
diff --git a/mobile/apps/photos/lib/ui/viewer/search_tab/locations_section.dart b/mobile/apps/photos/lib/ui/viewer/search_tab/locations_section.dart
index 6858113203..0f598c7452 100644
--- a/mobile/apps/photos/lib/ui/viewer/search_tab/locations_section.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search_tab/locations_section.dart
@@ -3,7 +3,7 @@ import "dart:math";
import "dart:ui";
import "package:dotted_border/dotted_border.dart";
-import "package:ente_components/theme/text_styles.dart";
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:figma_squircle/figma_squircle.dart";
import "package:flutter/material.dart";
@@ -76,7 +76,7 @@ class _LocationsSectionState extends State<LocationsSection> {
@override
Widget build(BuildContext context) {
if (_locationsSearchResults.isEmpty) {
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return Padding(
padding: const EdgeInsets.only(left: 12, right: 8, bottom: 24),
child: Row(
@@ -87,16 +87,14 @@ class _LocationsSectionState extends State<LocationsSection> {
children: [
Text(
SectionType.location.sectionTitle(context),
- style: TextStyles.h2.copyWith(
- color: textTheme.largeBold.color,
- ),
+ style: TextStyles.h2.copyWith(color: colors.textBase),
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.only(left: 4),
child: Text(
SectionType.location.getEmptyStateText(context),
- style: textTheme.smallMuted,
+ style: TextStyles.body.copyWith(color: colors.textLight),
),
),
],
@@ -166,7 +164,7 @@ class LocationRecommendation extends StatelessWidget {
final heroTag =
locationSearchResult.heroTag() +
(locationSearchResult.previewThumbnail()?.tag ?? "");
- final enteTextTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return Padding(
padding: EdgeInsets.symmetric(horizontal: max(0, 2.5 - outerStrokeWidth)),
child: GestureDetector(
@@ -314,7 +312,9 @@ class LocationRecommendation extends StatelessWidget {
children: [
Text(
locationSearchResult.name(),
- style: enteTextTheme.small,
+ style: TextStyles.body.copyWith(
+ color: colors.textBase,
+ ),
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
@@ -378,7 +378,7 @@ class GoToMapWithBG extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final enteTextTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return Padding(
padding: EdgeInsets.symmetric(
horizontal: max(0, 2.5 - LocationRecommendation.outerStrokeWidth),
@@ -479,8 +479,8 @@ class GoToMapWithBG extends StatelessWidget {
children: [
Text(
AppLocalizations.of(context).yourMap,
- style: enteTextTheme.mini.copyWith(
- color: Colors.white,
+ style: TextStyles.mini.copyWith(
+ color: colors.specialWhite,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
@@ -510,7 +510,7 @@ class LocationCTA extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final enteTextTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
final enteColorScheme = getEnteColorScheme(context);
return Padding(
padding: EdgeInsets.symmetric(
@@ -602,7 +602,9 @@ class LocationCTA extends StatelessWidget {
children: [
Text(
AppLocalizations.of(context).addNew,
- style: enteTextTheme.miniFaint,
+ style: TextStyles.mini.copyWith(
+ color: colors.textLighter,
+ ),
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
diff --git a/mobile/apps/photos/lib/ui/viewer/search_tab/magic_section.dart b/mobile/apps/photos/lib/ui/viewer/search_tab/magic_section.dart
index 57cb5bfdc5..6000b48417 100644
--- a/mobile/apps/photos/lib/ui/viewer/search_tab/magic_section.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search_tab/magic_section.dart
@@ -1,6 +1,7 @@
import "dart:async";
import "dart:math";
+import "package:ente_components/ente_components.dart";
import "package:figma_squircle/figma_squircle.dart";
import "package:flutter/material.dart";
import "package:photos/core/constants.dart";
@@ -144,7 +145,7 @@ class MagicRecommendation extends StatelessWidget {
final heroTag =
magicSearchResult.heroTag() +
(magicSearchResult.previewThumbnail()?.tag ?? "");
- final enteTextTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return Padding(
padding: EdgeInsets.symmetric(horizontal: max(2.5 - _borderWidth, 0)),
child: GestureDetector(
@@ -226,8 +227,8 @@ class MagicRecommendation extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 8),
child: Text(
magicSearchResult.name(),
- style: enteTextTheme.small.copyWith(
- color: Colors.white,
+ style: TextStyles.body.copyWith(
+ color: colors.specialWhite,
),
maxLines: 3,
overflow: TextOverflow.fade,