]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix minor issues with mouse wheel up/down keys
authorterencehill <piuntn@gmail.com>
Sun, 22 Aug 2010 18:51:25 +0000 (20:51 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 22 Aug 2010 18:51:25 +0000 (20:51 +0200)
qcsrc/menu/xonotic/dialog_multiplayer_screenshot_screenshotviewer.c
qcsrc/menu/xonotic/screenshotlist.c

index 2c69d5300fc012835f6dd0c9df8c2778fa0a7627..dec8881c16567639329c1c07f830a968162bdf6c 100644 (file)
@@ -61,6 +61,11 @@ float XonoticScreenshotViewerDialog_keyDown(entity me, float key, float ascii, f
                        }
                        return SUPER(XonoticScreenshotViewerDialog).keyDown(me, key, ascii, shift);
                default:
+                       // mousewheel doesn't always reach the first/last screenshot
+                       if (key == K_MWHEELUP)
+                               key = K_PGUP;
+                       else if (key == K_MWHEELDOWN)
+                               key = K_PGDN;
                        if (me.scrList.keyDown(me.scrList, key, ascii, shift))
                        {
                                // keyDown has already changed the selected item
index 22d1eb2a2c6695dd00f4b0c42b7fc1442e1ec6b1..ffc5a2f375f4d93dac3d7980261175c57fd3836f 100644 (file)
@@ -141,7 +141,7 @@ void XonoticScreenshotList_setSelected(entity me, float i)
        {
                // while dragging the scrollbar (or an item)
                // for a smooth mouse movement do not load immediately the new selected images
-               me.newScreenshotTime = time + 0.2;
+               me.newScreenshotTime = time + 0.22; // dragging an item we need a delay > 0.2 (from listbox: me.dragScrollTimer = time + 0.2;)
        }
        else if (time > me.newScreenshotTime)
        {