Skip to content

Commit ce44e9a

Browse files
committed
fix: discord button label overflow, add helper to prevent backend crash, cursor pointer
1 parent 2656dda commit ce44e9a

18 files changed

Lines changed: 130 additions & 51 deletions

changes.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ This project loosely follows Keep a Changelog and uses Semantic Versioning.
66

77
---
88

9-
No Changes Yet.
9+
## [Unreleased]
10+
11+
### Fixed
12+
13+
- All button now should has pointer now
14+
- Discord button label overflow
15+
- Added helpers to prevent backend crash
1016

1117
---
1218

lib/app.dart

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,23 @@ ThemeData _buildDarkTheme() {
159159
),
160160
),
161161
textButtonTheme: TextButtonThemeData(
162-
style: TextButton.styleFrom(foregroundColor: const Color(0x80FFFFFF)),
162+
style: TextButton.styleFrom(
163+
foregroundColor: const Color(0x80FFFFFF),
164+
enabledMouseCursor: SystemMouseCursors.click,
165+
),
166+
),
167+
iconButtonTheme: IconButtonThemeData(
168+
style: IconButton.styleFrom(enabledMouseCursor: SystemMouseCursors.click),
169+
),
170+
filledButtonTheme: FilledButtonThemeData(
171+
style: FilledButton.styleFrom(
172+
enabledMouseCursor: SystemMouseCursors.click,
173+
),
174+
),
175+
elevatedButtonTheme: ElevatedButtonThemeData(
176+
style: ElevatedButton.styleFrom(
177+
enabledMouseCursor: SystemMouseCursors.click,
178+
),
163179
),
164180
dialogTheme: DialogThemeData(
165181
backgroundColor: card,
@@ -285,7 +301,23 @@ ThemeData _buildLightTheme() {
285301
),
286302
),
287303
textButtonTheme: TextButtonThemeData(
288-
style: TextButton.styleFrom(foregroundColor: const Color(0x80000000)),
304+
style: TextButton.styleFrom(
305+
foregroundColor: const Color(0x80000000),
306+
enabledMouseCursor: SystemMouseCursors.click,
307+
),
308+
),
309+
iconButtonTheme: IconButtonThemeData(
310+
style: IconButton.styleFrom(enabledMouseCursor: SystemMouseCursors.click),
311+
),
312+
filledButtonTheme: FilledButtonThemeData(
313+
style: FilledButton.styleFrom(
314+
enabledMouseCursor: SystemMouseCursors.click,
315+
),
316+
),
317+
elevatedButtonTheme: ElevatedButtonThemeData(
318+
style: ElevatedButton.styleFrom(
319+
enabledMouseCursor: SystemMouseCursors.click,
320+
),
289321
),
290322
dialogTheme: DialogThemeData(
291323
backgroundColor: card,

lib/screens/home_screen.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,7 @@ class _SideNavState extends ConsumerState<_SideNav>
668668
return AnimatedBuilder(
669669
animation: _widthAnim,
670670
builder: (context, child) {
671-
final w =
672-
60 +
673-
(_expandedWidth - 60) * _widthAnim.value;
671+
final w = 60 + (_expandedWidth - 60) * _widthAnim.value;
674672
return SizedBox(width: w, child: child);
675673
},
676674
child: Container(
@@ -947,6 +945,7 @@ class _PlaylistCollapsedIconState extends State<_PlaylistCollapsedIcon> {
947945
preferBelow: false,
948946
waitDuration: const Duration(milliseconds: 300),
949947
child: MouseRegion(
948+
cursor: SystemMouseCursors.click,
950949
onEnter: (_) => setState(() => _hovered = true),
951950
onExit: (_) => setState(() => _hovered = false),
952951
child: GestureDetector(
@@ -993,6 +992,7 @@ class _CollapseBtnState extends State<_CollapseBtn> {
993992
Widget build(BuildContext context) {
994993
final cs = Theme.of(context).colorScheme;
995994
return MouseRegion(
995+
cursor: SystemMouseCursors.click,
996996
onEnter: (_) => setState(() => _hovered = true),
997997
onExit: (_) => setState(() => _hovered = false),
998998
child: Tooltip(
@@ -1090,6 +1090,7 @@ class _NavItemState extends State<_NavItem> {
10901090
Widget build(BuildContext context) {
10911091
final cs = Theme.of(context).colorScheme;
10921092
final item = MouseRegion(
1093+
cursor: SystemMouseCursors.click,
10931094
onEnter: (_) => setState(() => _hovered = true),
10941095
onExit: (_) => setState(() => _hovered = false),
10951096
child: GestureDetector(
@@ -1381,6 +1382,7 @@ class _PlaylistNavItemState extends State<_PlaylistNavItem> {
13811382
Widget build(BuildContext context) {
13821383
final cs = Theme.of(context).colorScheme;
13831384
return MouseRegion(
1385+
cursor: SystemMouseCursors.click,
13841386
onEnter: (_) => setState(() => _hovered = true),
13851387
onExit: (_) => setState(() => _hovered = false),
13861388
child: GestureDetector(
@@ -1660,6 +1662,7 @@ class _PlaylistTrackTileState extends ConsumerState<_PlaylistTrackTile> {
16601662
final cs = Theme.of(context).colorScheme;
16611663

16621664
return MouseRegion(
1665+
cursor: SystemMouseCursors.click,
16631666
onEnter: (_) => setState(() => _hovered = true),
16641667
onExit: (_) => setState(() => _hovered = false),
16651668
child: GestureDetector(
@@ -1973,6 +1976,7 @@ class _TitleBarBtnState extends State<_TitleBarBtn> {
19731976
Widget build(BuildContext context) {
19741977
final cs = Theme.of(context).colorScheme;
19751978
return MouseRegion(
1979+
cursor: SystemMouseCursors.click,
19761980
onEnter: (_) => setState(() => _hovered = true),
19771981
onExit: (_) => setState(() => _hovered = false),
19781982
child: GestureDetector(

lib/screens/library_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ class _PlaylistOptionRowState extends State<_PlaylistOptionRow> {
599599
Widget build(BuildContext context) {
600600
final cs = Theme.of(context).colorScheme;
601601
return MouseRegion(
602+
cursor: SystemMouseCursors.click,
602603
onEnter: (_) => setState(() => _hovered = true),
603604
onExit: (_) => setState(() => _hovered = false),
604605
child: GestureDetector(

lib/screens/settings_screen.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
341341
_InfoRow(
342342
icon: Icons.music_note_rounded,
343343
title: 'Aqloss',
344-
value: 'Version 0.2.1',
344+
value: 'Version 0.2.2',
345345
),
346346
_Div(),
347347
_InfoRow(
@@ -483,6 +483,7 @@ class _ScanButtonState extends State<_ScanButton> {
483483
Widget build(BuildContext context) {
484484
final cs = Theme.of(context).colorScheme;
485485
return MouseRegion(
486+
cursor: SystemMouseCursors.click,
486487
onEnter: (_) => setState(() => _hovered = true),
487488
onExit: (_) => setState(() => _hovered = false),
488489
child: GestureDetector(
@@ -670,6 +671,7 @@ class _SelectBtnState extends State<_SelectBtn> {
670671
bool _hovered = false;
671672
@override
672673
Widget build(BuildContext context) => MouseRegion(
674+
cursor: SystemMouseCursors.click,
673675
onEnter: (_) => setState(() => _hovered = true),
674676
onExit: (_) => setState(() => _hovered = false),
675677
child: GestureDetector(
@@ -832,6 +834,7 @@ class _ToggleRowState extends State<_ToggleRow> {
832834
Widget build(BuildContext context) {
833835
final cs = Theme.of(context).colorScheme;
834836
return MouseRegion(
837+
cursor: SystemMouseCursors.click,
835838
onEnter: (_) => setState(() => _hovered = true),
836839
onExit: (_) => setState(() => _hovered = false),
837840
child: GestureDetector(
@@ -1372,6 +1375,7 @@ class _HoverTextBtnState extends State<_HoverTextBtn> {
13721375
Widget build(BuildContext context) {
13731376
final cs = Theme.of(context).colorScheme;
13741377
return MouseRegion(
1378+
cursor: SystemMouseCursors.click,
13751379
onEnter: (_) => setState(() => _hovered = true),
13761380
onExit: (_) => setState(() => _hovered = false),
13771381
child: GestureDetector(

lib/services/audio_service.dart

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:aqloss/providers/settings_provider.dart';
77
class AudioService {
88
// Volume cache
99
static double _cachedVolume = 1.0;
10+
static bool _engineReady = false;
1011

1112
// Freeze watchdog
1213
static Timer? _watchdog;
@@ -26,6 +27,7 @@ class AudioService {
2627
await Future(
2728
() => backend.recoverEngine(),
2829
).timeout(const Duration(seconds: 6));
30+
_engineReady = true;
2931
Logger.debugAudioService('recoverEngine() OK');
3032
onFreezeDetected?.call();
3133
} catch (e) {
@@ -50,11 +52,11 @@ class AudioService {
5052
double? volume,
5153
SettingsState? settings,
5254
}) async {
55+
_engineReady = false;
5356
if (volume != null) _cachedVolume = volume.clamp(0.0, 1.0);
5457
try {
5558
if (deviceId != null) {
5659
await Future(
57-
5860
() => backend.initEngineWithDevice(
5961
deviceId: deviceId,
6062
exclusive: exclusive,
@@ -76,22 +78,38 @@ class AudioService {
7678
return;
7779
}
7880
}
81+
_engineReady = true;
7982
await _applyVolume();
8083
if (settings != null) await applyAllDsp(settings);
8184
_startWatchdog();
8285
}
8386

8487
// Playback
8588
static Future<void> loadTrack(String path) async {
89+
if (!_engineReady) throw Exception('AudioEngine not ready');
8690
await backend.loadTrack(path: path);
8791
await _applyVolume();
8892
}
8993

90-
static Future<void> play() async => backend.play();
91-
static Future<void> pause() async => backend.pause();
92-
static Future<void> stop() async => backend.stop();
93-
static Future<void> seek(double positionSecs) async =>
94-
backend.seek(positionSecs: positionSecs);
94+
static Future<void> play() async {
95+
if (!_engineReady) throw Exception('AudioEngine not ready');
96+
return backend.play();
97+
}
98+
99+
static Future<void> pause() async {
100+
if (!_engineReady) return;
101+
return backend.pause();
102+
}
103+
104+
static Future<void> stop() async {
105+
if (!_engineReady) return;
106+
return backend.stop();
107+
}
108+
109+
static Future<void> seek(double positionSecs) async {
110+
if (!_engineReady) throw Exception('AudioEngine not ready');
111+
return backend.seek(positionSecs: positionSecs);
112+
}
95113

96114
static Future<void> setVolume(double volume) async {
97115
_cachedVolume = volume.clamp(0.0, 1.0);

lib/src/rust/api.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import 'frb_generated.dart';
77
import 'lib.dart';
88
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
99

10+
// These functions are ignored because they are not marked as `pub`: `engine`
11+
1012
Future<void> initEngine() => AqlossCore.instance.api.crateApiInitEngine();
1113

1214
Future<void> initEngineWithDevice({

lib/util/logger.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Logger {
8181

8282
final file = _files[target];
8383
if (file != null) {
84-
await file.writeAsString(line, mode: FileMode.write, flush: true);
84+
await file.writeAsString(line, mode: FileMode.append, flush: true);
8585
}
8686
}
8787

lib/widgets/mini_player_bar.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ class _MiniPlayBtnState extends State<_MiniPlayBtn> {
679679
Widget build(BuildContext context) {
680680
final sz = widget.small ? 32.0 : 36.0;
681681
return MouseRegion(
682+
cursor: SystemMouseCursors.click,
682683
onEnter: (_) => setState(() => _hovered = true),
683684
onExit: (_) => setState(() => _hovered = false),
684685
child: GestureDetector(
@@ -738,6 +739,7 @@ class _MiniBtnState extends State<_MiniBtn> {
738739
Widget build(BuildContext context) {
739740
final cs = Theme.of(context).colorScheme;
740741
final child = MouseRegion(
742+
cursor: SystemMouseCursors.click,
741743
onEnter: (_) => setState(() => _hovered = true),
742744
onExit: (_) => setState(() => _hovered = false),
743745
child: GestureDetector(
@@ -802,6 +804,7 @@ class _MiniLoopBtnState extends State<_MiniLoopBtn> {
802804
preferBelow: false,
803805
waitDuration: const Duration(milliseconds: 600),
804806
child: MouseRegion(
807+
cursor: SystemMouseCursors.click,
805808
onEnter: (_) => setState(() => _hovered = true),
806809
onExit: (_) => setState(() => _hovered = false),
807810
child: GestureDetector(

linux/xyz.nokarin.aqloss.metainfo.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@
5050
</screenshots>
5151

5252
<releases>
53+
<release version="0.2.2" date="2026-05-17">
54+
<url type="details">https://github.com/nokarin-dev/aqloss/releases/tag/v0.2.2</url>
55+
<description>
56+
<p>Added helpers, fix discord button label overflow, cursor pointer.</p>
57+
<ul>
58+
<li>All button now should has pointer now</li>
59+
<li>Discord button label overflow</li>
60+
<li>Added helpers to prevent backend crash</li>
61+
</ul>
62+
</description>
63+
</release>
5364
<release version="0.2.1" date="2026-05-17">
5465
<url type="details">https://github.com/nokarin-dev/aqloss/releases/tag/v0.2.1</url>
5566
<description>

0 commit comments

Comments
 (0)