Utils: Introduce a convenience function creatorColor()

... forwarding to creatorTheme()->color(...)

Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2024-05-29 11:45:22 +02:00
parent d41f15390f
commit efae651924
100 changed files with 327 additions and 339 deletions

View File

@@ -172,18 +172,16 @@ void ChangeSelectionDialog::acceptCommand(ChangeCommand command)
//! Set commit message in details
void ChangeSelectionDialog::setDetails()
{
Theme *theme = creatorTheme();
QPalette palette;
if (m_process->result() == ProcessResult::FinishedWithSuccess) {
m_detailsText->setPlainText(m_process->cleanedStdOut());
palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
palette.setColor(QPalette::Text, creatorColor(Theme::TextColorNormal));
m_changeNumberEdit->setPalette(palette);
} else if (m_process->result() == ProcessResult::StartFailed) {
m_detailsText->setPlainText(Tr::tr("Error: Could not start Git."));
} else {
m_detailsText->setPlainText(Tr::tr("Error: Unknown reference"));
palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
palette.setColor(QPalette::Text, creatorColor(Theme::TextColorError));
m_changeNumberEdit->setPalette(palette);
enableButtons(false);
}