various minor fixes

This commit is contained in:
Thibault Deckers 2020-11-30 14:14:39 +09:00
parent 3ef5cde4da
commit 93af6b0d1b
3 changed files with 35 additions and 21 deletions

View file

@ -4,14 +4,17 @@ class XMP {
// cf https://exiftool.org/TagNames/XMP.html // cf https://exiftool.org/TagNames/XMP.html
static const Map<String, String> namespaces = { static const Map<String, String> namespaces = {
'adsml-at': 'AdsML',
'aux': 'Exif Aux', 'aux': 'Exif Aux',
'Camera': 'Camera', 'Camera': 'Camera',
'crs': 'Camera Raw Settings', 'crs': 'Camera Raw Settings',
'dc': 'Dublin Core', 'dc': 'Dublin Core',
'drone-dji': 'DJI Drone',
'exif': 'Exif', 'exif': 'Exif',
'exifEX': 'Exif Ex', 'exifEX': 'Exif Ex',
'GettyImagesGIFT': 'Getty Images', 'GettyImagesGIFT': 'Getty Images',
'GIMP': 'GIMP', 'GIMP': 'GIMP',
'GPano': 'Google Photo Sphere',
'illustrator': 'Illustrator', 'illustrator': 'Illustrator',
'Iptc4xmpCore': 'IPTC Core', 'Iptc4xmpCore': 'IPTC Core',
'lr': 'Lightroom', 'lr': 'Lightroom',
@ -19,6 +22,7 @@ class XMP {
'panorama': 'Panorama', 'panorama': 'Panorama',
'pdf': 'PDF', 'pdf': 'PDF',
'pdfx': 'PDF/X', 'pdfx': 'PDF/X',
'PanoStudioXMP': 'PanoramaStudio',
'photomechanic': 'Photo Mechanic', 'photomechanic': 'Photo Mechanic',
'photoshop': 'Photoshop', 'photoshop': 'Photoshop',
'plus': 'PLUS', 'plus': 'PLUS',

View file

@ -3,46 +3,55 @@ import 'package:aves/widgets/common/fx/highlight_decoration.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HighlightTitle extends StatelessWidget { class HighlightTitle extends StatelessWidget {
final String name; final String title;
final Color color; final Color color;
final double fontSize; final double fontSize;
final bool enabled; final bool enabled, selectable;
const HighlightTitle( const HighlightTitle(
this.name, { this.title, {
this.color, this.color,
this.fontSize = 20, this.fontSize = 20,
this.enabled = true, this.enabled = true,
}) : assert(name != null); this.selectable = false,
}) : assert(title != null);
static const disabledColor = Colors.grey; static const disabledColor = Colors.grey;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final style = TextStyle(
shadows: [
Shadow(
color: Colors.black,
offset: Offset(1, 1),
blurRadius: 2,
)
],
fontSize: fontSize,
fontFamily: 'Concourse Caps',
);
return Align( return Align(
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
child: Container( child: Container(
decoration: HighlightDecoration( decoration: HighlightDecoration(
color: enabled ? color ?? stringToColor(name) : disabledColor, color: enabled ? color ?? stringToColor(title) : disabledColor,
), ),
margin: EdgeInsets.symmetric(vertical: 4.0), margin: EdgeInsets.symmetric(vertical: 4.0),
child: Text( child: selectable
name, ? SelectableText(
style: TextStyle( title,
shadows: [ style: style,
Shadow( maxLines: 1,
color: Colors.black,
offset: Offset(1, 1),
blurRadius: 2,
) )
], : Text(
fontSize: fontSize, title,
fontFamily: 'Concourse Caps', style: style,
), softWrap: false,
softWrap: false, overflow: TextOverflow.fade,
overflow: TextOverflow.fade, maxLines: 1,
maxLines: 1, ),
),
), ),
); );
} }

View file

@ -65,6 +65,7 @@ class XmpDirTile extends StatelessWidget {
child: HighlightTitle( child: HighlightTitle(
title, title,
color: BrandColors.get(title), color: BrandColors.get(title),
selectable: true,
), ),
), ),
InfoRowGroup(Map.fromEntries(entries), maxValueLength: Constants.infoGroupMaxValueLength), InfoRowGroup(Map.fromEntries(entries), maxValueLength: Constants.infoGroupMaxValueLength),