Skip to content

Commit

Permalink
QWindowsTheme::themeHint(): Handle special value of SPI_GETWHEELSCROL…
Browse files Browse the repository at this point in the history
…LLINES

When the mouse wheel step is set to "Scroll one screen",  querying
SPI_GETWHEELSCROLLLINES returns the special value unsigned(-1). Return the
default instead of converting it to int in that case since Qt does not
implement it.

Task-number: QTBUG-52384
Change-Id: I793e5c09103fe0c7c4a378aba97e9f63ae1c2f35
Reviewed-by: Giuseppe D'Angelo <[email protected]>
Reviewed-by: Oliver Wolff <[email protected]>
  • Loading branch information
FriedemannKleint committed Jul 26, 2016
1 parent 1fcea11 commit 8ea6e8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/plugins/platforms/windows/qwindowstheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,13 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false));
case ContextMenuOnMouseRelease:
return QVariant(true);
case WheelScrollLines:
return QVariant(int(dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, 3)));
case WheelScrollLines: {
int result = 3;
const DWORD scrollLines = dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, DWORD(result));
if (scrollLines != DWORD(-1)) // Special value meaning "scroll one screen", unimplemented in Qt.
result = int(scrollLines);
return QVariant(result);
}
default:
break;
}
Expand Down

0 comments on commit 8ea6e8d

Please sign in to comment.