forked from qt-creator/qt-creator
Remove usages of deprecated APIs
Replaced: QPalette::ColorRole::Background -> QPalette::ColorRole::Window QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole QFontMetrics::width() -> QFontMetrics::horizontalAdvance() Task-number: QTBUG-76491 Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -64,31 +64,28 @@ static QPalette buttonPalette(bool isActive, bool isCursorInside, bool forText)
|
||||
Theme *theme = Utils::creatorTheme();
|
||||
if (isActive) {
|
||||
if (forText) {
|
||||
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::Window, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_BackgroundColor));
|
||||
} else {
|
||||
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::Window, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
}
|
||||
} else {
|
||||
if (isCursorInside) {
|
||||
if (forText) {
|
||||
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_HoverColor));
|
||||
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_HoverColor));
|
||||
pal.setColor(QPalette::Window, theme->color(Theme::Welcome_HoverColor));
|
||||
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_TextColor));
|
||||
} else {
|
||||
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_HoverColor));
|
||||
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundSecondaryColor));
|
||||
pal.setColor(QPalette::Window, theme->color(Theme::Welcome_HoverColor));
|
||||
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_ForegroundSecondaryColor));
|
||||
}
|
||||
} else {
|
||||
if (forText) {
|
||||
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_BackgroundColor));
|
||||
pal.setColor(QPalette::Window, theme->color(Theme::Welcome_ForegroundPrimaryColor));
|
||||
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_TextColor));
|
||||
} else {
|
||||
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_BackgroundColor));
|
||||
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundSecondaryColor));
|
||||
pal.setColor(QPalette::Window, theme->color(Theme::Welcome_BackgroundColor));
|
||||
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_ForegroundSecondaryColor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user