Skip to content

Commit

Permalink
chore: smol ui change
Browse files Browse the repository at this point in the history
- refreshState instead of setState to always update info in channel subpage
- show tooltip on tap when pressing volume bar while replay gain enabled
  • Loading branch information
MSOB7YY committed Sep 26, 2024
1 parent cea3a3b commit afc35fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions lib/ui/pages/equalizer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class EqualizerMainSlidersColumn extends StatelessWidget {
);
return replayGainEnabled
? NamidaTooltip(
triggerMode: TooltipTriggerMode.tap,
message: () => lang.NORMALIZE_AUDIO,
child: AnimatedEnabled(
enabled: !replayGainEnabled,
Expand All @@ -135,6 +136,7 @@ class EqualizerMainSlidersColumn extends StatelessWidget {
);
return replayGainEnabled
? NamidaTooltip(
triggerMode: TooltipTriggerMode.tap,
message: () => lang.NORMALIZE_AUDIO,
child: AnimatedEnabled(
enabled: !replayGainEnabled,
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/widgets/custom_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3110,12 +3110,14 @@ class NamidaHero extends StatelessWidget {
class NamidaTooltip extends StatelessWidget {
final String Function()? message;
final bool? preferBelow;
final TooltipTriggerMode? triggerMode;
final Widget child;

const NamidaTooltip({
super.key,
required this.message,
this.preferBelow,
this.triggerMode,
required this.child,
});

Expand All @@ -3125,6 +3127,7 @@ class NamidaTooltip extends StatelessWidget {
return Tooltip(
message: message,
preferBelow: preferBelow,
triggerMode: triggerMode,
child: child,
);
}
Expand Down
10 changes: 4 additions & 6 deletions lib/youtube/pages/yt_channel_subpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,10 @@ class _YTChannelSubpageState extends State<YTChannelSubpage> with TickerProvider
if (value != null) {
_channelInfoSubButton.value = value;
final tabToBeSelected = _setTabsData(value);
if (mounted) {
setState(() {
if (_tabIndex == 0 && tabToBeSelected != null) _tabIndex = tabToBeSelected; // only set if tab wasnt changed
_channelInfo = value;
});
}
refreshState(() {
if (_tabIndex == 0 && tabToBeSelected != null) _tabIndex = tabToBeSelected; // only set if tab wasnt changed
_channelInfo = value;
});
onRefresh(() => _fetchCurrentTab(value, forceRequest: true), forceProceed: true);
}
},
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 4.4.78-beta+240926211
version: 4.4.79-beta+240926219

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit afc35fc

Please sign in to comment.