only redraw the download list if the deleted download was onscreen

This commit is contained in:
Shivaram Lingamneni
2017-01-08 14:49:54 -08:00
parent 2097c9ca3e
commit 321147cdb8
2 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ public:
void adjust_up_throttle(int throttle);
void adjust_down_throttle(int throttle);
display::Window* window() { return NULL; }
display::Window* window() { return NULL; }
core::Download* download() { return m_download; };
private:
Download(const Download&);
+8 -7
View File
@@ -124,16 +124,17 @@ DownloadList::set_current_view(const std::string& name) {
return dynamic_cast<ElementDownloadList*>(m_uiArray[DISPLAY_DOWNLOAD_LIST])->receive_change_view(name);
}
// This should also do focus_next() or something.
void
DownloadList::unfocus_download(core::Download* d) {
if (m_state == DISPLAY_DOWNLOAD)
activate_display(DISPLAY_DOWNLOAD_LIST);
if (m_state == DISPLAY_DOWNLOAD) {
if (d == static_cast<Download*>(m_uiArray[DISPLAY_DOWNLOAD])->download()) {
activate_display(DISPLAY_DOWNLOAD_LIST);
}
}
if (current_view()->focus() >= current_view()->end_visible() || *current_view()->focus() != d)
return;
current_view()->next_focus();
if (*current_view()->focus() == d && current_view()->focus() < current_view()->end_visible()) {
current_view()->next_focus();
}
}
void