Compare commits

...

2 Commits

Author SHA1 Message Date
Přemysl Eric Janouch f05be01fba
Change volume adjustment key bindings
Use the much more obvious ones.
2023-05-30 15:17:04 +02:00
Přemysl Eric Janouch 14dba91dd1
Add a go-to-playing action and binding 2023-05-30 14:41:44 +02:00
4 changed files with 18 additions and 4 deletions

4
NEWS
View File

@ -11,8 +11,12 @@ Unreleased
* X11: fixed rendering of overflowing, partially visible list items
* Added a "o" binding to select the currently playing song
* Added Readline-like M-u, M-l, M-c editor bindings
* Changed volume adjustment bindings to use +/- keys
2.0.0 (2022-09-03)

View File

@ -46,6 +46,8 @@ CENTER_CURSOR, Center the cursor
MOVE_UP, Move selection up
MOVE_DOWN, Move selection down
GOTO_PLAYING, Go to playing song
GOTO_TOP, Go to top
GOTO_BOTTOM, Go to bottom
GOTO_ITEM_PREVIOUS, Go to previous item

View File

@ -117,8 +117,8 @@ as in the snippet above. To replace the default volume control bindings, use:
....
normal = {
"M-PageUp" = "pulse-volume-up"
"M-PageDown" = "pulse-volume-down"
"+" = "pulse-volume-up"
"-" = "pulse-volume-down"
}
....

View File

@ -3021,6 +3021,7 @@ g_normal_defaults[] =
{ "C-PageUp", ACTION_TAB_PREVIOUS },
{ "C-PageDown", ACTION_TAB_NEXT },
{ "o", ACTION_GOTO_PLAYING },
{ "Home", ACTION_GOTO_TOP },
{ "End", ACTION_GOTO_BOTTOM },
{ "M-<", ACTION_GOTO_TOP },
@ -3072,8 +3073,8 @@ g_normal_defaults[] =
{ "Space", ACTION_MPD_TOGGLE },
{ "C-Space", ACTION_MPD_STOP },
{ "u", ACTION_MPD_UPDATE_DB },
{ "M-PageUp", ACTION_MPD_VOLUME_UP },
{ "M-PageDown", ACTION_MPD_VOLUME_DOWN },
{ "+", ACTION_MPD_VOLUME_UP },
{ "-", ACTION_MPD_VOLUME_DOWN },
},
g_editor_defaults[] =
{
@ -3343,6 +3344,13 @@ current_tab_on_action (enum action action)
switch (action)
{
const char *id;
case ACTION_GOTO_PLAYING:
if (g.song < 0 || (size_t) g.song >= tab->item_count)
return false;
tab->item_selected = g.song;
app_ensure_selection_visible ();
return true;
case ACTION_MOVE_UP:
return current_tab_move_selection (-1);
case ACTION_MOVE_DOWN: