Compare commits
4 Commits
v1.2.0
...
8260842aef
| Author | SHA1 | Date | |
|---|---|---|---|
|
8260842aef
|
|||
|
fe017b4daa
|
|||
|
f3c4cec24a
|
|||
|
410136a647
|
@@ -42,6 +42,7 @@ INCREMENTAL_SEARCH, Incremental search
|
||||
|
||||
SCROLL_UP, Scroll up
|
||||
SCROLL_DOWN, Scroll down
|
||||
CENTER_CURSOR, Center the cursor
|
||||
MOVE_UP, Move selection up
|
||||
MOVE_DOWN, Move selection down
|
||||
|
||||
|
||||
21
nncmpp.c
21
nncmpp.c
@@ -1560,6 +1560,7 @@ app_init_terminal (void)
|
||||
for (int a = 0; a < ATTRIBUTE_COUNT; a++)
|
||||
{
|
||||
// ...thus we can reset back to defaults even after initializing some
|
||||
// FIXME: that's a lie now, MULTISELECT requires a colour
|
||||
if (g.attrs[a].fg >= COLORS || g.attrs[a].fg < -1
|
||||
|| g.attrs[a].bg >= COLORS || g.attrs[a].bg < -1)
|
||||
{
|
||||
@@ -2212,6 +2213,19 @@ app_ensure_selection_visible (void)
|
||||
app_scroll (too_low);
|
||||
}
|
||||
|
||||
static bool
|
||||
app_center_cursor (void)
|
||||
{
|
||||
struct tab *tab = g.active_tab;
|
||||
if (tab->item_selected < 0 || !tab->item_count)
|
||||
return false;
|
||||
|
||||
int offset = tab->item_selected - tab->item_top;
|
||||
int target = app_visible_items () / 2;
|
||||
app_scroll (offset - target);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
app_move_selection (int diff)
|
||||
{
|
||||
@@ -2509,9 +2523,10 @@ app_process_action (enum action action)
|
||||
case ACTION_PULSE_MUTE: return pulse_volume_mute (&g.pulse);
|
||||
#endif // WITH_PULSE
|
||||
|
||||
// XXX: these should rather be parametrized
|
||||
// XXX: these two should rather be parametrized
|
||||
case ACTION_SCROLL_UP: return app_scroll (-3);
|
||||
case ACTION_SCROLL_DOWN: return app_scroll (3);
|
||||
case ACTION_SCROLL_DOWN: return app_scroll (+3);
|
||||
case ACTION_CENTER_CURSOR: return app_center_cursor ();
|
||||
|
||||
case ACTION_GOTO_TOP:
|
||||
if (tab->item_count)
|
||||
@@ -2737,6 +2752,7 @@ g_normal_defaults[] =
|
||||
{ "C-f", ACTION_GOTO_PAGE_NEXT },
|
||||
{ "C-y", ACTION_SCROLL_UP },
|
||||
{ "C-e", ACTION_SCROLL_DOWN },
|
||||
{ "z", ACTION_CENTER_CURSOR },
|
||||
|
||||
{ "H", ACTION_GOTO_VIEW_TOP },
|
||||
{ "M", ACTION_GOTO_VIEW_CENTER },
|
||||
@@ -4264,6 +4280,7 @@ pulse_update (void)
|
||||
// The read permission is sufficient for this command
|
||||
mpd_client_send_command (c, "outputs", NULL);
|
||||
mpd_client_add_task (c, mpd_on_outputs_response, NULL);
|
||||
mpd_client_idle (c, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user