settings: option to disable viewer overlay blur effect
This commit is contained in:
parent
cb8f90a5d6
commit
fabb2904f9
9 changed files with 85 additions and 43 deletions
|
@ -587,6 +587,8 @@
|
||||||
"@settingsViewerShowInformationSubtitle": {},
|
"@settingsViewerShowInformationSubtitle": {},
|
||||||
"settingsViewerShowShootingDetails": "Show shooting details",
|
"settingsViewerShowShootingDetails": "Show shooting details",
|
||||||
"@settingsViewerShowShootingDetails": {},
|
"@settingsViewerShowShootingDetails": {},
|
||||||
|
"settingsViewerEnableOverlayBlurEffect": "Overlay blur effect",
|
||||||
|
"@settingsViewerEnableOverlayBlurEffect": {},
|
||||||
|
|
||||||
"settingsViewerQuickActionsTile": "Quick actions",
|
"settingsViewerQuickActionsTile": "Quick actions",
|
||||||
"@settingsViewerQuickActionsTile": {},
|
"@settingsViewerQuickActionsTile": {},
|
||||||
|
|
|
@ -274,6 +274,7 @@
|
||||||
"settingsViewerShowInformation": "상세 정보 표시",
|
"settingsViewerShowInformation": "상세 정보 표시",
|
||||||
"settingsViewerShowInformationSubtitle": "제목, 날짜, 장소 등 표시",
|
"settingsViewerShowInformationSubtitle": "제목, 날짜, 장소 등 표시",
|
||||||
"settingsViewerShowShootingDetails": "촬영 정보 표시",
|
"settingsViewerShowShootingDetails": "촬영 정보 표시",
|
||||||
|
"settingsViewerEnableOverlayBlurEffect": "오버레이 흐림 효과",
|
||||||
|
|
||||||
"settingsViewerQuickActionsTile": "빠른 작업",
|
"settingsViewerQuickActionsTile": "빠른 작업",
|
||||||
"settingsViewerQuickActionEditorTitle": "빠른 작업",
|
"settingsViewerQuickActionEditorTitle": "빠른 작업",
|
||||||
|
|
|
@ -61,13 +61,14 @@ class Settings extends ChangeNotifier {
|
||||||
static const hiddenFiltersKey = 'hidden_filters';
|
static const hiddenFiltersKey = 'hidden_filters';
|
||||||
|
|
||||||
// viewer
|
// viewer
|
||||||
|
static const viewerQuickActionsKey = 'viewer_quick_actions';
|
||||||
static const showOverlayMinimapKey = 'show_overlay_minimap';
|
static const showOverlayMinimapKey = 'show_overlay_minimap';
|
||||||
static const showOverlayInfoKey = 'show_overlay_info';
|
static const showOverlayInfoKey = 'show_overlay_info';
|
||||||
static const showOverlayShootingDetailsKey = 'show_overlay_shooting_details';
|
static const showOverlayShootingDetailsKey = 'show_overlay_shooting_details';
|
||||||
static const viewerQuickActionsKey = 'viewer_quick_actions';
|
static const enableOverlayBlurEffectKey = 'enable_overlay_blur_effect';
|
||||||
static const videoQuickActionsKey = 'video_quick_actions';
|
|
||||||
|
|
||||||
// video
|
// video
|
||||||
|
static const videoQuickActionsKey = 'video_quick_actions';
|
||||||
static const enableVideoHardwareAccelerationKey = 'video_hwaccel_mediacodec';
|
static const enableVideoHardwareAccelerationKey = 'video_hwaccel_mediacodec';
|
||||||
static const enableVideoAutoPlayKey = 'video_auto_play';
|
static const enableVideoAutoPlayKey = 'video_auto_play';
|
||||||
static const videoLoopModeKey = 'video_loop';
|
static const videoLoopModeKey = 'video_loop';
|
||||||
|
@ -240,6 +241,10 @@ class Settings extends ChangeNotifier {
|
||||||
|
|
||||||
// viewer
|
// viewer
|
||||||
|
|
||||||
|
List<EntryAction> get viewerQuickActions => getEnumListOrDefault(viewerQuickActionsKey, viewerQuickActionsDefault, EntryAction.values);
|
||||||
|
|
||||||
|
set viewerQuickActions(List<EntryAction> newValue) => setAndNotify(viewerQuickActionsKey, newValue.map((v) => v.toString()).toList());
|
||||||
|
|
||||||
bool get showOverlayMinimap => getBoolOrDefault(showOverlayMinimapKey, false);
|
bool get showOverlayMinimap => getBoolOrDefault(showOverlayMinimapKey, false);
|
||||||
|
|
||||||
set showOverlayMinimap(bool newValue) => setAndNotify(showOverlayMinimapKey, newValue);
|
set showOverlayMinimap(bool newValue) => setAndNotify(showOverlayMinimapKey, newValue);
|
||||||
|
@ -252,16 +257,16 @@ class Settings extends ChangeNotifier {
|
||||||
|
|
||||||
set showOverlayShootingDetails(bool newValue) => setAndNotify(showOverlayShootingDetailsKey, newValue);
|
set showOverlayShootingDetails(bool newValue) => setAndNotify(showOverlayShootingDetailsKey, newValue);
|
||||||
|
|
||||||
List<EntryAction> get viewerQuickActions => getEnumListOrDefault(viewerQuickActionsKey, viewerQuickActionsDefault, EntryAction.values);
|
bool get enableOverlayBlurEffect => getBoolOrDefault(enableOverlayBlurEffectKey, true);
|
||||||
|
|
||||||
set viewerQuickActions(List<EntryAction> newValue) => setAndNotify(viewerQuickActionsKey, newValue.map((v) => v.toString()).toList());
|
set enableOverlayBlurEffect(bool newValue) => setAndNotify(enableOverlayBlurEffectKey, newValue);
|
||||||
|
|
||||||
|
// video
|
||||||
|
|
||||||
List<VideoAction> get videoQuickActions => getEnumListOrDefault(videoQuickActionsKey, videoQuickActionsDefault, VideoAction.values);
|
List<VideoAction> get videoQuickActions => getEnumListOrDefault(videoQuickActionsKey, videoQuickActionsDefault, VideoAction.values);
|
||||||
|
|
||||||
set videoQuickActions(List<VideoAction> newValue) => setAndNotify(videoQuickActionsKey, newValue.map((v) => v.toString()).toList());
|
set videoQuickActions(List<VideoAction> newValue) => setAndNotify(videoQuickActionsKey, newValue.map((v) => v.toString()).toList());
|
||||||
|
|
||||||
// video
|
|
||||||
|
|
||||||
bool get enableVideoHardwareAcceleration => getBoolOrDefault(enableVideoHardwareAccelerationKey, true);
|
bool get enableVideoHardwareAcceleration => getBoolOrDefault(enableVideoHardwareAccelerationKey, true);
|
||||||
|
|
||||||
set enableVideoHardwareAcceleration(bool newValue) => setAndNotify(enableVideoHardwareAccelerationKey, newValue);
|
set enableVideoHardwareAcceleration(bool newValue) => setAndNotify(enableVideoHardwareAccelerationKey, newValue);
|
||||||
|
@ -452,6 +457,7 @@ class Settings extends ChangeNotifier {
|
||||||
case showOverlayMinimapKey:
|
case showOverlayMinimapKey:
|
||||||
case showOverlayInfoKey:
|
case showOverlayInfoKey:
|
||||||
case showOverlayShootingDetailsKey:
|
case showOverlayShootingDetailsKey:
|
||||||
|
case enableOverlayBlurEffectKey:
|
||||||
case enableVideoHardwareAccelerationKey:
|
case enableVideoHardwareAccelerationKey:
|
||||||
case enableVideoAutoPlayKey:
|
case enableVideoAutoPlayKey:
|
||||||
case subtitleShowOutlineKey:
|
case subtitleShowOutlineKey:
|
||||||
|
|
|
@ -28,42 +28,50 @@ class BlurredRect extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BlurredRRect extends StatelessWidget {
|
class BlurredRRect extends StatelessWidget {
|
||||||
|
final bool enabled;
|
||||||
final double borderRadius;
|
final double borderRadius;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
const BlurredRRect({
|
const BlurredRRect({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
this.enabled = true,
|
||||||
required this.borderRadius,
|
required this.borderRadius,
|
||||||
required this.child,
|
required this.child,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ClipRRect(
|
return enabled
|
||||||
|
? ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
|
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: _filter,
|
filter: _filter,
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
);
|
)
|
||||||
|
: child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BlurredOval extends StatelessWidget {
|
class BlurredOval extends StatelessWidget {
|
||||||
|
final bool enabled;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
const BlurredOval({
|
const BlurredOval({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
this.enabled = true,
|
||||||
required this.child,
|
required this.child,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ClipOval(
|
return enabled
|
||||||
|
? ClipOval(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: _filter,
|
filter: _filter,
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
);
|
)
|
||||||
|
: child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:aves/widgets/settings/viewer/entry_background.dart';
|
||||||
import 'package:aves/widgets/settings/viewer/viewer_actions_editor.dart';
|
import 'package:aves/widgets/settings/viewer/viewer_actions_editor.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class ViewerSection extends StatelessWidget {
|
class ViewerSection extends StatelessWidget {
|
||||||
final ValueNotifier<String?> expandedNotifier;
|
final ValueNotifier<String?> expandedNotifier;
|
||||||
|
@ -20,11 +21,6 @@ class ViewerSection extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final currentShowOverlayMinimap = context.select<Settings, bool>((s) => s.showOverlayMinimap);
|
|
||||||
final currentShowOverlayInfo = context.select<Settings, bool>((s) => s.showOverlayInfo);
|
|
||||||
final currentShowOverlayShootingDetails = context.select<Settings, bool>((s) => s.showOverlayShootingDetails);
|
|
||||||
final currentImageBackground = context.select<Settings, EntryBackground>((s) => s.imageBackground);
|
|
||||||
|
|
||||||
return AvesExpansionTile(
|
return AvesExpansionTile(
|
||||||
leading: SettingsTileLeading(
|
leading: SettingsTileLeading(
|
||||||
icon: AIcons.image,
|
icon: AIcons.image,
|
||||||
|
@ -35,29 +31,53 @@ class ViewerSection extends StatelessWidget {
|
||||||
showHighlight: false,
|
showHighlight: false,
|
||||||
children: [
|
children: [
|
||||||
const ViewerActionsTile(),
|
const ViewerActionsTile(),
|
||||||
SwitchListTile(
|
Selector<Settings, bool>(
|
||||||
value: currentShowOverlayMinimap,
|
selector: (context, s) => s.showOverlayMinimap,
|
||||||
|
builder: (context, current, child) => SwitchListTile(
|
||||||
|
value: current,
|
||||||
onChanged: (v) => settings.showOverlayMinimap = v,
|
onChanged: (v) => settings.showOverlayMinimap = v,
|
||||||
title: Text(context.l10n.settingsViewerShowMinimap),
|
title: Text(context.l10n.settingsViewerShowMinimap),
|
||||||
),
|
),
|
||||||
SwitchListTile(
|
),
|
||||||
value: currentShowOverlayInfo,
|
Selector<Settings, bool>(
|
||||||
|
selector: (context, s) => s.showOverlayInfo,
|
||||||
|
builder: (context, current, child) => SwitchListTile(
|
||||||
|
value: current,
|
||||||
onChanged: (v) => settings.showOverlayInfo = v,
|
onChanged: (v) => settings.showOverlayInfo = v,
|
||||||
title: Text(context.l10n.settingsViewerShowInformation),
|
title: Text(context.l10n.settingsViewerShowInformation),
|
||||||
subtitle: Text(context.l10n.settingsViewerShowInformationSubtitle),
|
subtitle: Text(context.l10n.settingsViewerShowInformationSubtitle),
|
||||||
),
|
),
|
||||||
SwitchListTile(
|
|
||||||
value: currentShowOverlayShootingDetails,
|
|
||||||
onChanged: currentShowOverlayInfo ? (v) => settings.showOverlayShootingDetails = v : null,
|
|
||||||
title: Text(context.l10n.settingsViewerShowShootingDetails),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
Selector<Settings, Tuple2<bool, bool>>(
|
||||||
|
selector: (context, s) => Tuple2(s.showOverlayInfo, s.showOverlayShootingDetails),
|
||||||
|
builder: (context, s, child) {
|
||||||
|
final showInfo = s.item1;
|
||||||
|
final current = s.item2;
|
||||||
|
return SwitchListTile(
|
||||||
|
value: current,
|
||||||
|
onChanged: showInfo ? (v) => settings.showOverlayShootingDetails = v : null,
|
||||||
|
title: Text(context.l10n.settingsViewerShowShootingDetails),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Selector<Settings, bool>(
|
||||||
|
selector: (context, s) => s.enableOverlayBlurEffect,
|
||||||
|
builder: (context, current, child) => SwitchListTile(
|
||||||
|
value: current,
|
||||||
|
onChanged: (v) => settings.enableOverlayBlurEffect = v,
|
||||||
|
title: Text(context.l10n.settingsViewerEnableOverlayBlurEffect),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Selector<Settings, EntryBackground>(
|
||||||
|
selector: (context, s) => s.imageBackground,
|
||||||
|
builder: (context, current, child) => ListTile(
|
||||||
title: Text(context.l10n.settingsImageBackground),
|
title: Text(context.l10n.settingsImageBackground),
|
||||||
trailing: EntryBackgroundSelector(
|
trailing: EntryBackgroundSelector(
|
||||||
getter: () => currentImageBackground,
|
getter: () => current,
|
||||||
setter: (value) => settings.imageBackground = value,
|
setter: (value) => settings.imageBackground = value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,7 @@ class MapOverlayButton extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlurredOval(
|
return BlurredOval(
|
||||||
|
enabled: settings.enableOverlayBlurEffect,
|
||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.circle,
|
type: MaterialType.circle,
|
||||||
color: kOverlayBackgroundColor,
|
color: kOverlayBackgroundColor,
|
||||||
|
|
|
@ -78,7 +78,7 @@ class _ViewerBottomOverlayState extends State<ViewerBottomOverlay> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final hasEdgeContent = settings.showOverlayInfo || multiPageController != null;
|
final hasEdgeContent = settings.showOverlayInfo || multiPageController != null;
|
||||||
return BlurredRect(
|
return BlurredRect(
|
||||||
enabled: hasEdgeContent,
|
enabled: hasEdgeContent && settings.enableOverlayBlurEffect,
|
||||||
child: Selector<MediaQueryData, Tuple3<double, EdgeInsets, EdgeInsets>>(
|
child: Selector<MediaQueryData, Tuple3<double, EdgeInsets, EdgeInsets>>(
|
||||||
selector: (c, mq) => Tuple3(mq.size.width, mq.viewInsets, mq.viewPadding),
|
selector: (c, mq) => Tuple3(mq.size.width, mq.viewInsets, mq.viewPadding),
|
||||||
builder: (c, mq, child) {
|
builder: (c, mq, child) {
|
||||||
|
|
|
@ -117,6 +117,7 @@ class _VideoControlOverlayState extends State<VideoControlOverlay> with SingleTi
|
||||||
return SizeTransition(
|
return SizeTransition(
|
||||||
sizeFactor: scale,
|
sizeFactor: scale,
|
||||||
child: BlurredRRect(
|
child: BlurredRRect(
|
||||||
|
enabled: settings.enableOverlayBlurEffect,
|
||||||
borderRadius: progressBarBorderRadius,
|
borderRadius: progressBarBorderRadius,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTapDown: (details) {
|
onTapDown: (details) {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:aves/model/settings/settings.dart';
|
||||||
import 'package:aves/widgets/common/fx/blurred.dart';
|
import 'package:aves/widgets/common/fx/blurred.dart';
|
||||||
import 'package:aves/widgets/common/fx/borders.dart';
|
import 'package:aves/widgets/common/fx/borders.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -19,6 +20,7 @@ class OverlayButton extends StatelessWidget {
|
||||||
return ScaleTransition(
|
return ScaleTransition(
|
||||||
scale: scale,
|
scale: scale,
|
||||||
child: BlurredOval(
|
child: BlurredOval(
|
||||||
|
enabled: settings.enableOverlayBlurEffect,
|
||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.circle,
|
type: MaterialType.circle,
|
||||||
color: kOverlayBackgroundColor,
|
color: kOverlayBackgroundColor,
|
||||||
|
@ -58,6 +60,7 @@ class OverlayTextButton extends StatelessWidget {
|
||||||
return SizeTransition(
|
return SizeTransition(
|
||||||
sizeFactor: scale,
|
sizeFactor: scale,
|
||||||
child: BlurredRRect(
|
child: BlurredRRect(
|
||||||
|
enabled: settings.enableOverlayBlurEffect,
|
||||||
borderRadius: _borderRadius,
|
borderRadius: _borderRadius,
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
|
|
Loading…
Reference in a new issue