Commit 49aa04bf authored by Tobias Hunger's avatar Tobias Hunger

Git: Use colors from theme

Change-Id: I1627f7d55d50f302f76c591345c021a3b400e43e
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 5c60bb9d
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <utils/theme/theme.h>
#include <QProcess> #include <QProcess>
#include <QFormLayout> #include <QFormLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
...@@ -49,6 +51,8 @@ ...@@ -49,6 +51,8 @@
#include <QStringListModel> #include <QStringListModel>
#include <QTimer> #include <QTimer>
using namespace Utils;
namespace Git { namespace Git {
namespace Internal { namespace Internal {
...@@ -186,15 +190,17 @@ void ChangeSelectionDialog::acceptShow() ...@@ -186,15 +190,17 @@ void ChangeSelectionDialog::acceptShow()
//! Set commit message in details //! Set commit message in details
void ChangeSelectionDialog::setDetails(int exitCode) void ChangeSelectionDialog::setDetails(int exitCode)
{ {
Theme *theme = creatorTheme();
QPalette palette; QPalette palette;
if (exitCode == 0) { if (exitCode == 0) {
m_ui->detailsText->setPlainText(QString::fromUtf8(m_process->readAllStandardOutput())); m_ui->detailsText->setPlainText(QString::fromUtf8(m_process->readAllStandardOutput()));
palette.setColor(QPalette::Text, Qt::black); palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
m_ui->changeNumberEdit->setPalette(palette); m_ui->changeNumberEdit->setPalette(palette);
enableButtons(true); enableButtons(true);
} else { } else {
m_ui->detailsText->setPlainText(tr("Error: Unknown reference")); m_ui->detailsText->setPlainText(tr("Error: Unknown reference"));
palette.setColor(QPalette::Text, Qt::red); palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
m_ui->changeNumberEdit->setPalette(palette); m_ui->changeNumberEdit->setPalette(palette);
} }
} }
...@@ -244,13 +250,14 @@ void ChangeSelectionDialog::recalculateDetails() ...@@ -244,13 +250,14 @@ void ChangeSelectionDialog::recalculateDetails()
const QString workingDir = workingDirectory(); const QString workingDir = workingDirectory();
QPalette palette = m_ui->workingDirectoryEdit->palette(); QPalette palette = m_ui->workingDirectoryEdit->palette();
Theme *theme = creatorTheme();
if (workingDir.isEmpty()) { if (workingDir.isEmpty()) {
m_ui->detailsText->setPlainText(tr("Error: Bad working directory.")); m_ui->detailsText->setPlainText(tr("Error: Bad working directory."));
palette.setColor(QPalette::Text, Qt::red); palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
m_ui->workingDirectoryEdit->setPalette(palette); m_ui->workingDirectoryEdit->setPalette(palette);
return; return;
} else { } else {
palette.setColor(QPalette::Text, Qt::black); palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
m_ui->workingDirectoryEdit->setPalette(palette); m_ui->workingDirectoryEdit->setPalette(palette);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment