fixes for font scale
This commit is contained in:
parent
07e13bc8ac
commit
cc95416efc
7 changed files with 85 additions and 63 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]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- improved support for system font scale
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- permission confusion when removable volume changes
|
- permission confusion when removable volume changes
|
||||||
|
|
|
@ -16,10 +16,10 @@ class PopupMenuItemContainer<T> extends PopupMenuEntry<T> {
|
||||||
bool represents(void value) => false;
|
bool represents(void value) => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PopupMenuItemContainer> createState() => _TransitionPopupMenuItemState();
|
State<PopupMenuItemContainer> createState() => _PopupMenuItemContainerState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TransitionPopupMenuItemState extends State<PopupMenuItemContainer> {
|
class _PopupMenuItemContainerState extends State<PopupMenuItemContainer> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return TooltipTheme(
|
return TooltipTheme(
|
||||||
|
|
|
@ -168,7 +168,6 @@ class _LocationInfo extends StatelessWidget {
|
||||||
final ValueNotifier<LatLng?> locationNotifier;
|
final ValueNotifier<LatLng?> locationNotifier;
|
||||||
|
|
||||||
static const double iconPadding = 8.0;
|
static const double iconPadding = 8.0;
|
||||||
static const double iconSize = 16.0;
|
|
||||||
static const double _interRowPadding = 2.0;
|
static const double _interRowPadding = 2.0;
|
||||||
|
|
||||||
const _LocationInfo({
|
const _LocationInfo({
|
||||||
|
@ -217,6 +216,8 @@ class _LocationInfo extends StatelessWidget {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static double getIconSize(BuildContext context) => 16.0 * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AddressRow extends StatefulWidget {
|
class _AddressRow extends StatefulWidget {
|
||||||
|
@ -253,7 +254,7 @@ class _AddressRowState extends State<_AddressRow> {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(width: _LocationInfo.iconPadding),
|
const SizedBox(width: _LocationInfo.iconPadding),
|
||||||
const Icon(AIcons.location, size: _LocationInfo.iconSize),
|
Icon(AIcons.location, size: _LocationInfo.getIconSize(context)),
|
||||||
const SizedBox(width: _LocationInfo.iconPadding),
|
const SizedBox(width: _LocationInfo.iconPadding),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -312,11 +313,16 @@ class _CoordinateRow extends StatelessWidget {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(width: _LocationInfo.iconPadding),
|
const SizedBox(width: _LocationInfo.iconPadding),
|
||||||
const Icon(AIcons.geoBounds, size: _LocationInfo.iconSize),
|
Icon(AIcons.geoBounds, size: _LocationInfo.getIconSize(context)),
|
||||||
const SizedBox(width: _LocationInfo.iconPadding),
|
const SizedBox(width: _LocationInfo.iconPadding),
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
location != null ? settings.coordinateFormat.format(context.l10n, location!) : Constants.overlayUnknown,
|
location != null ? settings.coordinateFormat.format(context.l10n, location!) : Constants.overlayUnknown,
|
||||||
strutStyle: Constants.overflowStrutStyle,
|
strutStyle: Constants.overflowStrutStyle,
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -176,9 +176,14 @@ class _DateRow extends StatelessWidget {
|
||||||
const SizedBox(width: MapInfoRow.iconPadding),
|
const SizedBox(width: MapInfoRow.iconPadding),
|
||||||
Icon(AIcons.date, size: MapInfoRow.getIconSize(context)),
|
Icon(AIcons.date, size: MapInfoRow.getIconSize(context)),
|
||||||
const SizedBox(width: MapInfoRow.iconPadding),
|
const SizedBox(width: MapInfoRow.iconPadding),
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
dateText,
|
dateText,
|
||||||
strutStyle: Constants.overflowStrutStyle,
|
strutStyle: Constants.overflowStrutStyle,
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -31,6 +31,7 @@ class OverlayRatingTagsRow extends AnimatedWidget {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final textScaleFactor = MediaQuery.textScaleFactorOf(context);
|
||||||
final tags = entry.tags.toList()..sort(compareAsciiUpperCaseNatural);
|
final tags = entry.tags.toList()..sort(compareAsciiUpperCaseNatural);
|
||||||
final hasTags = tags.isNotEmpty;
|
final hasTags = tags.isNotEmpty;
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ class OverlayRatingTagsRow extends AnimatedWidget {
|
||||||
padding: const EdgeInsetsDirectional.only(end: ViewerDetailOverlayContent.iconPadding),
|
padding: const EdgeInsetsDirectional.only(end: ViewerDetailOverlayContent.iconPadding),
|
||||||
child: DecoratedIcon(
|
child: DecoratedIcon(
|
||||||
AIcons.tag,
|
AIcons.tag,
|
||||||
size: ViewerDetailOverlayContent.iconSize,
|
size: ViewerDetailOverlayContent.iconSize / textScaleFactor,
|
||||||
shadows: ViewerDetailOverlayContent.shadows(context),
|
shadows: ViewerDetailOverlayContent.shadows(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -73,6 +73,10 @@ class _VideoProgressBarState extends State<VideoProgressBar> {
|
||||||
border: AvesBorder.border(context),
|
border: AvesBorder.border(context),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(radius)),
|
borderRadius: const BorderRadius.all(Radius.circular(radius)),
|
||||||
),
|
),
|
||||||
|
child: MediaQuery(
|
||||||
|
data: MediaQuery.of(context).copyWith(
|
||||||
|
textScaleFactor: 1,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
key: _progressBarKey,
|
key: _progressBarKey,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -131,6 +135,7 @@ class _VideoProgressBarState extends State<VideoProgressBar> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,6 +286,7 @@ class ViewerButtonRowContent extends StatelessWidget {
|
||||||
onCanceled: () {
|
onCanceled: () {
|
||||||
_popupExpandedNotifier.value = null;
|
_popupExpandedNotifier.value = null;
|
||||||
},
|
},
|
||||||
|
iconSize: IconTheme.of(context).size,
|
||||||
onMenuOpened: () {
|
onMenuOpened: () {
|
||||||
// if the menu is opened while overlay is hiding,
|
// if the menu is opened while overlay is hiding,
|
||||||
// the popup menu button is disposed and menu items are ineffective,
|
// the popup menu button is disposed and menu items are ineffective,
|
||||||
|
|
Loading…
Reference in a new issue