Skip to content

Commit

Permalink
chore: sleep icon in yt queue
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Feb 16, 2024
1 parent 3c8bb30 commit 2ab36da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions lib/youtube/widgets/yt_history_video_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:namida/controller/player_controller.dart';
import 'package:namida/core/dimensions.dart';
import 'package:namida/core/enums.dart';
import 'package:namida/core/extensions.dart';
import 'package:namida/core/icon_fonts/broken_icons.dart';
import 'package:namida/ui/pages/subpages/playlist_tracks_subpage.dart';
import 'package:namida/ui/widgets/custom_widgets.dart';
import 'package:namida/youtube/class/youtube_id.dart';
Expand Down Expand Up @@ -111,6 +112,7 @@ class YTHistoryVideoCard extends StatelessWidget {
final itemsColor6 = isCurrentlyPlaying ? Colors.white.withOpacity(0.6) : null;
final itemsColor5 = isCurrentlyPlaying ? Colors.white.withOpacity(0.5) : null;
final threeLines = draggableThumbnail ? ThreeLineSmallContainers(enabled: draggingEnabled, color: itemsColor5) : null;
final willSleepAfterThis = fromPlayerQueue && Player.inst.enableSleepAfterTracks && Player.inst.sleepingTrackIndex == index;
final children = [
if (threeLines != null) draggingBarsBuilder?.call(itemsColor5) ?? threeLines,
SizedBox(
Expand All @@ -129,6 +131,7 @@ class YTHistoryVideoCard extends StatelessWidget {
height: thumbHeight - 3.0,
videoId: video.id,
smallBoxText: duration,
smallBoxIcon: willSleepAfterThis ? Broken.timer_1 : null,
),
),
if (draggingThumbWidget != null) draggingThumbnailBuilder?.call(draggingThumbWidget) ?? draggingThumbWidget
Expand Down
19 changes: 11 additions & 8 deletions lib/youtube/widgets/yt_thumbnail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class _YoutubeThumbnailState extends State<YoutubeThumbnail> with LoadingItemsDe
cacheHeight: (widget.height?.round() ?? widget.width.round()) ~/ 1.2,
onTopWidgets: [
...widget.onTopWidgets,
if (widget.smallBoxText != null)
if (widget.smallBoxText != null || widget.smallBoxIcon != null)
Positioned(
bottom: 0.0,
right: 0.0,
Expand All @@ -212,20 +212,23 @@ class _YoutubeThumbnailState extends State<YoutubeThumbnail> with LoadingItemsDe
enabled: settings.enableBlurEffect.value,
child: widget.smallBoxIcon != null
? Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
widget.smallBoxIcon,
size: 15.0,
color: Colors.white.withOpacity(0.8),
),
const SizedBox(width: 2.0),
Text(
widget.smallBoxText!,
style: context.textTheme.displaySmall?.copyWith(
color: Colors.white.withOpacity(0.8),
fontWeight: FontWeight.w600,
if (widget.smallBoxText != null) ...[
const SizedBox(width: 2.0),
Text(
widget.smallBoxText!,
style: context.textTheme.displaySmall?.copyWith(
color: Colors.white.withOpacity(0.8),
fontWeight: FontWeight.w600,
),
),
),
],
],
)
: Text(
Expand Down

0 comments on commit 2ab36da

Please sign in to comment.