fixes for font scale
This commit is contained in:
parent
96005031c7
commit
c6230df01d
18 changed files with 125 additions and 88 deletions
|
@ -23,6 +23,7 @@ import 'package:aves/widgets/common/action_controls/togglers/favourite.dart';
|
||||||
import 'package:aves/widgets/common/action_controls/togglers/title_search.dart';
|
import 'package:aves/widgets/common/action_controls/togglers/title_search.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/app_bar_subtitle.dart';
|
import 'package:aves/widgets/common/app_bar/app_bar_subtitle.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/container.dart';
|
import 'package:aves/widgets/common/basic/popup/container.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/expansion_panel.dart';
|
import 'package:aves/widgets/common/basic/popup/expansion_panel.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
|
@ -220,7 +221,8 @@ class _CollectionAppBarState extends State<CollectionAppBar> with SingleTickerPr
|
||||||
}
|
}
|
||||||
|
|
||||||
double get appBarContentHeight {
|
double get appBarContentHeight {
|
||||||
double height = kToolbarHeight;
|
final textScaleFactor = context.read<MediaQueryData>().textScaleFactor;
|
||||||
|
double height = kToolbarHeight * textScaleFactor;
|
||||||
if (settings.useTvLayout) {
|
if (settings.useTvLayout) {
|
||||||
height += CaptionedButton.getTelevisionButtonHeight(context);
|
height += CaptionedButton.getTelevisionButtonHeight(context);
|
||||||
}
|
}
|
||||||
|
@ -228,7 +230,7 @@ class _CollectionAppBarState extends State<CollectionAppBar> with SingleTickerPr
|
||||||
height += FilterBar.preferredHeight;
|
height += FilterBar.preferredHeight;
|
||||||
}
|
}
|
||||||
if (context.read<Query>().enabled) {
|
if (context.read<Query>().enabled) {
|
||||||
height += EntryQueryBar.preferredHeight;
|
height += EntryQueryBar.getPreferredHeight(textScaleFactor);
|
||||||
}
|
}
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
@ -375,12 +377,14 @@ class _CollectionAppBarState extends State<CollectionAppBar> with SingleTickerPr
|
||||||
final browsingQuickActions = settings.collectionBrowsingQuickActions;
|
final browsingQuickActions = settings.collectionBrowsingQuickActions;
|
||||||
final selectionQuickActions = isTrash ? [EntrySetAction.delete, EntrySetAction.restore] : settings.collectionSelectionQuickActions;
|
final selectionQuickActions = isTrash ? [EntrySetAction.delete, EntrySetAction.restore] : settings.collectionSelectionQuickActions;
|
||||||
final quickActionButtons = (isSelecting ? selectionQuickActions : browsingQuickActions).where(isVisible).map(
|
final quickActionButtons = (isSelecting ? selectionQuickActions : browsingQuickActions).where(isVisible).map(
|
||||||
(action) => _buildButtonIcon(context, action, enabled: canApply(action), selection: selection),
|
(action) => FontSizeIconTheme(
|
||||||
|
child: _buildButtonIcon(context, action, enabled: canApply(action), selection: selection),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
...quickActionButtons,
|
...quickActionButtons,
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<EntrySetAction>(
|
child: PopupMenuButton<EntrySetAction>(
|
||||||
// key is expected by test driver
|
// key is expected by test driver
|
||||||
key: const Key('appbar-menu-button'),
|
key: const Key('appbar-menu-button'),
|
||||||
|
|
|
@ -10,8 +10,6 @@ class EntryQueryBar extends StatefulWidget {
|
||||||
final ValueNotifier<String> queryNotifier;
|
final ValueNotifier<String> queryNotifier;
|
||||||
final FocusNode focusNode;
|
final FocusNode focusNode;
|
||||||
|
|
||||||
static const preferredHeight = kToolbarHeight;
|
|
||||||
|
|
||||||
const EntryQueryBar({
|
const EntryQueryBar({
|
||||||
super.key,
|
super.key,
|
||||||
required this.queryNotifier,
|
required this.queryNotifier,
|
||||||
|
@ -20,6 +18,8 @@ class EntryQueryBar extends StatefulWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<EntryQueryBar> createState() => _EntryQueryBarState();
|
State<EntryQueryBar> createState() => _EntryQueryBarState();
|
||||||
|
|
||||||
|
static double getPreferredHeight(double textScaleFactor) => QueryBar.getPreferredHeight(textScaleFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _EntryQueryBarState extends State<EntryQueryBar> {
|
class _EntryQueryBarState extends State<EntryQueryBar> {
|
||||||
|
@ -52,8 +52,9 @@ class _EntryQueryBarState extends State<EntryQueryBar> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final textScaleFactor = context.select<MediaQueryData, double>((mq) => mq.textScaleFactor);
|
||||||
return Container(
|
return Container(
|
||||||
height: EntryQueryBar.preferredHeight,
|
height: EntryQueryBar.getPreferredHeight(textScaleFactor),
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: Selector<Selection<AvesEntry>, bool>(
|
child: Selector<Selection<AvesEntry>, bool>(
|
||||||
selector: (context, selection) => !selection.isSelecting,
|
selector: (context, selection) => !selection.isSelecting,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class InteractiveAppBarTitle extends StatelessWidget {
|
class InteractiveAppBarTitle extends StatelessWidget {
|
||||||
final GestureTapCallback? onTap;
|
final GestureTapCallback? onTap;
|
||||||
|
@ -19,7 +20,7 @@ class InteractiveAppBarTitle extends StatelessWidget {
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: AlignmentDirectional.centerStart,
|
alignment: AlignmentDirectional.centerStart,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
height: kToolbarHeight,
|
height: kToolbarHeight * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor),
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
22
lib/widgets/common/basic/font_size_icon_theme.dart
Normal file
22
lib/widgets/common/basic/font_size_icon_theme.dart
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
// scale icons according to text scale
|
||||||
|
class FontSizeIconTheme extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
const FontSizeIconTheme({
|
||||||
|
super.key,
|
||||||
|
required this.child,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final iconTheme = IconTheme.of(context);
|
||||||
|
return IconTheme(
|
||||||
|
data: iconTheme.copyWith(
|
||||||
|
size: iconTheme.size! * MediaQuery.textScaleFactorOf(context),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,24 +32,3 @@ class MenuRow extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// scale icons according to text scale
|
|
||||||
class MenuIconTheme extends StatelessWidget {
|
|
||||||
final Widget child;
|
|
||||||
|
|
||||||
const MenuIconTheme({
|
|
||||||
super.key,
|
|
||||||
required this.child,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final iconTheme = IconTheme.of(context);
|
|
||||||
return IconTheme(
|
|
||||||
data: iconTheme.copyWith(
|
|
||||||
size: iconTheme.size! * MediaQuery.textScaleFactorOf(context),
|
|
||||||
),
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:aves/theme/durations.dart';
|
import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/utils/debouncer.dart';
|
import 'package:aves/utils/debouncer.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -24,6 +25,8 @@ class QueryBar extends StatefulWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<QueryBar> createState() => _QueryBarState();
|
State<QueryBar> createState() => _QueryBarState();
|
||||||
|
|
||||||
|
static double getPreferredHeight(double textScaleFactor) => kToolbarHeight * textScaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _QueryBarState extends State<QueryBar> {
|
class _QueryBarState extends State<QueryBar> {
|
||||||
|
@ -53,45 +56,50 @@ class _QueryBarState extends State<QueryBar> {
|
||||||
|
|
||||||
return DefaultTextStyle(
|
return DefaultTextStyle(
|
||||||
style: Theme.of(context).textTheme.bodyMedium!,
|
style: Theme.of(context).textTheme.bodyMedium!,
|
||||||
child: Row(
|
child: FontSizeIconTheme(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Row(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Expanded(
|
children: [
|
||||||
child: TextField(
|
Expanded(
|
||||||
controller: _controller,
|
child: TextField(
|
||||||
focusNode: widget.focusNode,
|
controller: _controller,
|
||||||
decoration: InputDecoration(
|
focusNode: widget.focusNode,
|
||||||
icon: Padding(
|
decoration: InputDecoration(
|
||||||
padding: widget.leadingPadding ?? const EdgeInsetsDirectional.only(start: 16),
|
icon: Padding(
|
||||||
child: Icon(widget.icon ?? AIcons.filter),
|
padding: widget.leadingPadding ?? const EdgeInsetsDirectional.only(start: 16),
|
||||||
),
|
// set theme at this level because `InputDecoration` defines its own `IconTheme` with a fixed size
|
||||||
hintText: widget.hintText ?? MaterialLocalizations.of(context).searchFieldLabel,
|
child: FontSizeIconTheme(
|
||||||
hintStyle: Theme.of(context).inputDecorationTheme.hintStyle,
|
child: Icon(widget.icon ?? AIcons.filter),
|
||||||
),
|
),
|
||||||
textInputAction: TextInputAction.search,
|
|
||||||
onChanged: (s) => _debouncer(() => queryNotifier.value = s.trim()),
|
|
||||||
enabled: widget.editable,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(minWidth: 16),
|
|
||||||
child: ValueListenableBuilder<TextEditingValue>(
|
|
||||||
valueListenable: _controller,
|
|
||||||
builder: (context, value, child) => AnimatedSwitcher(
|
|
||||||
duration: Durations.appBarActionChangeAnimation,
|
|
||||||
transitionBuilder: (child, animation) => FadeTransition(
|
|
||||||
opacity: animation,
|
|
||||||
child: SizeTransition(
|
|
||||||
axis: Axis.horizontal,
|
|
||||||
sizeFactor: animation,
|
|
||||||
child: child,
|
|
||||||
),
|
),
|
||||||
|
hintText: widget.hintText ?? MaterialLocalizations.of(context).searchFieldLabel,
|
||||||
|
hintStyle: Theme.of(context).inputDecorationTheme.hintStyle,
|
||||||
),
|
),
|
||||||
child: value.text.isNotEmpty ? clearButton : const SizedBox(),
|
textInputAction: TextInputAction.search,
|
||||||
|
onChanged: (s) => _debouncer(() => queryNotifier.value = s.trim()),
|
||||||
|
enabled: widget.editable,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
ConstrainedBox(
|
||||||
],
|
constraints: const BoxConstraints(minWidth: 16),
|
||||||
|
child: ValueListenableBuilder<TextEditingValue>(
|
||||||
|
valueListenable: _controller,
|
||||||
|
builder: (context, value, child) => AnimatedSwitcher(
|
||||||
|
duration: Durations.appBarActionChangeAnimation,
|
||||||
|
transitionBuilder: (child, animation) => FadeTransition(
|
||||||
|
opacity: animation,
|
||||||
|
child: SizeTransition(
|
||||||
|
axis: Axis.horizontal,
|
||||||
|
sizeFactor: animation,
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: value.text.isNotEmpty ? clearButton : const SizedBox(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class AvesAppBar extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: kToolbarHeight,
|
height: kToolbarHeight * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
leading != null
|
leading != null
|
||||||
|
|
|
@ -14,6 +14,7 @@ import 'package:aves/theme/colors.dart';
|
||||||
import 'package:aves/theme/durations.dart';
|
import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/collection/filter_bar.dart';
|
import 'package:aves/widgets/collection/filter_bar.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
||||||
|
@ -127,7 +128,7 @@ class AvesFilterChip extends StatefulWidget {
|
||||||
}
|
}
|
||||||
return PopupMenuItem(
|
return PopupMenuItem(
|
||||||
value: action,
|
value: action,
|
||||||
child: MenuIconTheme(
|
child: FontSizeIconTheme(
|
||||||
child: MenuRow(text: text, icon: action.getIcon()),
|
child: MenuRow(text: text, icon: action.getIcon()),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,6 +8,7 @@ import 'package:aves/model/source/collection_source.dart';
|
||||||
import 'package:aves/services/analysis_service.dart';
|
import 'package:aves/services/analysis_service.dart';
|
||||||
import 'package:aves/theme/durations.dart';
|
import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/utils/android_file_utils.dart';
|
import 'package:aves/utils/android_file_utils.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||||
import 'package:aves/widgets/common/behaviour/pop/scope.dart';
|
import 'package:aves/widgets/common/behaviour/pop/scope.dart';
|
||||||
|
@ -49,7 +50,7 @@ class _AppDebugPageState extends State<AppDebugPage> {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Debug'),
|
title: const Text('Debug'),
|
||||||
actions: [
|
actions: [
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<AppDebugAction>(
|
child: PopupMenuButton<AppDebugAction>(
|
||||||
// key is expected by test driver
|
// key is expected by test driver
|
||||||
key: const Key('appbar-menu-button'),
|
key: const Key('appbar-menu-button'),
|
||||||
|
|
|
@ -7,6 +7,7 @@ import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/utils/constants.dart';
|
import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/widgets/collection/collection_grid.dart';
|
import 'package:aves/widgets/collection/collection_grid.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
|
@ -81,7 +82,7 @@ class _RenameEntrySetPageState extends State<RenameEntrySetPage> {
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<String>(
|
child: PopupMenuButton<String>(
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -13,7 +13,7 @@ import 'package:aves/model/vaults/details.dart';
|
||||||
import 'package:aves/model/vaults/vaults.dart';
|
import 'package:aves/model/vaults/vaults.dart';
|
||||||
import 'package:aves/theme/durations.dart';
|
import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/aves_filter_chip.dart';
|
import 'package:aves/widgets/common/identity/aves_filter_chip.dart';
|
||||||
import 'package:aves/widgets/common/identity/buttons/captioned_button.dart';
|
import 'package:aves/widgets/common/identity/buttons/captioned_button.dart';
|
||||||
|
@ -209,12 +209,16 @@ class _AlbumPickPageState extends State<_AlbumPickPage> {
|
||||||
}) {
|
}) {
|
||||||
return [
|
return [
|
||||||
if (widget.moveType != null)
|
if (widget.moveType != null)
|
||||||
..._quickActions.where(isVisible).map((action) => IconButton(
|
..._quickActions.where(isVisible).map(
|
||||||
icon: action.getIcon(),
|
(action) => FontSizeIconTheme(
|
||||||
onPressed: () => onActionSelected(action),
|
child: IconButton(
|
||||||
tooltip: action.getText(context),
|
icon: action.getIcon(),
|
||||||
)),
|
onPressed: () => onActionSelected(action),
|
||||||
MenuIconTheme(
|
tooltip: action.getText(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<ChipSetAction>(
|
child: PopupMenuButton<ChipSetAction>(
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
return _menuActions.where((v) => v == null || isVisible(v)).map((action) {
|
return _menuActions.where((v) => v == null || isVisible(v)).map((action) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/widgets/common/action_controls/togglers/title_search.dart';
|
import 'package:aves/widgets/common/action_controls/togglers/title_search.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/app_bar_subtitle.dart';
|
import 'package:aves/widgets/common/app_bar/app_bar_subtitle.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/aves_app_bar.dart';
|
import 'package:aves/widgets/common/identity/aves_app_bar.dart';
|
||||||
|
@ -171,12 +172,13 @@ class _FilterGridAppBarState<T extends CollectionFilter, CSAD extends ChipSetAct
|
||||||
}
|
}
|
||||||
|
|
||||||
double get appBarContentHeight {
|
double get appBarContentHeight {
|
||||||
double height = kToolbarHeight;
|
final textScaleFactor = context.read<MediaQueryData>().textScaleFactor;
|
||||||
|
double height = kToolbarHeight * textScaleFactor;
|
||||||
if (settings.useTvLayout) {
|
if (settings.useTvLayout) {
|
||||||
height += CaptionedButton.getTelevisionButtonHeight(context);
|
height += CaptionedButton.getTelevisionButtonHeight(context);
|
||||||
}
|
}
|
||||||
if (context.read<Query>().enabled) {
|
if (context.read<Query>().enabled) {
|
||||||
height += FilterQueryBar.preferredHeight;
|
height += FilterQueryBar.getPreferredHeight(textScaleFactor);
|
||||||
}
|
}
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +228,12 @@ class _FilterGridAppBarState<T extends CollectionFilter, CSAD extends ChipSetAct
|
||||||
return InteractiveAppBarTitle(
|
return InteractiveAppBarTitle(
|
||||||
onTap: appMode.canNavigate ? _goToSearch : null,
|
onTap: appMode.canNavigate ? _goToSearch : null,
|
||||||
child: SourceStateAwareAppBarTitle(
|
child: SourceStateAwareAppBarTitle(
|
||||||
title: Text(widget.title),
|
title: Text(
|
||||||
|
widget.title,
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
source: source,
|
source: source,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -313,12 +320,14 @@ class _FilterGridAppBarState<T extends CollectionFilter, CSAD extends ChipSetAct
|
||||||
final isSelecting = selection.isSelecting;
|
final isSelecting = selection.isSelecting;
|
||||||
|
|
||||||
final quickActionButtons = (isSelecting ? selectionQuickActions : browsingQuickActions).where(isVisible).map(
|
final quickActionButtons = (isSelecting ? selectionQuickActions : browsingQuickActions).where(isVisible).map(
|
||||||
(action) => _buildButtonIcon(context, actionDelegate, action, enabled: canApply(action)),
|
(action) => FontSizeIconTheme(
|
||||||
|
child: _buildButtonIcon(context, actionDelegate, action, enabled: canApply(action)),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
...quickActionButtons,
|
...quickActionButtons,
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<ChipSetAction>(
|
child: PopupMenuButton<ChipSetAction>(
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
final generalMenuItems = ChipSetActions.general.where(isVisible).map(
|
final generalMenuItems = ChipSetActions.general.where(isVisible).map(
|
||||||
|
|
|
@ -9,8 +9,6 @@ class FilterQueryBar<T extends CollectionFilter> extends StatelessWidget {
|
||||||
final ValueNotifier<String> queryNotifier;
|
final ValueNotifier<String> queryNotifier;
|
||||||
final FocusNode focusNode;
|
final FocusNode focusNode;
|
||||||
|
|
||||||
static const preferredHeight = kToolbarHeight;
|
|
||||||
|
|
||||||
const FilterQueryBar({
|
const FilterQueryBar({
|
||||||
super.key,
|
super.key,
|
||||||
required this.queryNotifier,
|
required this.queryNotifier,
|
||||||
|
@ -19,8 +17,9 @@ class FilterQueryBar<T extends CollectionFilter> extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final textScaleFactor = context.select<MediaQueryData, double>((mq) => mq.textScaleFactor);
|
||||||
return Container(
|
return Container(
|
||||||
height: FilterQueryBar.preferredHeight,
|
height: getPreferredHeight(textScaleFactor),
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: Selector<Selection<FilterGridItem<T>>, bool>(
|
child: Selector<Selection<FilterGridItem<T>>, bool>(
|
||||||
selector: (context, selection) => !selection.isSelecting,
|
selector: (context, selection) => !selection.isSelecting,
|
||||||
|
@ -33,4 +32,6 @@ class FilterQueryBar<T extends CollectionFilter> extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static double getPreferredHeight(double textScaleFactor) => QueryBar.getPreferredHeight(textScaleFactor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/utils/debouncer.dart';
|
import 'package:aves/utils/debouncer.dart';
|
||||||
import 'package:aves/widgets/collection/collection_page.dart';
|
import 'package:aves/widgets/collection/collection_page.dart';
|
||||||
import 'package:aves/widgets/collection/entry_set_action_delegate.dart';
|
import 'package:aves/widgets/collection/entry_set_action_delegate.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/insets.dart';
|
import 'package:aves/widgets/common/basic/insets.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||||
|
@ -567,7 +568,7 @@ class _ContentState extends State<_Content> with SingleTickerProviderStateMixin
|
||||||
PopupMenuItem<MapClusterAction> _buildMenuItem(MapClusterAction action) {
|
PopupMenuItem<MapClusterAction> _buildMenuItem(MapClusterAction action) {
|
||||||
return PopupMenuItem(
|
return PopupMenuItem(
|
||||||
value: action,
|
value: action,
|
||||||
child: MenuIconTheme(
|
child: FontSizeIconTheme(
|
||||||
child: MenuRow(
|
child: MenuRow(
|
||||||
text: action.getText(context),
|
text: action.getText(context),
|
||||||
icon: action.getIcon(),
|
icon: action.getIcon(),
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/utils/android_file_utils.dart';
|
import 'package:aves/utils/android_file_utils.dart';
|
||||||
import 'package:aves/utils/constants.dart';
|
import 'package:aves/utils/constants.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
|
@ -69,7 +70,7 @@ class _FilePickerPageState extends State<FilePickerPage> {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(_getTitle(context)),
|
title: Text(_getTitle(context)),
|
||||||
actions: [
|
actions: [
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<_PickerAction>(
|
child: PopupMenuButton<_PickerAction>(
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -11,6 +11,7 @@ import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/insets.dart';
|
import 'package:aves/widgets/common/basic/insets.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||||
|
@ -127,7 +128,7 @@ class _SettingsPageState extends State<SettingsPage> with FeedbackMixin {
|
||||||
onPressed: () => _goToSearch(context),
|
onPressed: () => _goToSearch(context),
|
||||||
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
|
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
|
||||||
),
|
),
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<SettingsAction>(
|
child: PopupMenuButton<SettingsAction>(
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
import 'package:aves/widgets/common/app_bar/app_bar_title.dart';
|
||||||
import 'package:aves/widgets/common/app_bar/sliver_app_bar_title.dart';
|
import 'package:aves/widgets/common/app_bar/sliver_app_bar_title.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_row.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/viewer/action/entry_info_action_delegate.dart';
|
import 'package:aves/widgets/viewer/action/entry_info_action_delegate.dart';
|
||||||
|
@ -72,7 +73,7 @@ class InfoAppBar extends StatelessWidget {
|
||||||
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
|
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
|
||||||
),
|
),
|
||||||
if (entry.canEdit)
|
if (entry.canEdit)
|
||||||
MenuIconTheme(
|
FontSizeIconTheme(
|
||||||
child: PopupMenuButton<EntryAction>(
|
child: PopupMenuButton<EntryAction>(
|
||||||
itemBuilder: (context) => [
|
itemBuilder: (context) => [
|
||||||
...commonActions.map((action) => _toMenuItem(context, action, enabled: actionDelegate.canApply(entry, action))),
|
...commonActions.map((action) => _toMenuItem(context, action, enabled: actionDelegate.canApply(entry, action))),
|
||||||
|
|
|
@ -16,6 +16,7 @@ import 'package:aves/widgets/common/action_controls/quick_choosers/tag_button.da
|
||||||
import 'package:aves/widgets/common/action_controls/togglers/favourite.dart';
|
import 'package:aves/widgets/common/action_controls/togglers/favourite.dart';
|
||||||
import 'package:aves/widgets/common/action_controls/togglers/mute.dart';
|
import 'package:aves/widgets/common/action_controls/togglers/mute.dart';
|
||||||
import 'package:aves/widgets/common/action_controls/togglers/play.dart';
|
import 'package:aves/widgets/common/action_controls/togglers/play.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/font_size_icon_theme.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/container.dart';
|
import 'package:aves/widgets/common/basic/popup/container.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/expansion_panel.dart';
|
import 'package:aves/widgets/common/basic/popup/expansion_panel.dart';
|
||||||
import 'package:aves/widgets/common/basic/popup/menu_button.dart';
|
import 'package:aves/widgets/common/basic/popup/menu_button.dart';
|
||||||
|
@ -240,7 +241,7 @@ class ViewerButtonRowContent extends StatelessWidget {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: padding / 2),
|
padding: const EdgeInsets.symmetric(horizontal: padding / 2),
|
||||||
child: OverlayButton(
|
child: OverlayButton(
|
||||||
scale: scale,
|
scale: scale,
|
||||||
child: MenuIconTheme(
|
child: FontSizeIconTheme(
|
||||||
child: AvesPopupMenuButton<EntryAction>(
|
child: AvesPopupMenuButton<EntryAction>(
|
||||||
key: const Key('entry-menu-button'),
|
key: const Key('entry-menu-button'),
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
|
|
Loading…
Reference in a new issue