Esc steps out one level: chat, fullscreen, big player to mini, then ask to leave
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
24fc137e4f
commit
9ddd85de90
4 files changed
+24
-4
No files matched your search
@@ -22,7 +22,7 @@ const sessionShortcuts = [
|
||||
('< or Shift+P', 'Put up the previous Jellyfin episode'),
|
||||
('Ctrl+1…6', 'Shaders: Anime4K mode A, B, C, A+A, B+B, C+A'),
|
||||
('Ctrl+0', 'Shaders off'),
|
||||
('Esc', 'Close the panel or fullscreen, else ask to leave'),
|
||||
('Esc', 'Close the panel or fullscreen, shrink the player, then ask to leave'),
|
||||
];
|
||||
|
||||
/// One titled card of the Settings tab (rounded Material, so list tiles
|
||||
|
||||
@@ -164,8 +164,15 @@ class _SessionPlayerState extends State<SessionPlayer> {
|
||||
/// dialog, a card, a text field) is in front of it. Space and Tab are
|
||||
/// app-wide ([AppKeys]).
|
||||
bool _globalKey(KeyEvent event) {
|
||||
if (event is! KeyDownEvent || !mounted || !_full) return false;
|
||||
if (event is! KeyDownEvent || !mounted) return false;
|
||||
if (SessionState.instance.route.peek() != AppRoute.session) return false;
|
||||
// Mini: Esc is the last step out, asking to leave the server.
|
||||
if (!_full) {
|
||||
if (event.logicalKey != LogicalKeyboardKey.escape) return false;
|
||||
if (ModalRoute.of(context)?.isCurrent == false || textInputFocused()) return false;
|
||||
widget.onLeave();
|
||||
return true;
|
||||
}
|
||||
final route = ModalRoute.of(context);
|
||||
if (route != null && !route.isCurrent) {
|
||||
// A menu of ours is open: Esc closes it.
|
||||
@@ -240,7 +247,8 @@ class _SessionPlayerState extends State<SessionPlayer> {
|
||||
} else if (widget.fullscreen) {
|
||||
widget.onToggleFullscreen();
|
||||
} else {
|
||||
widget.onLeave();
|
||||
// One step at a time: big player → mini, then (from mini) leave.
|
||||
widget.onCollapse();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user