本文整理汇总了C++中Theme::color方法的典型用法代码示例。如果您正苦于以下问题:C++ Theme::color方法的具体用法?C++ Theme::color怎么用?C++ Theme::color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::color方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setDetails
//! Set commit message in details
void ChangeSelectionDialog::setDetails(int exitCode)
{
Theme *theme = creatorTheme();
QPalette palette;
if (exitCode == 0) {
m_ui->detailsText->setPlainText(QString::fromUtf8(m_process->readAllStandardOutput()));
palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
m_ui->changeNumberEdit->setPalette(palette);
enableButtons(true);
} else {
m_ui->detailsText->setPlainText(tr("Error: Unknown reference"));
palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
m_ui->changeNumberEdit->setPalette(palette);
}
}
示例2: recalculateDetails
void ChangeSelectionDialog::recalculateDetails()
{
terminateProcess();
enableButtons(false);
const QString workingDir = workingDirectory();
QPalette palette = m_ui->workingDirectoryEdit->palette();
Theme *theme = creatorTheme();
if (workingDir.isEmpty()) {
m_ui->detailsText->setPlainText(tr("Error: Bad working directory."));
palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
m_ui->workingDirectoryEdit->setPalette(palette);
return;
} else {
palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
m_ui->workingDirectoryEdit->setPalette(palette);
}
const QString ref = change();
if (ref.isEmpty()) {
m_ui->detailsText->clear();
return;
}
QStringList args;
args << QLatin1String("show") << QLatin1String("--stat=80") << ref;
m_process = new QProcess(this);
m_process->setWorkingDirectory(workingDir);
m_process->setProcessEnvironment(m_gitEnvironment);
connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
this, &ChangeSelectionDialog::setDetails);
m_process->start(m_gitExecutable.toString(), args);
m_process->closeWriteChannel();
if (!m_process->waitForStarted())
m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
else
m_ui->detailsText->setPlainText(tr("Fetching commit data..."));
}
示例3: buttonPalette
static QPalette buttonPalette(bool isActive, bool isCursorInside, bool forText)
{
QPalette pal;
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::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));
}
} 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::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));
}
} else {
if (forText) {
pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_BackgroundColor));
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));
}
}
}
return pal;
}