Skip to content

Commit b0f8030

Browse files
committed
Remove pointing finger mouse cursors
See also: - flutter/flutter#88371 - flutter/flutter#59576 Ref: canonical#1532
1 parent 2bd54ce commit b0f8030

2 files changed

Lines changed: 49 additions & 2 deletions

File tree

‎packages/ubuntu_desktop_installer/lib/installer.dart‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import 'pages.dart';
2222
import 'routes.dart';
2323
import 'services.dart';
2424
import 'slides.dart';
25+
import 'theme.dart';
2526

2627
export 'package:ubuntu_wizard/widgets.dart' show FlavorData;
2728
export 'slides.dart';
@@ -212,6 +213,8 @@ class _UbuntuDesktopInstallerAppState extends State<UbuntuDesktopInstallerApp> {
212213
],
213214
),
214215
builder: (context, yaru, child) {
216+
final theme = widget.flavor.theme ?? yaru.theme;
217+
final darkTheme = widget.flavor.darkTheme ?? yaru.darkTheme;
215218
return MaterialApp(
216219
locale: InheritedLocale.of(context),
217220
onGenerateTitle: (context) {
@@ -220,8 +223,8 @@ class _UbuntuDesktopInstallerAppState extends State<UbuntuDesktopInstallerApp> {
220223
window.setTitle(lang.windowTitle(widget.flavor.name));
221224
return lang.appTitle;
222225
},
223-
theme: widget.flavor.theme ?? yaru.theme,
224-
darkTheme: widget.flavor.darkTheme ?? yaru.darkTheme,
226+
theme: theme?.customize(),
227+
darkTheme: darkTheme?.customize(),
225228
debugShowCheckedModeBanner: false,
226229
localizationsDelegates: <LocalizationsDelegate>[
227230
...localizationsDelegates,
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:yaru_widgets/yaru_widgets.dart';
3+
4+
extension ThemeDataX on ThemeData {
5+
ThemeData customize() {
6+
final mouseCursor = MaterialStateProperty.all(SystemMouseCursors.basic);
7+
return copyWith(
8+
elevatedButtonTheme: ElevatedButtonThemeData(
9+
style: elevatedButtonTheme.style!.copyWith(mouseCursor: mouseCursor),
10+
),
11+
filledButtonTheme: FilledButtonThemeData(
12+
style: filledButtonTheme.style!.copyWith(mouseCursor: mouseCursor),
13+
),
14+
floatingActionButtonTheme:
15+
floatingActionButtonTheme.copyWith(mouseCursor: mouseCursor),
16+
iconButtonTheme: IconButtonThemeData(
17+
style: iconButtonTheme.style!.copyWith(mouseCursor: mouseCursor),
18+
),
19+
listTileTheme: listTileTheme.copyWith(mouseCursor: mouseCursor),
20+
menuButtonTheme: MenuButtonThemeData(
21+
style: MenuItemButton.styleFrom(
22+
enabledMouseCursor: SystemMouseCursors.basic,
23+
disabledMouseCursor: SystemMouseCursors.basic,
24+
),
25+
),
26+
outlinedButtonTheme: OutlinedButtonThemeData(
27+
style: outlinedButtonTheme.style!.copyWith(mouseCursor: mouseCursor),
28+
),
29+
popupMenuTheme: popupMenuTheme.copyWith(mouseCursor: mouseCursor),
30+
sliderTheme: sliderTheme.copyWith(mouseCursor: mouseCursor),
31+
textButtonTheme: TextButtonThemeData(
32+
style: textButtonTheme.style!.copyWith(mouseCursor: mouseCursor),
33+
),
34+
extensions: [
35+
...extensions.values,
36+
YaruCheckboxThemeData(mouseCursor: mouseCursor),
37+
YaruPageIndicatorThemeData(mouseCursor: mouseCursor),
38+
YaruRadioThemeData(mouseCursor: mouseCursor),
39+
YaruSwitchThemeData(mouseCursor: mouseCursor),
40+
YaruToggleButtonThemeData(mouseCursor: mouseCursor),
41+
],
42+
);
43+
}
44+
}

0 commit comments

Comments
 (0)