]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/listbox.c
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / listbox.c
index 4d6174cc593cb4bacb484addb4ec9b551e019909..ba3fa6a9f28ca8c3dbbb31f11b85982ba8bede03 100644 (file)
@@ -7,6 +7,7 @@ CLASS(ListBox) EXTENDS(Item)
        METHOD(ListBox, mousePress, float(entity, vector))
        METHOD(ListBox, mouseDrag, float(entity, vector))
        METHOD(ListBox, mouseRelease, float(entity, vector))
+       METHOD(ListBox, focusLeave, void(entity))
        ATTRIB(ListBox, focusable, float, 1)
        ATTRIB(ListBox, selectedItem, float, 0)
        ATTRIB(ListBox, size, vector, '0 0 0')
@@ -188,6 +189,13 @@ float ListBox_mouseRelease(entity me, vector pos)
        me.pressed = 0;
        return 1;
 }
+void ListBox_focusLeave(entity me)
+{
+       // Reset the var pressed in case listbox loses focus
+       // by a mouse click on an item of the list
+       // for example showing a dialog on right click
+       me.pressed = 0;
+}
 void ListBox_updateControlTopBottom(entity me)
 {
        float f;