summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-08-27 19:14:25 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-08-27 19:14:25 -0300
commit3c4326b450a63999ee3e068c9a42b499398d53dd (patch)
tree54c7b79ca8c6ade06d88f74b1ec8632ed6756ae6 /Panel.c
parent6082db2121e986355e4d918b11f0b0e2fc8fe5e6 (diff)
Don't select last item when clicking past the end of the panel.
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Panel.c b/Panel.c
index f421a0d5..65409706 100644
--- a/Panel.c
+++ b/Panel.c
@@ -254,7 +254,10 @@ int Panel_size(Panel* this) {
void Panel_setSelected(Panel* this, int selected) {
assert (this != NULL);
- selected = MIN(Vector_size(this->items) - 1, selected);
+ int size = Vector_size(this->items);
+ if (selected >= size) {
+ return;
+ }
if (selected < 0)
selected = 0;
this->selected = selected;

© 2014-2024 Faster IT GmbH | imprint | privacy policy