From 01e276d34ddfcac0082392adeee932daa373a801 Mon Sep 17 00:00:00 2001 From: dom Date: Sat, 2 May 2026 13:13:50 +0800 Subject: [PATCH] opt icons Signed-off-by: dom --- assets/fonts/custom_icon.ttf | Bin 13416 -> 14868 bytes lib/common/widgets/custom_icon.dart | 44 +++++++++------- lib/pages/common/dyn/common_dyn_page.dart | 8 +-- lib/pages/setting/models/extra_settings.dart | 14 ++--- .../setting/pages/fullscreen_sc_size.dart | 12 ++--- lib/pages/video/reply_new/view.dart | 48 ++++-------------- lib/pages/video/widgets/header_control.dart | 16 +++--- lib/plugin/pl_player/view/view.dart | 11 ++-- 8 files changed, 57 insertions(+), 96 deletions(-) diff --git a/assets/fonts/custom_icon.ttf b/assets/fonts/custom_icon.ttf index 88e7f64fce7f3d4d6f87f8313101725356c73677..74be248273496c19ae17dbcc98c7da6b66e5d7da 100644 GIT binary patch delta 1909 zcmZuyU2GIp6u#%)`PrGB-RbP?%yyUUcK^Cd3$(bq-TnbJ{1_yl4+~0&wrtuht!}q# zy9Jt{MMI1M9*~6^1Ygw9h$cwZ2V;nkzyl!?O27x+&=^^b(HBjGK=I7BC?Vdt=iIsH zJLlZL@6J?*kCl!@rjHW>hY2As4UA@szxG8h5JCqDVeVb|si7?wugw#}pC_b^4Ck_g zZL80IhrV}E(!*#FSFs6vN1Q~5M@xI(#23u>6RQ3Bv4QOE->#2i{9f#@9nJ17LJw3B zug89{kR8pv`-AWGA|WYEz@o*miPGikpRFLI;|@+D`TqGxZ;$}`qU@7q`});Ye-S&Y zqJ{jtB;E2~`{)f;Wnt{w2(_$Othit~0Ouf3o`ZcyX?=M!)tish074EDR(o5Ht&HAB z2uJ!bgu@3ztAX-+be-xWONgH|kN{~!AK{Z56kO<}pb$7QkVkjfxAc2r;w*xsiL4+A z(m_^{4TR`U5V0D`_7F-c-U@9Hiiyk!wTC=tiSRWQpgqtYsTrPB9c$=nh+NVmBF`X0 zH)bgBH{|*2r)EyEV-NC~OopC(A(MGHM7>Q;E;F0SoZh+>^{iw>wG6$*e44BoCue70 z-liBq8wW6dux0Cw=1fa-=1a?^xn;4oG(#;1sa$oP<oNg~p z-Vj6a_CldB26Q=$S?$AH05>NmCwF4Orq*I~Wv}O+FpVU6bdMdNmq;fW#Z-bQ;C?iK z+w_$swq+>J;q`1E>%->NccIPLXAWGZO0!hh41mi;RP2 zSGQ`w<_6i$yOZnPx=pYfUI9F@F3nK8UCqEVt-)^7-2fDL%IlI6>{=S47r36N>{KL> zO4TnTIr)twhw#?Ndtdkm@nt(p@JKQ?QLI&@R z_1MI2*D_}J=>pH;Nb>%eL$Wc+#fc0m#XvKg=4$71oPLhnPm><`tm-4ZF0X7;K%6-$=?XW^OPt0|@LM_)*(R@-QaLV~ z3@8=ks3|u}Mw5h$qd*-_24qiiq5 zzz9?e#Os4rDaP~Ld}ZKfegPC=cq%5p0YU#SWPZV{1mtrtFo8sY0HjZ9vK-?^Mv2K6 z7;7e{FbQk6fJGS?>KK^8EFB=t1ytI?z`_s&RL=s0Kz%PHCNE%e-u#}4hmq3;WEK!e zZf0T8V>AJ>wlH}xA7Ra7Gh#c!DaCn#>kjt@9wnY>JWqIQ__X*{_%{eB3A__b5JwfESp&+f3R(KRn%bKY^yqjXS1(y922AI extends State ), ), ), - icon: Transform.rotate( - angle: pi / 2, - child: const Icon(Icons.splitscreen, size: 19), - ), + icon: const Icon(CustomIcons.splitscreen_rotate_90, size: 19), ); FloatingActionButtonLocation get floatingActionButtonLocation => diff --git a/lib/pages/setting/models/extra_settings.dart b/lib/pages/setting/models/extra_settings.dart index 5e44b9104..ebebedda5 100644 --- a/lib/pages/setting/models/extra_settings.dart +++ b/lib/pages/setting/models/extra_settings.dart @@ -1,5 +1,5 @@ import 'dart:io'; -import 'dart:math' show pi, max; +import 'dart:math' show max; import 'package:PiliPlus/common/widgets/custom_icon.dart'; import 'package:PiliPlus/common/widgets/flutter/refresh_indicator.dart'; @@ -107,12 +107,9 @@ List get extraSettings => [ onTap: _showDynDialog, ), ), - SwitchModel( + const SwitchModel( title: '显示视频分段信息', - leading: Transform.rotate( - angle: pi / 2, - child: const Icon(MdiIcons.viewHeadline), - ), + leading: Icon(CustomIcons.view_headline_rotate_90), setKey: SettingBoxKey.showViewPoints, defaultVal: true, ), @@ -424,10 +421,7 @@ List get extraSettings => [ ), SwitchModel( title: '侧滑关闭二级页面', - leading: Transform.rotate( - angle: pi * 1.5, - child: const Icon(Icons.touch_app), - ), + leading: const Icon(CustomIcons.touch_app_rotate_270), setKey: SettingBoxKey.slideDismissReplyPage, defaultVal: Platform.isIOS, onChanged: (value) => CommonSlideMixin.slideDismissReplyPage = value, diff --git a/lib/pages/setting/pages/fullscreen_sc_size.dart b/lib/pages/setting/pages/fullscreen_sc_size.dart index 339efd1da..220da117e 100644 --- a/lib/pages/setting/pages/fullscreen_sc_size.dart +++ b/lib/pages/setting/pages/fullscreen_sc_size.dart @@ -1,6 +1,7 @@ import 'dart:io' show Platform; import 'dart:math' as math; +import 'package:PiliPlus/common/widgets/custom_icon.dart'; import 'package:PiliPlus/common/widgets/extra_hittest_stack.dart'; import 'package:PiliPlus/models_new/live/live_superchat/item.dart'; import 'package:PiliPlus/pages/live_room/superchat/superchat_card.dart'; @@ -113,13 +114,10 @@ class _FullScreenScSizeState extends State { alpha: .8, ), ), - child: Transform.rotate( - angle: math.pi / 4, - child: Icon( - size: 18, - Icons.open_in_full, - color: _colorScheme.onSecondaryContainer, - ), + child: Icon( + size: 18, + CustomIcons.open_in_full_rotate_45, + color: _colorScheme.onSecondaryContainer, ), ), ), diff --git a/lib/pages/video/reply_new/view.dart b/lib/pages/video/reply_new/view.dart index 875b486d8..2960b8a28 100644 --- a/lib/pages/video/reply_new/view.dart +++ b/lib/pages/video/reply_new/view.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'dart:math' show max; import 'package:PiliPlus/common/widgets/button/toolbar_icon_button.dart'; +import 'package:PiliPlus/common/widgets/custom_icon.dart'; import 'package:PiliPlus/common/widgets/flutter/text_field/controller.dart' show RichTextType; import 'package:PiliPlus/common/widgets/flutter/text_field/text_field.dart'; @@ -194,46 +195,19 @@ class _ReplyPageState extends CommonRichTextPubPageState { atBtn, const SizedBox(width: 8), moreBtn, - Expanded( - child: Center( - child: Obx( - () { - final syncToDynamic = _syncToDynamic.value; - return TextButton( - style: TextButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - padding: const EdgeInsets.all(13), - visualDensity: VisualDensity.compact, - foregroundColor: syncToDynamic - ? themeData.colorScheme.secondary - : themeData.colorScheme.outline, - ), - onPressed: () => _syncToDynamic.value = !syncToDynamic, - child: Row( - spacing: 4, - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - syncToDynamic - ? Icons.check_box - : Icons.check_box_outline_blank, - size: 22, - ), - const Flexible( - child: Text( - '转到动态', - maxLines: 1, - style: TextStyle(height: 1), - strutStyle: StrutStyle(leading: 0, height: 1), - ), - ), - ], - ), - ); - }, + const SizedBox(width: 8), + Obx( + () => ToolbarIconButton( + tooltip: '转到动态', + onPressed: _syncToDynamic.toggle, + icon: const Icon( + CustomIcons.repeat_rounded_rotate_90, + size: 22, ), + selected: _syncToDynamic.value, ), ), + const Spacer(), Obx( () => FilledButton.tonal( onPressed: enablePublish.value ? onPublish : null, diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index 177bbfacf..e80e8ba58 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -1,7 +1,6 @@ import 'dart:async' show Timer; import 'dart:convert' show jsonDecode, utf8; import 'dart:io' show Platform, File; -import 'dart:math'; import 'dart:typed_data' show Uint8List; import 'package:PiliPlus/common/constants.dart'; @@ -528,15 +527,12 @@ class HeaderControlState extends State () { final flipY = plPlayerController.flipY.value; return ActionRowLineItem( - icon: Transform.rotate( - angle: pi / 2, - child: Icon( - Icons.flip, - size: 13, - color: flipY - ? theme.colorScheme.onSecondaryContainer - : theme.colorScheme.outline, - ), + icon: Icon( + CustomIcons.flip_rotate_90, + size: 13, + color: flipY + ? theme.colorScheme.onSecondaryContainer + : theme.colorScheme.outline, ), onTap: () { plPlayerController.flipY.value = !flipY; diff --git a/lib/plugin/pl_player/view/view.dart b/lib/plugin/pl_player/view/view.dart index aafb67214..57dd56b8d 100644 --- a/lib/plugin/pl_player/view/view.dart +++ b/lib/plugin/pl_player/view/view.dart @@ -501,13 +501,10 @@ class _PLVideoPlayerState extends State iconSize: 22, color: Colors.white, disable: !show, - child: Transform.rotate( - angle: math.pi / 2, - child: const Icon( - Icons.reorder, - size: 22, - color: Colors.white, - ), + child: const Icon( + CustomIcons.view_headline_rotate_90, + size: 22, + color: Colors.white, ), ), onTap: widget.showViewPoints,