improved tooltip positions

This commit is contained in:
Thibault Deckers 2020-05-14 15:26:36 +09:00
parent e7086481a4
commit c131e179ee
5 changed files with 80 additions and 61 deletions

View file

@ -29,6 +29,9 @@ class AvesApp extends StatelessWidget {
brightness: Brightness.dark, brightness: Brightness.dark,
accentColor: Colors.indigoAccent, accentColor: Colors.indigoAccent,
scaffoldBackgroundColor: Colors.grey[900], scaffoldBackgroundColor: Colors.grey[900],
tooltipTheme: const TooltipThemeData(
verticalOffset: 32,
),
appBarTheme: const AppBarTheme( appBarTheme: const AppBarTheme(
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6: TextStyle(

View file

@ -187,7 +187,11 @@ class SectionSelectableLeading extends StatelessWidget {
builder: (context, child) { builder: (context, child) {
final sectionEntries = collection.sections[sectionKey]; final sectionEntries = collection.sections[sectionKey];
final selected = collection.isSelected(sectionEntries); final selected = collection.isSelected(sectionEntries);
final child = IconButton( final child = TooltipTheme(
data: TooltipTheme.of(context).copyWith(
preferBelow: false,
),
child: IconButton(
key: ValueKey(selected), key: ValueKey(selected),
iconSize: 26, iconSize: 26,
padding: const EdgeInsets.only(top: 1), padding: const EdgeInsets.only(top: 1),
@ -205,6 +209,7 @@ class SectionSelectableLeading extends StatelessWidget {
minHeight: leadingDimension, minHeight: leadingDimension,
minWidth: leadingDimension, minWidth: leadingDimension,
), ),
),
); );
return AnimatedSwitcher( return AnimatedSwitcher(
duration: Duration(milliseconds: (200 * timeDilation).toInt()), duration: Duration(milliseconds: (200 * timeDilation).toInt()),

View file

@ -105,6 +105,7 @@ class _AvesFilterChipState extends State<AvesFilterChip> {
decoration: widget.decoration, decoration: widget.decoration,
child: Tooltip( child: Tooltip(
message: filter.tooltip, message: filter.tooltip,
preferBelow: false,
child: FutureBuilder( child: FutureBuilder(
future: _colorFuture, future: _colorFuture,
builder: (context, AsyncSnapshot<Color> snapshot) { builder: (context, AsyncSnapshot<Color> snapshot) {

View file

@ -207,7 +207,11 @@ class ImageMapState extends State<ImageMap> with AutomaticKeepAliveClientMixin {
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Column(children: [ TooltipTheme(
data: TooltipTheme.of(context).copyWith(
preferBelow: false,
),
child: Column(children: [
IconButton( IconButton(
icon: const Icon(AIcons.zoomIn), icon: const Icon(AIcons.zoomIn),
onPressed: _controller == null ? null : () => _zoomBy(1), onPressed: _controller == null ? null : () => _zoomBy(1),
@ -223,7 +227,8 @@ class ImageMapState extends State<ImageMap> with AutomaticKeepAliveClientMixin {
onPressed: () => AndroidAppService.openMap(widget.geoUri), onPressed: () => AndroidAppService.openMap(widget.geoUri),
tooltip: 'Show on map...', tooltip: 'Show on map...',
), ),
]) ]),
)
], ],
); );
} }

View file

@ -115,7 +115,11 @@ class VideoControlOverlayState extends State<VideoControlOverlay> with SingleTic
builder: (context, snapshot) { builder: (context, snapshot) {
// do not use stream snapshot because it is obsolete when switching between videos // do not use stream snapshot because it is obsolete when switching between videos
final status = controller.ijkStatus; final status = controller.ijkStatus;
return Row( return TooltipTheme(
data: TooltipTheme.of(context).copyWith(
preferBelow: false,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: status == IjkStatus.error children: status == IjkStatus.error
? [ ? [
@ -145,6 +149,7 @@ class VideoControlOverlayState extends State<VideoControlOverlay> with SingleTic
), ),
), ),
], ],
),
); );
}), }),
), ),