summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e5130b4)
raw | patch | inline | side by side (parent: e5130b4)
author | Max Kellermann <max@duempel.org> | |
Fri, 9 Oct 2009 20:34:04 +0000 (22:34 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 9 Oct 2009 20:34:04 +0000 (22:34 +0200) |
Don't write list_window.selected directly.
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 6375ee955325c13b7206b0003b568834b62c2b53..492fdd44b8e2bb21259d56bfe46d62649b3e059f 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
list_window_mouse(browser->lw, length, bstate, row))
return 1;
- browser->lw->selected = browser->lw->start + row;
+ list_window_set_cursor(browser->lw, browser->lw->start + row);
list_window_check_selected(browser->lw, length);
if( bstate & BUTTON1_CLICKED ) {
diff --git a/src/screen_help.c b/src/screen_help.c
index 0ce3bd8dc375c1c01492ee59caab89a152392575..4d501742bb0f2cf533382d361a680af92affe46e 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
return true;
}
- lw->selected = lw->start;
+ list_window_set_cursor(lw, lw->start);
if (screen_find(lw, help_text_rows,
cmd, list_callback, NULL)) {
/* center the row */
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index bc3115c65b827604db76527ac1da9c32dc37b0fd..44e08384e5165a4aaa4f0f6314647800e06f58c4 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
}
} else {
if (lw->selected == 0) { /* up */
- lw->selected = subcmd;
- lw->selected_start = lw->selected;
- lw->selected_end = lw->selected;
+ list_window_set_cursor(lw, subcmd);
subcmd = -1;
keydef_repaint();
return true;
case CMD_GO_PARENT_DIRECTORY:
if (subcmd >=0) {
- lw->selected = subcmd;
- lw->selected_start = lw->selected;
- lw->selected_end = lw->selected;
+ list_window_set_cursor(lw, subcmd);
subcmd = -1;
keydef_repaint();
diff --git a/src/screen_play.c b/src/screen_play.c
index 7d079bdc5615a6cd4724169adf93a8b45fb82909..784667b0bdbf143fb1202295e76e7db6a484e5ed 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
pos = playlist_get_index_from_id(playlist, selected_song_id);
if (pos >= 0)
- lw->selected = pos;
+ list_window_set_cursor(lw, pos);
list_window_check_selected(lw, playlist_length(playlist));
playlist_save_selection();
mpdclient_cmd_delete(c, lw->selected);
}
- lw->selected = selected;
+ list_window_set_cursor(lw, selected);
list_window_check_selected(lw, playlist_length(playlist));
playlist_save_selection();
playlist_repaint();
mpdclient_cmd_delete(c, lw->selected);
}
- lw->selected = lw->selected_end = lw->selected_start;
- lw->range_selection = false;
+ list_window_set_cursor(lw, lw->selected_start);
return true;
case CMD_SAVE_PLAYLIST:
diff --git a/src/screen_text.c b/src/screen_text.c
index ffa81cdb00990799ec9073ae304d171216855647..56e41d3e07bba2b60cb565ca62f0b06f8882eb77 100644 (file)
--- a/src/screen_text.c
+++ b/src/screen_text.c
return true;
}
- text->lw->selected = text->lw->start;
+ list_window_set_cursor(text->lw, text->lw->start);
if (screen_find(text->lw, text->lines->len,
cmd, screen_text_list_callback, text)) {
/* center the row */