|
1 | 1 | import 'package:go_router/go_router.dart';
|
2 | 2 | import 'package:fluent_ui/fluent_ui.dart';
|
| 3 | +import 'package:rune/providers/responsive_providers.dart'; |
3 | 4 | import 'package:rune/widgets/navigation_bar/utils/activate_link_action.dart';
|
4 | 5 |
|
5 | 6 | import '../../widgets/ax_pressure.dart';
|
@@ -59,50 +60,56 @@ class _LinkTurntileState extends State<LinkTurntile> {
|
59 | 60 |
|
60 | 61 | final blurRadius = _isFocused ? 10.0 : 0.0;
|
61 | 62 |
|
62 |
| - return AxPressure( |
63 |
| - child: GestureDetector( |
64 |
| - onTap: onPressed, |
65 |
| - child: FocusableActionDetector( |
66 |
| - onShowFocusHighlight: _handleFocusHighlight, |
67 |
| - onShowHoverHighlight: _handleHoverHighlight, |
68 |
| - actions: { |
69 |
| - ActivateIntent: ActivateLinkAction(context, onPressed), |
70 |
| - }, |
71 |
| - child: TweenAnimationBuilder( |
72 |
| - tween: ColorTween( |
73 |
| - begin: color.withAlpha(alpha), |
74 |
| - end: color.withAlpha(alpha), |
75 |
| - ), |
76 |
| - duration: theme.fastAnimationDuration, |
77 |
| - builder: (BuildContext context, Color? color, Widget? child) { |
78 |
| - return TweenAnimationBuilder( |
79 |
| - tween: Tween<double>( |
80 |
| - begin: blurRadius, |
81 |
| - end: blurRadius, |
| 63 | + return SmallerOrEqualToScreenSize( |
| 64 | + maxWidth: 160, |
| 65 | + builder: (context, isMini) { |
| 66 | + return AxPressure( |
| 67 | + child: GestureDetector( |
| 68 | + onTap: onPressed, |
| 69 | + child: FocusableActionDetector( |
| 70 | + onShowFocusHighlight: _handleFocusHighlight, |
| 71 | + onShowHoverHighlight: _handleHoverHighlight, |
| 72 | + actions: { |
| 73 | + ActivateIntent: ActivateLinkAction(context, onPressed), |
| 74 | + }, |
| 75 | + child: TweenAnimationBuilder( |
| 76 | + tween: ColorTween( |
| 77 | + begin: color.withAlpha(alpha), |
| 78 | + end: color.withAlpha(alpha), |
82 | 79 | ),
|
83 | 80 | duration: theme.fastAnimationDuration,
|
84 |
| - builder: |
85 |
| - (BuildContext context, double blurRadius, Widget? child) { |
86 |
| - return Text( |
87 |
| - widget.title, |
88 |
| - textAlign: TextAlign.start, |
89 |
| - style: theme.typography.title?.apply( |
90 |
| - fontWeightDelta: -100, |
91 |
| - color: color, |
92 |
| - shadows: [ |
93 |
| - Shadow( |
94 |
| - color: theme.accentColor, |
95 |
| - blurRadius: blurRadius, |
96 |
| - ), |
97 |
| - ], |
| 81 | + builder: (BuildContext context, Color? color, Widget? child) { |
| 82 | + return TweenAnimationBuilder( |
| 83 | + tween: Tween<double>( |
| 84 | + begin: blurRadius, |
| 85 | + end: blurRadius, |
98 | 86 | ),
|
| 87 | + duration: theme.fastAnimationDuration, |
| 88 | + builder: (BuildContext context, double blurRadius, |
| 89 | + Widget? child) { |
| 90 | + return Text( |
| 91 | + widget.title, |
| 92 | + textAlign: TextAlign.start, |
| 93 | + style: theme.typography.title?.apply( |
| 94 | + fontWeightDelta: -100, |
| 95 | + fontSizeFactor: isMini ? 0.69 : 1, |
| 96 | + color: color, |
| 97 | + shadows: [ |
| 98 | + Shadow( |
| 99 | + color: theme.accentColor, |
| 100 | + blurRadius: blurRadius, |
| 101 | + ), |
| 102 | + ], |
| 103 | + ), |
| 104 | + ); |
| 105 | + }, |
99 | 106 | );
|
100 | 107 | },
|
101 |
| - ); |
102 |
| - }, |
| 108 | + ), |
| 109 | + ), |
103 | 110 | ),
|
104 |
| - ), |
105 |
| - ), |
| 111 | + ); |
| 112 | + }, |
106 | 113 | );
|
107 | 114 | }
|
108 | 115 | }
|
0 commit comments