forked from qt-creator/qt-creator
SquishTests: Adapt to dark theme
Depending on the OS QC may be started with dark theming. As we use the color of the buttons on the welcome page to decide whether a button is active or not we need to adapt the expected colors to cover dark theming as well. Change-Id: I844b1e2cf4b44ce9501a4ef4a850331ca9983e3c Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
@@ -19,11 +19,14 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails):
|
||||
"Verifying: '%s' button is being displayed." % getStarted)
|
||||
def buttonActive(button):
|
||||
# colors of the default theme for active button on Welcome page
|
||||
(activeRed, activeGreen, activeBlue) = (69, 206, 85)
|
||||
defaultActiveRGB = (69, 206, 85)
|
||||
# colors of the dark theme for active button on Welcome page
|
||||
darkActiveRGB = (54, 193, 72)
|
||||
# QPalette::Window (used background color of Welcome page buttons)
|
||||
enumQPaletteWindow = 10
|
||||
color = button.palette.color(enumQPaletteWindow)
|
||||
return color.red == activeRed and color.green == activeGreen and color.blue == activeBlue
|
||||
current = (color.red, color.green, color.blue)
|
||||
return current == defaultActiveRGB or current == darkActiveRGB
|
||||
|
||||
def waitForButtonsState(projectsActive, examplesActive, tutorialsActive, timeout=5000):
|
||||
projButton = getWelcomeScreenSideBarButton('Projects')[0]
|
||||
|
||||
Reference in New Issue
Block a user