Skip to content

Commit 384e34c

Browse files
authored
fix: control panel heights mismatch (#1449)
1 parent a150293 commit 384e34c

File tree

11 files changed

+232
-457
lines changed

11 files changed

+232
-457
lines changed

lib/app/view/main_page_icon.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ class MainPageIcon extends StatelessWidget with WatchItMixin {
3434
(LocalAudioModel m) => m.initAudiosCommand.isRunning,
3535
);
3636

37-
if (currentAudioType == audioType) {
38-
if (isLocalAudioImporting) {
39-
return Padding(
40-
padding: mainPageIconPadding,
41-
child: const SizedBox(
42-
width: 16,
43-
height: 16,
44-
child: Progress(strokeWidth: 2),
45-
),
46-
);
47-
} else if (isPlaying) {
37+
if (isLocalAudioImporting && audioType == AudioType.local) {
38+
return Padding(
39+
padding: mainPageIconPadding,
40+
child: const SizedBox(
41+
width: 16,
42+
height: 16,
43+
child: Progress(strokeWidth: 2),
44+
),
45+
);
46+
} else if (currentAudioType == audioType) {
47+
if (isPlaying) {
4848
if (useMoreAnimations) {
4949
return const ActiveAudioSignalIndicator(thickness: 2);
5050
} else {

lib/common/view/country_auto_complete.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CountryAutoComplete extends StatelessWidget with WatchItMixin {
5555
final useYaruTheme = watchPropertyValue(
5656
(SettingsModel m) => m.useYaruTheme,
5757
);
58-
final inputHeight = getInputHeight(useYaruTheme);
58+
final inputHeight = getInputHeight();
5959

6060
return SizedBox(
6161
height: height ?? inputHeight,

lib/common/view/language_autocomplete.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class LanguageAutoComplete extends StatelessWidget with WatchItMixin {
5555
);
5656

5757
return SizedBox(
58-
height: height ?? getInputHeight(useYaruTheme),
58+
height: height ?? getInputHeight(),
5959
width: width,
6060
child: LayoutBuilder(
6161
builder: (_, constraints) {

lib/common/view/sliver_audio_page_control_panel.dart

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,21 @@ class SliverAudioPageControlPanel extends StatelessWidget {
1818

1919
@override
2020
Widget build(BuildContext context) {
21-
return SliverPadding(
22-
padding: const EdgeInsets.only(bottom: 10),
23-
sliver: SliverAppBar(
24-
shape: const RoundedRectangleBorder(side: BorderSide.none),
25-
elevation: 0,
26-
backgroundColor:
27-
backgroundColor ?? context.theme.scaffoldBackgroundColor,
28-
automaticallyImplyLeading: false,
29-
pinned: true,
30-
centerTitle: true,
31-
titleSpacing: 0,
32-
title: Padding(
33-
padding: const EdgeInsets.symmetric(horizontal: kLargestSpace),
34-
child: controlPanel,
35-
),
36-
bottom: const SliverAppBarBottomSpace(),
37-
onStretchTrigger: onStretchTrigger,
21+
return SliverAppBar(
22+
shape: const RoundedRectangleBorder(side: BorderSide.none),
23+
elevation: 0,
24+
backgroundColor: backgroundColor ?? context.theme.scaffoldBackgroundColor,
25+
automaticallyImplyLeading: false,
26+
pinned: true,
27+
centerTitle: true,
28+
titleSpacing: 0,
29+
toolbarHeight: 70,
30+
title: Padding(
31+
padding: const EdgeInsets.symmetric(horizontal: kLargestSpace),
32+
child: controlPanel,
3833
),
34+
bottom: const SliverAppBarBottomSpace(),
35+
onStretchTrigger: onStretchTrigger,
3936
);
4037
}
4138
}

lib/common/view/theme.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,7 @@ EdgeInsets getCountryPillPadding(bool useYaruTheme) => useYaruTheme
290290
? const EdgeInsets.only(bottom: 9, top: 9, right: 15, left: 15)
291291
: const EdgeInsets.only(top: 11, bottom: 11, left: 15, right: 15);
292292

293-
double getInputHeight(bool useYaruTheme) => isMobile
294-
? 40
295-
: useYaruTheme
296-
? kYaruTitleBarItemHeight
297-
: 36;
293+
double getInputHeight() => isMobile ? 40 : 36;
298294

299295
double get audioCardDimension => kAudioCardDimension - (isMobile ? 15 : 0);
300296

lib/local_audio/local_audio_model.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ class LocalAudioModel extends SafeChangeNotifier {
7777
notifyListeners();
7878
}
7979

80-
bool _showPlaylistAddAudios = true;
80+
bool _showPlaylistAddAudios = false;
8181
bool get showPlaylistAddAudios => _showPlaylistAddAudios;
8282
void setShowPlaylistAddAudios(bool value) {
8383
if (value == _showPlaylistAddAudios) return;
8484
_showPlaylistAddAudios = value;
85+
if (_showPlaylistAddAudios && audios == null) {
86+
initAudiosCommand.run((directory: null, forceInit: false));
87+
}
8588
notifyListeners();
8689
}
8790

0 commit comments

Comments
 (0)