diff --git a/lib/pages/filter/filter.dart b/lib/pages/filter/filter.dart index 98c574363..aa632cd94 100644 --- a/lib/pages/filter/filter.dart +++ b/lib/pages/filter/filter.dart @@ -70,18 +70,16 @@ class _GalleryCatButtonState extends State { @override Widget build(BuildContext context) { // loggerNoStack.v('GalleryCatButton build [${widget.text}] [$_value]'); - return Container( - child: GestureDetector( - onLongPress: _onLongPress, - child: CupertinoButton( - padding: const EdgeInsets.all(2.0), - onPressed: _onPressed, - pressedOpacity: 1.0, - child: Text( - widget.text, - style: TextStyle(color: _textColor), - ), - color: _color, + return GestureDetector( + onLongPress: _onLongPress, + child: CupertinoButton( + padding: const EdgeInsets.all(2.0), + onPressed: _onPressed, + pressedOpacity: 1.0, + color: _color, + child: Text( + widget.text, + style: TextStyle(color: _textColor), ), ), ); diff --git a/lib/pages/gallery/view/gallery_widget.dart b/lib/pages/gallery/view/gallery_widget.dart index f3f621255..427cacd62 100644 --- a/lib/pages/gallery/view/gallery_widget.dart +++ b/lib/pages/gallery/view/gallery_widget.dart @@ -239,12 +239,6 @@ class ReadButton extends StatelessWidget { return Obx( () => MouseRegionClick( child: CupertinoButton( - child: Text( - (_pageState.lastIndex > 0) - ? '${L10n.of(context).read.toUpperCase()} ${_pageState.lastIndex + 1}' - : L10n.of(context).read.toUpperCase(), - style: const TextStyle(fontSize: 15, height: 1.2), - ), minSize: 24, padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 6), borderRadius: BorderRadius.circular(20), @@ -252,7 +246,13 @@ class ReadButton extends StatelessWidget { onPressed: _pageState.enableRead ? () => _toViewPage(_pageState.galleryProvider?.gid ?? '0', _pageState.lastIndex) - : null), + : null, + child: Text( + (_pageState.lastIndex > 0) + ? '${L10n.of(context).read.toUpperCase()} ${_pageState.lastIndex + 1}' + : L10n.of(context).read.toUpperCase(), + style: const TextStyle(fontSize: 15, height: 1.2), + )), ), ); } @@ -706,33 +706,31 @@ class TextBtn extends StatelessWidget { CupertinoThemeData(primaryColor: color ?? CupertinoColors.systemGrey), child: GestureDetector( // behavior: HitTestBehavior.opaque, - child: Container( - // padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Container( - padding: iconPadding, - child: MouseRegionClick( - disable: onTap == null && onLongPress == null, - child: CupertinoButton( - padding: const EdgeInsets.only(bottom: 8.0), - child: Icon( - iconData, - size: iconSize ?? 28, - // color: CupertinoColors.systemGrey3, - ), - onPressed: onTap, + onLongPress: onLongPress, + // behavior: HitTestBehavior.opaque, + child: Column( + children: [ + Container( + padding: iconPadding, + child: MouseRegionClick( + disable: onTap == null && onLongPress == null, + child: CupertinoButton( + padding: const EdgeInsets.only(bottom: 8.0), + onPressed: onTap, + child: Icon( + iconData, + size: iconSize ?? 28, + // color: CupertinoColors.systemGrey3, ), ), ), - Text( - title ?? '', - style: const TextStyle(fontSize: 12, height: 1), - ), - ], - ), + ), + Text( + title ?? '', + style: const TextStyle(fontSize: 12, height: 1), + ), + ], ), - onLongPress: onLongPress, ), ); } diff --git a/lib/pages/login/view/login_cookie.dart b/lib/pages/login/view/login_cookie.dart index f05987e2c..86c0a5f75 100644 --- a/lib/pages/login/view/login_cookie.dart +++ b/lib/pages/login/view/login_cookie.dart @@ -74,13 +74,13 @@ class LoginCookie extends GetView { child: GetBuilder( builder: (logic) { return CupertinoButton( - child: logic.loadingLogin - ? const CupertinoActivityIndicator() - : Text(L10n.of(context).login), color: CupertinoColors.activeBlue, onPressed: logic.loadingLogin ? null : logic.pressLoginCookie, + child: logic.loadingLogin + ? const CupertinoActivityIndicator() + : Text(L10n.of(context).login), ); }, ), @@ -88,6 +88,7 @@ class LoginCookie extends GetView { CupertinoButton( minSize: 50, padding: const EdgeInsets.all(20), + onPressed: controller.readCookieFromClipboard, child: Column( children: [ const Icon( @@ -98,7 +99,6 @@ class LoginCookie extends GetView { textScaleFactor: 0.8), ], ), - onPressed: controller.readCookieFromClipboard, ), ], ), diff --git a/lib/pages/setting/block/block_rule_edit_page.dart b/lib/pages/setting/block/block_rule_edit_page.dart index ae6913c35..e4a716221 100644 --- a/lib/pages/setting/block/block_rule_edit_page.dart +++ b/lib/pages/setting/block/block_rule_edit_page.dart @@ -34,10 +34,6 @@ class BlockRuleEditPage extends GetView { trailing: CupertinoButton( padding: const EdgeInsets.all(0), minSize: 40, - child: const Icon( - CupertinoIcons.check_mark_circled, - size: 28, - ), onPressed: controller.isRegexFormatError ? null : () async { @@ -48,6 +44,10 @@ class BlockRuleEditPage extends GetView { result: _blockRule, ); }, + child: const Icon( + CupertinoIcons.check_mark_circled, + size: 28, + ), ), ), child: CustomScrollView(slivers: [ diff --git a/lib/pages/setting/image_block/phash_list_page.dart b/lib/pages/setting/image_block/phash_list_page.dart index 80e13c7a7..4ac435d0b 100644 --- a/lib/pages/setting/image_block/phash_list_page.dart +++ b/lib/pages/setting/image_block/phash_list_page.dart @@ -68,11 +68,11 @@ class ImageHideItem extends StatelessWidget { Padding( padding: const EdgeInsets.only(right: 12), child: ClipRRect( - child: Container( + borderRadius: BorderRadius.circular(8.0), + child: SizedBox( width: 50, child: EhNetworkImage(imageUrl: imageHide.imageUrl ?? ''), ), - borderRadius: BorderRadius.circular(8.0), ), ), Text( @@ -82,13 +82,14 @@ class ImageHideItem extends StatelessWidget { ), ), CupertinoButton( + // 清除按钮 + onPressed: onDelete, // 清除按钮 child: const Icon( CupertinoIcons.xmark_circle, color: CupertinoColors.systemRed, size: 26, ), - onPressed: onDelete, ), ], ), diff --git a/lib/pages/setting/log_page.dart b/lib/pages/setting/log_page.dart index a366a67a9..d08b8b442 100644 --- a/lib/pages/setting/log_page.dart +++ b/lib/pages/setting/log_page.dart @@ -19,11 +19,11 @@ class LogPage extends GetView { // 清除按钮 padding: const EdgeInsets.all(0), minSize: 40, + onPressed: controller.removeAll, child: const Icon( CupertinoIcons.trash, size: 24, ), - onPressed: controller.removeAll, ), ), child: CustomScrollView(slivers: [ diff --git a/lib/pages/setting/mysql/mysql_login.dart b/lib/pages/setting/mysql/mysql_login.dart index 1b43d7dd3..1ca2edbae 100644 --- a/lib/pages/setting/mysql/mysql_login.dart +++ b/lib/pages/setting/mysql/mysql_login.dart @@ -137,9 +137,6 @@ class _MysqlLoginState extends State { const BorderRadius.all(Radius.circular(30.0)), padding: const EdgeInsets.symmetric( horizontal: 30, vertical: 10), - child: _loadingLogin - ? const CupertinoActivityIndicator() - : Text(L10n.of(context).login), color: CupertinoColors.activeBlue, onPressed: _loadingLogin ? null @@ -191,6 +188,9 @@ class _MysqlLoginState extends State { }); } }, + child: _loadingLogin + ? const CupertinoActivityIndicator() + : Text(L10n.of(context).login), ), ], ), diff --git a/lib/pages/setting/tag_translat_page.dart b/lib/pages/setting/tag_translat_page.dart index f01f5ab95..656ae6fd5 100644 --- a/lib/pages/setting/tag_translat_page.dart +++ b/lib/pages/setting/tag_translat_page.dart @@ -75,8 +75,8 @@ class ListViewTagTranslate extends StatelessWidget { children: [ CupertinoButton( padding: const EdgeInsets.all(0), - child: const Icon(CupertinoIcons.refresh), onPressed: _forceUpdateTranslate, + child: const Icon(CupertinoIcons.refresh), ), CupertinoSwitch( value: _ehSettingService.isTagTranslate, diff --git a/lib/pages/setting/webdav/login_webdav.dart b/lib/pages/setting/webdav/login_webdav.dart index 61da7a44d..b8834aecb 100644 --- a/lib/pages/setting/webdav/login_webdav.dart +++ b/lib/pages/setting/webdav/login_webdav.dart @@ -114,14 +114,14 @@ class LoginWebDAV extends GetView { const BorderRadius.all(Radius.circular(30.0)), padding: const EdgeInsets.symmetric( horizontal: 30, vertical: 10), - child: controller.testingConnect - ? const CupertinoActivityIndicator() - : Text('Test'), color: CupertinoColors.activeOrange, onPressed: () async { // final rult = await controller.pressLoginWebDAV(); await controller.testWebDav(); }, + child: controller.testingConnect + ? const CupertinoActivityIndicator() + : Text('Test'), ); }), CupertinoButton( @@ -130,9 +130,6 @@ class LoginWebDAV extends GetView { const BorderRadius.all(Radius.circular(30.0)), padding: const EdgeInsets.symmetric( horizontal: 30, vertical: 10), - child: controller.loadingLogin - ? const CupertinoActivityIndicator() - : Text(L10n.of(context).login), color: CupertinoColors.activeBlue, onPressed: controller.loadingLogin ? null @@ -143,6 +140,9 @@ class LoginWebDAV extends GetView { Get.back(id: isLayoutLarge ? 2 : null); } }, + child: controller.loadingLogin + ? const CupertinoActivityIndicator() + : Text(L10n.of(context).login), ), ], ), diff --git a/lib/pages/tab/view/download_page.dart b/lib/pages/tab/view/download_page.dart index bafaafef5..f672698c6 100644 --- a/lib/pages/tab/view/download_page.dart +++ b/lib/pages/tab/view/download_page.dart @@ -83,11 +83,11 @@ class _DownloadTabState extends State { CupertinoButton( minSize: 40, padding: const EdgeInsets.all(0), + onPressed: _showExportDialog, child: const Icon( CupertinoIcons.arrow_up_arrow_down_square_fill, size: 28, ), - onPressed: _showExportDialog, ), ], ) diff --git a/lib/pages/tab/view/quick_search_page.dart b/lib/pages/tab/view/quick_search_page.dart index bbe4db2a3..f06ff3ed2 100644 --- a/lib/pages/tab/view/quick_search_page.dart +++ b/lib/pages/tab/view/quick_search_page.dart @@ -46,21 +46,21 @@ class QuickSearchListPage extends StatelessWidget { CupertinoButton( minSize: 40, padding: const EdgeInsets.all(0), + onPressed: _showFile, child: const Icon( FontAwesomeIcons.solidFileLines, size: 20, ), - onPressed: _showFile, ), if (Get.find().syncQuickSearch) CupertinoButton( minSize: 40, padding: const EdgeInsets.all(0), + onPressed: quickSearchController.syncQuickSearch, child: const Icon( FontAwesomeIcons.arrowsRotate, size: 20, ), - onPressed: quickSearchController.syncQuickSearch, ), ], ), diff --git a/lib/pages/tab/view/quick_search_page_o.dart b/lib/pages/tab/view/quick_search_page_o.dart index 67a1ff2ee..eb2616818 100644 --- a/lib/pages/tab/view/quick_search_page_o.dart +++ b/lib/pages/tab/view/quick_search_page_o.dart @@ -116,21 +116,21 @@ class QuickSearchListPage extends StatelessWidget { CupertinoButton( minSize: 40, padding: const EdgeInsets.all(0), + onPressed: _showFile, child: const Icon( FontAwesomeIcons.solidFileLines, size: 20, ), - onPressed: _showFile, ), if (Get.find().syncQuickSearch) CupertinoButton( minSize: 40, padding: const EdgeInsets.all(0), + onPressed: quickSearchController.syncQuickSearch, child: const Icon( FontAwesomeIcons.arrowsRotate, size: 20, ), - onPressed: quickSearchController.syncQuickSearch, ), ], ), diff --git a/lib/pages/tab/view/search_image_page.dart b/lib/pages/tab/view/search_image_page.dart index 1d2341254..851aad8d6 100644 --- a/lib/pages/tab/view/search_image_page.dart +++ b/lib/pages/tab/view/search_image_page.dart @@ -178,7 +178,7 @@ class ImagePersistentHeaderDelegate extends SliverPersistentHeaderDelegate { final paddingTop = context.mediaQueryPadding.top; return Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( border: _kDefaultNavBarBorder, ), padding: EdgeInsets.only(top: paddingTop), @@ -221,7 +221,7 @@ class ImagePersistentHeaderDelegate extends SliverPersistentHeaderDelegate { ), ), Container( - constraints: BoxConstraints(maxHeight: 80), + constraints: const BoxConstraints(maxHeight: 80), child: CupertinoButton( padding: const EdgeInsets.all(0.0), child: Container( diff --git a/lib/pages/tab/view/toplist_page.dart b/lib/pages/tab/view/toplist_page.dart index 2c7884702..408c90458 100644 --- a/lib/pages/tab/view/toplist_page.dart +++ b/lib/pages/tab/view/toplist_page.dart @@ -98,10 +98,10 @@ class _ToplistTabState extends State { CupertinoButton( padding: const EdgeInsets.all(0.0), minSize: 40, - child: Stack( + child: const Stack( alignment: Alignment.centerRight, // mainAxisSize: MainAxisSize.min, - children: const [ + children: [ Icon( CupertinoIcons.sort_down, size: 28,