From: terencehill Date: Fri, 2 Jul 2010 09:14:48 +0000 (+0200) Subject: Fix a bug in the address field of the Servers dialog: X-Git-Tag: xonotic-v0.1.0preview~465^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e1bea92ac918ca77e842a93beb8acb6ebdd63f02;p=xonotic%2Fxonotic-data.pk3dir.git Fix a bug in the address field of the Servers dialog: After the info dialog of a server has been opened by right click (not by space), the address field cannot be edited anymore. listbox believed mouse key was still pressed after the dialog spawned. --- diff --git a/qcsrc/menu/item/listbox.c b/qcsrc/menu/item/listbox.c index 4d6174cc5..ba3fa6a9f 100644 --- a/qcsrc/menu/item/listbox.c +++ b/qcsrc/menu/item/listbox.c @@ -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;