mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-20 12:54:33 -04:00
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:
parent
c66df8c807
commit
eecdd3acda
6 changed files with 89 additions and 116 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue