viewer: keep controls in the lower right corner even with RTL locales
This commit is contained in:
parent
b17bfd196d
commit
1984e601b0
4 changed files with 79 additions and 70 deletions
|
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## <a id="unreleased"></a>[Unreleased]
|
## <a id="unreleased"></a>[Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Viewer: keep controls in the lower right corner even with RTL locales
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- crash when loading SVG defined with large dimensions
|
- crash when loading SVG defined with large dimensions
|
||||||
|
|
|
@ -186,41 +186,45 @@ class _BottomOverlayContentState extends State<_BottomOverlayContent> {
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
final viewInsetsPadding = (widget.viewInsets ?? EdgeInsets.zero) + (widget.viewPadding ?? EdgeInsets.zero);
|
final viewInsetsPadding = (widget.viewInsets ?? EdgeInsets.zero) + (widget.viewPadding ?? EdgeInsets.zero);
|
||||||
final selection = context.read<Selection<AvesEntry>?>();
|
final selection = context.read<Selection<AvesEntry>?>();
|
||||||
final viewerButtonRow = (selection?.isSelecting ?? false)
|
final viewerButtonRow = Directionality(
|
||||||
? SelectionButton(
|
// always keep action buttons in the lower right corner, even with RTL locales
|
||||||
mainEntry: mainEntry,
|
textDirection: TextDirection.ltr,
|
||||||
scale: _buttonScale,
|
child: (selection?.isSelecting ?? false)
|
||||||
)
|
? SelectionButton(
|
||||||
: FocusableActionDetector(
|
mainEntry: mainEntry,
|
||||||
focusNode: _buttonRowFocusScopeNode,
|
scale: _buttonScale,
|
||||||
shortcuts: settings.useTvLayout
|
)
|
||||||
? const {
|
: FocusableActionDetector(
|
||||||
SingleActivator(LogicalKeyboardKey.arrowUp): TvShowLessInfoIntent(),
|
focusNode: _buttonRowFocusScopeNode,
|
||||||
}
|
shortcuts: settings.useTvLayout
|
||||||
: null,
|
? const {
|
||||||
actions: {
|
SingleActivator(LogicalKeyboardKey.arrowUp): TvShowLessInfoIntent(),
|
||||||
TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context)),
|
}
|
||||||
},
|
: null,
|
||||||
child: SafeArea(
|
actions: {
|
||||||
top: false,
|
TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context)),
|
||||||
bottom: false,
|
},
|
||||||
minimum: EdgeInsets.only(
|
child: SafeArea(
|
||||||
left: viewInsetsPadding.left,
|
top: false,
|
||||||
right: viewInsetsPadding.right,
|
bottom: false,
|
||||||
|
minimum: EdgeInsets.only(
|
||||||
|
left: viewInsetsPadding.left,
|
||||||
|
right: viewInsetsPadding.right,
|
||||||
|
),
|
||||||
|
child: isWallpaperMode
|
||||||
|
? WallpaperButtons(
|
||||||
|
entry: pageEntry,
|
||||||
|
scale: _buttonScale,
|
||||||
|
)
|
||||||
|
: ViewerButtons(
|
||||||
|
mainEntry: mainEntry,
|
||||||
|
pageEntry: pageEntry,
|
||||||
|
collection: widget.collection,
|
||||||
|
scale: _buttonScale,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: isWallpaperMode
|
|
||||||
? WallpaperButtons(
|
|
||||||
entry: pageEntry,
|
|
||||||
scale: _buttonScale,
|
|
||||||
)
|
|
||||||
: ViewerButtons(
|
|
||||||
mainEntry: mainEntry,
|
|
||||||
pageEntry: pageEntry,
|
|
||||||
collection: widget.collection,
|
|
||||||
scale: _buttonScale,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final showMultiPageOverlay = mainEntry.isMultiPage && multiPageController != null;
|
final showMultiPageOverlay = mainEntry.isMultiPage && multiPageController != null;
|
||||||
final collapsedPageScroller = mainEntry.isMotionPhoto;
|
final collapsedPageScroller = mainEntry.isMotionPhoto;
|
||||||
|
@ -247,6 +251,8 @@ class _BottomOverlayContentState extends State<_BottomOverlayContent> {
|
||||||
(showMultiPageOverlay && collapsedPageScroller)
|
(showMultiPageOverlay && collapsedPageScroller)
|
||||||
? Row(
|
? Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
// always keep action buttons in the lower right corner, even with RTL locales
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
children: [
|
children: [
|
||||||
SafeArea(
|
SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
|
|
|
@ -40,44 +40,48 @@ class _VideoControlOverlayState extends State<VideoControlOverlay> with SingleTi
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return StreamBuilder<VideoStatus>(
|
return Directionality(
|
||||||
stream: statusStream,
|
// always keep action buttons in the lower right corner, even with RTL locales
|
||||||
builder: (context, snapshot) {
|
textDirection: TextDirection.ltr,
|
||||||
// do not use stream snapshot because it is obsolete when switching between videos
|
child: StreamBuilder<VideoStatus>(
|
||||||
final status = controller?.status ?? VideoStatus.idle;
|
stream: statusStream,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
// do not use stream snapshot because it is obsolete when switching between videos
|
||||||
|
final status = controller?.status ?? VideoStatus.idle;
|
||||||
|
|
||||||
if (status == VideoStatus.error) {
|
if (status == VideoStatus.error) {
|
||||||
const action = EntryAction.openVideo;
|
const action = EntryAction.openVideo;
|
||||||
return Align(
|
return Align(
|
||||||
alignment: AlignmentDirectional.centerEnd,
|
alignment: AlignmentDirectional.centerEnd,
|
||||||
child: OverlayButton(
|
child: OverlayButton(
|
||||||
scale: scale,
|
scale: scale,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: action.getIcon(),
|
icon: action.getIcon(),
|
||||||
onPressed: entry.trashed ? null : () => widget.onActionSelected(action),
|
onPressed: entry.trashed ? null : () => widget.onActionSelected(action),
|
||||||
tooltip: action.getText(context),
|
tooltip: action.getText(context),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: VideoProgressBar(
|
child: VideoProgressBar(
|
||||||
|
controller: controller,
|
||||||
|
scale: scale,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
VideoControlRow(
|
||||||
|
entry: entry,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
scale: scale,
|
scale: scale,
|
||||||
|
onActionSelected: widget.onActionSelected,
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
VideoControlRow(
|
);
|
||||||
entry: entry,
|
},
|
||||||
controller: controller,
|
),
|
||||||
scale: scale,
|
|
||||||
onActionSelected: widget.onActionSelected,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6457,11 +6457,6 @@
|
||||||
"filePickerUseThisFolder"
|
"filePickerUseThisFolder"
|
||||||
],
|
],
|
||||||
|
|
||||||
"pt": [
|
|
||||||
"entryActionCast",
|
|
||||||
"castDialogTitle"
|
|
||||||
],
|
|
||||||
|
|
||||||
"ro": [
|
"ro": [
|
||||||
"saveCopyButtonLabel",
|
"saveCopyButtonLabel",
|
||||||
"applyTooltip",
|
"applyTooltip",
|
||||||
|
|
Loading…
Reference in a new issue