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