Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YaruBanner.mouseCursor #649

Merged
merged 1 commit into from
Mar 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/src/widgets/yaru_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class YaruBanner extends StatelessWidget {
this.padding = const EdgeInsets.all(kYaruPagePadding),
this.onHover,
this.selected,
this.mouseCursor,
});

/// Creates a banner with a [YaruTile] child widget.
Expand All @@ -32,6 +33,7 @@ class YaruBanner extends StatelessWidget {
Widget? subtitle,
EdgeInsetsGeometry padding = const EdgeInsets.all(kYaruPagePadding),
bool? selected,
MouseCursor? mouseCursor,
}) : this(
key: key,
onTap: onTap,
Expand All @@ -41,6 +43,7 @@ class YaruBanner extends StatelessWidget {
elevation: elevation,
surfaceTintColor: surfaceTintColor,
selected: selected,
mouseCursor: mouseCursor,
child: YaruTile(
leading: icon,
title: title,
Expand Down Expand Up @@ -77,6 +80,9 @@ class YaruBanner extends StatelessWidget {
/// theme's primary color.
final bool? selected;

/// The cursor for a mouse pointer when it enters or is hovering over the widget.
final MouseCursor? mouseCursor;

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
Expand All @@ -96,6 +102,7 @@ class YaruBanner extends StatelessWidget {
onHover: onHover,
borderRadius: borderRadius,
hoverColor: theme.colorScheme.onSurface.withOpacity(0.1),
mouseCursor: mouseCursor,
child: Card(
color: color,
shadowColor: Colors.transparent,
Expand Down