From bfa9b3e347f7502671c495dec8e4d86f85c70e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=B0=E9=98=9F=E7=9A=84=E5=81=B6=E5=83=8F-=E5=B2=9B?= =?UTF-8?q?=E9=A3=8E=E9=85=B1!?= Date: Wed, 14 Feb 2024 17:46:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Alt=20+=20=E2=86=90=20?= =?UTF-8?q?=E5=90=8E=E9=80=80=E7=9A=84=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/fluent/page/hello/fluent_hello_page.dart | 31 ++++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/fluent/page/hello/fluent_hello_page.dart b/lib/fluent/page/hello/fluent_hello_page.dart index 7a9a5f0ce..6c81523c1 100644 --- a/lib/fluent/page/hello/fluent_hello_page.dart +++ b/lib/fluent/page/hello/fluent_hello_page.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:fluent_ui/fluent_ui.dart'; import 'package:flutter/gestures.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:pixez/fluent/component/pixiv_image.dart'; import 'package:pixez/fluent/component/search_box.dart'; @@ -192,16 +193,28 @@ class FluentHelloPageState extends State with WindowListener { @override Widget build(BuildContext context) { - return Listener( - child: NavigationView( - appBar: _buildAppBar(context), - pane: _buildPane(context), - paneBodyBuilder: (item, widget) => _nav, + return RawKeyboardListener( + focusNode: FocusNode(), + autofocus: true, + child: Listener( + child: NavigationView( + appBar: _buildAppBar(context), + pane: _buildPane(context), + paneBodyBuilder: (item, widget) => _nav, + ), + onPointerDown: (event) { + if (event.buttons == kBackMouseButton && + event.kind == PointerDeviceKind.mouse) { + _navobs.navigator?.maybePop(null); + } + }, ), - onPointerDown: (event) { - if (event.buttons == kBackMouseButton && - event.kind == PointerDeviceKind.mouse) { - _navobs.navigator?.maybePop(null); + onKey: (value) { + if (value is RawKeyUpEvent) { + if (value.isAltPressed && + value.logicalKey == LogicalKeyboardKey.arrowLeft) { + _navobs.navigator?.maybePop(null); + } } }, ); From 9802ce41fe9ca7ce4f311a01c1c635dcd930ebb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=B0=E9=98=9F=E7=9A=84=E5=81=B6=E5=83=8F-=E5=B2=9B?= =?UTF-8?q?=E9=A3=8E=E9=85=B1!?= Date: Fri, 16 Feb 2024 09:31:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=99=E4=B8=8A=E4=B8=8B=E6=96=87?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=8A=A0=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/fluent/component/illust_card.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/fluent/component/illust_card.dart b/lib/fluent/component/illust_card.dart index 679986a57..d72944dc6 100644 --- a/lib/fluent/component/illust_card.dart +++ b/lib/fluent/component/illust_card.dart @@ -85,18 +85,33 @@ class _IllustCardState extends State { child: _build(context), items: [ MenuFlyoutItem( - text: Text('Like'), + leading: Observer(builder: (context) { + switch (store.state) { + case 0: + return Icon(FluentIcons.heart); + case 1: + return Icon(FluentIcons.heart_fill); + default: + return Icon( + FluentIcons.heart_fill, + color: Colors.red, + ); + } + }), + text: Text(I18n.of(context).bookmark), onPressed: () async { await _onStar(); }, ), MenuFlyoutItem( + leading: Icon(FluentIcons.save), text: Text(I18n.of(context).save), onPressed: () async { await _onSave(); }, ), MenuFlyoutItem( + leading: Icon(FluentIcons.favorite_list), text: Text(I18n.of(context).favorited_tag), onPressed: () async { final result = await showDialog(