fixing edit freq,edit desc, delete freq (#1117)

* fixing edit freq,edit desc, delete freq
* fixing scrolling issues
* fixing indent
This commit is contained in:
gullradriel 2023-06-07 10:17:55 +02:00 committed by GitHub
parent c66df8c807
commit eecdd3acda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 89 additions and 116 deletions

View file

@ -108,8 +108,19 @@ void FreqManUIList::paint(Painter& painter) {
void FreqManUIList::set_db(freqman_db& db) {
freqlist_db = db;
current_index = 0;
highlighted_index = 0;
if (db.size() == 0) {
current_index = 0;
highlighted_index = 0;
} else {
if ((unsigned)(current_index + highlighted_index) >= db.size()) {
current_index = db.size() - 1 - highlighted_index;
}
if (current_index < 0) {
current_index = 0;
if (highlighted_index > 0)
highlighted_index--;
}
}
}
void FreqManUIList::on_focus() {