Change icons

This commit is contained in:
problematicconsumer
2024-02-15 15:23:02 +03:30
parent 97a308a351
commit 7e3442a310
25 changed files with 146 additions and 111 deletions

View File

@@ -1,3 +1,4 @@
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -99,7 +100,7 @@ class AddProfileModal extends HookConsumerWidget {
_Button(
key: const ValueKey("add_from_clipboard_button"),
label: t.profile.add.fromClipboard,
icon: Icons.content_paste,
icon: FluentIcons.clipboard_paste_24_regular,
size: buttonWidth,
onTap: () async {
final captureResult =
@@ -116,7 +117,7 @@ class AddProfileModal extends HookConsumerWidget {
_Button(
key: const ValueKey("add_by_qr_code_button"),
label: t.profile.add.scanQr,
icon: Icons.qr_code_scanner,
icon: FluentIcons.qr_code_24_regular,
size: buttonWidth,
onTap: () async {
final captureResult =
@@ -133,7 +134,7 @@ class AddProfileModal extends HookConsumerWidget {
_Button(
key: const ValueKey("add_manually_button"),
label: t.profile.add.manually,
icon: Icons.add,
icon: FluentIcons.add_24_regular,
size: buttonWidth,
onTap: () async {
context.pop();
@@ -170,7 +171,7 @@ class AddProfileModal extends HookConsumerWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.add,
FluentIcons.add_24_regular,
color: theme.colorScheme.primary,
),
const Gap(8),

View File

@@ -1,8 +1,10 @@
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/material.dart';
import 'package:fpdart/fpdart.dart';
import 'package:go_router/go_router.dart';
import 'package:hiddify/core/localization/translations.dart';
import 'package:hiddify/core/model/failures.dart';
import 'package:hiddify/core/widget/adaptive_icon.dart';
import 'package:hiddify/features/common/confirmation_dialogs.dart';
import 'package:hiddify/features/profile/details/profile_details_notifier.dart';
import 'package:hiddify/features/profile/model/profile_entity.dart';
@@ -95,6 +97,7 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
actions: [
if (state.isEditing)
PopupMenuButton(
icon: Icon(AdaptiveIcon(context).more),
itemBuilder: (context) {
return [
if (state.profile case RemoteProfileEntity())
@@ -175,7 +178,8 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
) ??
t.general.toggle.disabled,
),
leading: const Icon(Icons.update),
leading:
const Icon(FluentIcons.arrow_sync_24_regular),
onTap: () async {
final intervalInHours =
await SettingsInputDialog(
@@ -185,7 +189,8 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
optionalAction: (
t.general.state.disable,
() => notifier.setField(
updateInterval: none()),
updateInterval: none(),
),
),
validator: isPort,
mapTo: int.tryParse,

View File

@@ -1,3 +1,4 @@
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/material.dart';
import 'package:hiddify/core/localization/translations.dart';
@@ -13,8 +14,8 @@ enum ProfilesSort {
}
IconData get icon => switch (this) {
lastUpdate => Icons.update,
name => Icons.sort_by_alpha,
lastUpdate => FluentIcons.history_24_regular,
name => FluentIcons.text_sort_ascending_24_regular,
};
}

View File

@@ -1,3 +1,4 @@
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:hiddify/core/localization/translations.dart';
@@ -79,7 +80,7 @@ class ProfilesOverviewModal extends HookConsumerWidget {
onPressed: () {
const AddProfileRoute().push(context);
},
icon: const Icon(Icons.add),
icon: const Icon(FluentIcons.add_24_filled),
label: Text(t.profile.add.shortBtnTxt),
),
FilledButton.icon(
@@ -91,7 +92,7 @@ class ProfilesOverviewModal extends HookConsumerWidget {
},
);
},
icon: const Icon(Icons.sort),
icon: const Icon(FluentIcons.arrow_sort_24_filled),
label: Text(t.general.sort),
),
FilledButton.icon(
@@ -102,7 +103,7 @@ class ProfilesOverviewModal extends HookConsumerWidget {
)
.trigger();
},
icon: const Icon(Icons.update),
icon: const Icon(FluentIcons.arrow_sync_24_filled),
label: Text(t.profile.update.updateSubscriptions),
),
],
@@ -159,7 +160,7 @@ class ProfilesSortModal extends HookConsumerWidget {
turns: arrowTurn,
duration: const Duration(milliseconds: 100),
child: Icon(
Icons.arrow_upward,
FluentIcons.arrow_sort_up_24_regular,
semanticLabel: sort.mode.name,
),
),

View File

@@ -1,3 +1,4 @@
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
@@ -6,6 +7,7 @@ import 'package:go_router/go_router.dart';
import 'package:hiddify/core/localization/translations.dart';
import 'package:hiddify/core/model/failures.dart';
import 'package:hiddify/core/router/router.dart';
import 'package:hiddify/core/widget/adaptive_icon.dart';
import 'package:hiddify/core/widget/adaptive_menu.dart';
import 'package:hiddify/features/common/confirmation_dialogs.dart';
import 'package:hiddify/features/common/qr_code_dialog.dart';
@@ -132,7 +134,10 @@ class ProfileTile extends HookConsumerWidget {
),
),
),
const Icon(Icons.arrow_drop_down),
const Icon(
FluentIcons.caret_down_16_filled,
size: 16,
),
],
),
),
@@ -196,7 +201,7 @@ class ProfileActionButton extends HookConsumerWidget {
.read(updateProfileProvider(profile.id).notifier)
.updateProfile(profile as RemoteProfileEntity);
},
child: const Icon(Icons.update),
child: const Icon(FluentIcons.arrow_sync_24_filled),
),
),
);
@@ -210,7 +215,7 @@ class ProfileActionButton extends HookConsumerWidget {
message: MaterialLocalizations.of(context).showMenuTooltip,
child: InkWell(
onTap: toggleVisibility,
child: const Icon(Icons.more_vert),
child: Icon(AdaptiveIcon(context).more),
),
),
);
@@ -248,7 +253,7 @@ class ProfileActionsMenu extends HookConsumerWidget {
if (profile case RemoteProfileEntity())
AdaptiveMenuItem(
title: t.profile.update.buttonTxt,
icon: Icons.update,
icon: FluentIcons.arrow_sync_24_regular,
onTap: () {
if (ref.read(updateProfileProvider(profile.id)).isLoading) {
return;
@@ -260,7 +265,7 @@ class ProfileActionsMenu extends HookConsumerWidget {
),
AdaptiveMenuItem(
title: t.profile.share.buttonText,
icon: Icons.share,
icon: AdaptiveIcon(context).share,
subItems: [
if (profile case RemoteProfileEntity(:final url, :final name)) ...[
AdaptiveMenuItem(
@@ -305,14 +310,14 @@ class ProfileActionsMenu extends HookConsumerWidget {
],
),
AdaptiveMenuItem(
icon: Icons.edit,
icon: FluentIcons.edit_24_regular,
title: t.profile.edit.buttonTxt,
onTap: () async {
await ProfileDetailsRoute(profile.id).push(context);
},
),
AdaptiveMenuItem(
icon: Icons.delete,
icon: FluentIcons.delete_24_regular,
title: t.profile.delete.buttonTxt,
onTap: () async {
if (deleteProfileMutation.state.isInProgress) {