Răsfoiți Sursa

Fixed 1277 - only 2 cursor buttons will be enabled for sliders, depending on its direction (horizontal/vertical)

Ivan Savenko 11 ani în urmă
părinte
comite
3939c70a81
1 a modificat fișierele cu 11 adăugiri și 3 ștergeri
  1. 11 3
      client/widgets/Buttons.cpp

+ 11 - 3
client/widgets/Buttons.cpp

@@ -706,16 +706,24 @@ void CSlider::keyPressed(const SDL_KeyboardEvent & key)
 {
 	if(key.state != SDL_PRESSED) return;
 
-	int moveDest = 0;
+	int moveDest = value;
 	switch(key.keysym.sym)
 	{
 	case SDLK_UP:
+		if (!horizontal)
+			moveDest = value - scrollStep;
+		break;
 	case SDLK_LEFT:
-		moveDest = value - scrollStep;
+		if (horizontal)
+			moveDest = value - scrollStep;
 		break;
 	case SDLK_DOWN:
+		if (!horizontal)
+			moveDest = value + scrollStep;
+		break;
 	case SDLK_RIGHT:
-		moveDest = value + scrollStep;
+		if (horizontal)
+			moveDest = value + scrollStep;
 		break;
 	case SDLK_PAGEUP:
 		moveDest = value - capacity + scrollStep;