feat(map in info): give a smaller icon size for the map's attribution icon button
This commit is contained in:
parent
771e28e91a
commit
5c33442148
3 changed files with 9 additions and 2 deletions
|
@ -87,6 +87,8 @@ class MapAttributionWidget extends StatefulWidget {
|
|||
///
|
||||
/// Read the documentation on the individual properties for more information
|
||||
/// and customizability.
|
||||
|
||||
final double iconSize;
|
||||
const MapAttributionWidget({
|
||||
super.key,
|
||||
required this.attributions,
|
||||
|
@ -99,6 +101,7 @@ class MapAttributionWidget extends StatefulWidget {
|
|||
this.showFlutterMapAttribution = true,
|
||||
this.animationConfig = const FadeRAWA(),
|
||||
this.popupInitialDisplayDuration = Duration.zero,
|
||||
this.iconSize = 20,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -169,7 +172,7 @@ class MapAttributionWidgetState extends State<MapAttributionWidget> {
|
|||
child: popupExpanded
|
||||
? (widget.closeButton ??
|
||||
(context, close) => IconButtonWidget(
|
||||
size: 16,
|
||||
size: widget.iconSize,
|
||||
onTap: close,
|
||||
icon: Icons.cancel_outlined,
|
||||
iconButtonType: IconButtonType.primary,
|
||||
|
@ -179,7 +182,7 @@ class MapAttributionWidgetState extends State<MapAttributionWidget> {
|
|||
)
|
||||
: (widget.openButton ??
|
||||
(context, open) => IconButtonWidget(
|
||||
size: 16,
|
||||
size: widget.iconSize,
|
||||
onTap: open,
|
||||
icon: Icons.info_outlined,
|
||||
iconButtonType: IconButtonType.primary,
|
||||
|
|
|
@ -12,10 +12,12 @@ const String _userAgent = "io.ente.photos";
|
|||
class MapAttributionOptions {
|
||||
final double permanentHeight;
|
||||
final BorderRadius popupBorderRadius;
|
||||
final double iconSize;
|
||||
|
||||
const MapAttributionOptions({
|
||||
this.permanentHeight = 24,
|
||||
this.popupBorderRadius = const BorderRadius.all(Radius.circular(12)),
|
||||
this.iconSize = 20,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -67,6 +69,7 @@ class OSMFranceTileAttributes extends StatelessWidget {
|
|||
permanentHeight: options.permanentHeight,
|
||||
popupBackgroundColor: getEnteColorScheme(context).backgroundElevated2,
|
||||
popupBorderRadius: options.popupBorderRadius,
|
||||
iconSize: options.iconSize,
|
||||
attributions: [
|
||||
TextSourceAttribution(
|
||||
S.of(context).openstreetmapContributors,
|
||||
|
|
|
@ -99,6 +99,7 @@ class _LocationTagsWidgetState extends State<LocationTagsWidget> {
|
|||
mapAttributionOptions: MapAttributionOptions(
|
||||
permanentHeight: 16,
|
||||
popupBorderRadius: BorderRadius.circular(4),
|
||||
iconSize: 16,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
|
|
Loading…
Add table
Reference in a new issue