Add tooltips to several buttons
This commit is contained in:
parent
150e8e4b87
commit
2ae3e1fbda
@ -17,6 +17,7 @@ class PlayerUIAppBar {
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.copy_all),
|
||||
tooltip: 'Copy playlist to clipboard',
|
||||
onPressed: () {
|
||||
final state = BlocProvider.of<PlayerStateBloc>(context).state;
|
||||
if (state != null) {
|
||||
|
@ -84,6 +84,7 @@ class PlayerUIBody extends StatelessWidget {
|
||||
icon: playerState.isPlaying && item.current
|
||||
? const Icon(Icons.pause)
|
||||
: const Icon(Icons.play_arrow),
|
||||
tooltip: 'Play this track',
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.playlistGoto(i));
|
||||
@ -96,11 +97,13 @@ class PlayerUIBody extends StatelessWidget {
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.copy),
|
||||
tooltip: 'Copy uri to clipboard',
|
||||
onPressed: () =>
|
||||
Clipboard.setData(ClipboardData(text: item.filename)),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete_forever),
|
||||
tooltip: 'Remove from playlist',
|
||||
color: Colors.redAccent,
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
@ -138,6 +141,7 @@ class PlayerUIBody extends StatelessWidget {
|
||||
SizedBox.fromSize(size: const Size(10, 0)),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.send),
|
||||
tooltip: 'Add link to playlist',
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.load(_textController.text));
|
||||
@ -146,6 +150,7 @@ class PlayerUIBody extends StatelessWidget {
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.playlist_add),
|
||||
tooltip: 'Add many links',
|
||||
onPressed: () async {
|
||||
final blocProvider = BlocProvider.of<ConnectionStateBloc>(context);
|
||||
final links = await _showAddManyLinksDialog(context);
|
||||
|
@ -31,6 +31,7 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.skip_previous),
|
||||
tooltip: 'Skip to previous track',
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.playlistPrevious());
|
||||
@ -43,6 +44,7 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
icon: (playerState.isPlaying)
|
||||
? const Icon(Icons.pause)
|
||||
: const Icon(Icons.play_arrow),
|
||||
tooltip: (playerState.isPlaying) ? 'Pause' : 'Play',
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.togglePlayback());
|
||||
@ -52,6 +54,7 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.skip_next),
|
||||
tooltip: 'Skip to next track',
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.playlistNext());
|
||||
@ -141,6 +144,7 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
buildProps: (p) => [p.subtitleTracks],
|
||||
builder: (context, playerState) => PopupMenuButton(
|
||||
icon: const Icon(Icons.subtitles),
|
||||
tooltip: 'Select subtitle track',
|
||||
enabled: playerState.subtitleTracks.isNotEmpty,
|
||||
itemBuilder: (context) {
|
||||
return playerState.subtitleTracks
|
||||
@ -160,6 +164,7 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
buildProps: (p) => [p.isLooping],
|
||||
builder: (context, playerState) => IconButton(
|
||||
icon: const Icon(Icons.repeat),
|
||||
tooltip: 'Toggle playlist looping',
|
||||
isSelected: playerState.isLooping,
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
@ -169,6 +174,7 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.shuffle),
|
||||
tooltip: 'Shuffle playlist',
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.shuffle());
|
||||
@ -176,6 +182,8 @@ class PlayerUIBottomBar extends StatelessWidget {
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete_forever),
|
||||
tooltip: 'Clear playlist',
|
||||
color: Colors.redAccent,
|
||||
onPressed: () {
|
||||
BlocProvider.of<ConnectionStateBloc>(context)
|
||||
.add(Command.playlistClear());
|
||||
|
Loading…
Reference in New Issue
Block a user