mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-03-13 06:01:45 +00:00
apply branding dark theme by default
This commit is contained in:
parent
98ef76e442
commit
a6cb105b1c
@ -77,6 +77,33 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
|
||||
#include <QTextCodec>
|
||||
#endif
|
||||
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QPalette>
|
||||
#include <QPushButton>
|
||||
|
||||
// see also: src/qt/platformstyle.cpp
|
||||
void setDarkMode(QApplication &app)
|
||||
{
|
||||
QPalette palette;
|
||||
|
||||
palette.setColor(QPalette::AlternateBase, QColor(20, 20, 20));
|
||||
palette.setColor(QPalette::Base, QColor(30, 30, 30));
|
||||
palette.setColor(QPalette::Button, QColor(30, 30, 30));
|
||||
palette.setColor(QPalette::ButtonText, QColor(210, 210, 210));
|
||||
palette.setColor(QPalette::Highlight, QColor(130, 90, 205));
|
||||
palette.setColor(QPalette::HighlightedText, QColor(30, 30, 30));
|
||||
palette.setColor(QPalette::Text, QColor(210, 210, 210));
|
||||
palette.setColor(QPalette::ToolTipBase, QColor(0, 0, 0));
|
||||
palette.setColor(QPalette::ToolTipBase, QColor(210, 210, 210));
|
||||
palette.setColor(QPalette::ToolTipText, QColor(210, 210, 210));
|
||||
palette.setColor(QPalette::ToolTipText, QColor(30, 30, 30));
|
||||
palette.setColor(QPalette::Window, QColor(30, 30, 30));
|
||||
palette.setColor(QPalette::WindowText, QColor(210, 210, 210));
|
||||
|
||||
app.setPalette(palette);
|
||||
}
|
||||
|
||||
// Declare meta types used for QMetaObject::invokeMethod
|
||||
Q_DECLARE_METATYPE(bool*)
|
||||
Q_DECLARE_METATYPE(CAmount)
|
||||
@ -693,6 +720,8 @@ int main(int argc, char *argv[])
|
||||
int rv = EXIT_SUCCESS;
|
||||
try
|
||||
{
|
||||
setDarkMode(app);
|
||||
|
||||
app.createWindow(networkStyle.data());
|
||||
// Perform base initialization before spinning up initialization/shutdown thread
|
||||
// This is acceptable because this function only contains steps that are quick to execute,
|
||||
|
@ -50,9 +50,7 @@
|
||||
<item>
|
||||
<widget class="QWidget" name="contentWidget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">#contentWidget { background: rgba(255,255,255,240); border-radius: 6px; }
|
||||
|
||||
QLabel { color: rgb(40,40,40); }</string>
|
||||
<string notr="true">#contentWidget { background: rgb(30, 30, 30); border-radius: 6px; }</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayoutSub" stretch="1,0,0,0">
|
||||
<property name="spacing">
|
||||
|
@ -22,7 +22,7 @@ static const bool DEFAULT_SPLASHSCREEN = true;
|
||||
/* Transaction list -- unconfirmed transaction */
|
||||
#define COLOR_UNCONFIRMED QColor(128, 128, 128)
|
||||
/* Transaction list -- negative amount */
|
||||
#define COLOR_NEGATIVE QColor(255, 0, 0)
|
||||
#define COLOR_NEGATIVE QColor(230, 120, 105)
|
||||
/* Transaction list -- bare address (without label) */
|
||||
#define COLOR_BAREADDRESS QColor(140, 140, 140)
|
||||
/* Transaction list -- TX status decoration - open until date */
|
||||
|
@ -96,7 +96,7 @@ void KevaAddKeyDialog::onKeyChanged(const QString& key)
|
||||
|
||||
keyCounterPalette.setColor(
|
||||
QPalette::WindowText,
|
||||
keySize > 255 ? Qt::red : Qt::darkGreen
|
||||
keySize > 255 ? QColor(230, 120, 105) : QColor(150, 227, 138)
|
||||
);
|
||||
|
||||
ui->keyCounter->setPalette(
|
||||
@ -130,7 +130,7 @@ void KevaAddKeyDialog::onValueChanged()
|
||||
|
||||
valueCounterPalette.setColor(
|
||||
QPalette::WindowText,
|
||||
valueSize > MAX_SCRIPT_ELEMENT_SIZE ? Qt::red : Qt::darkGreen
|
||||
valueSize > MAX_SCRIPT_ELEMENT_SIZE ? QColor(230, 120, 105) : QColor(150, 227, 138)
|
||||
);
|
||||
|
||||
ui->valueCounter->setPalette(
|
||||
|
@ -174,7 +174,7 @@ void KevaDialog::onNamespaceChanged(const QString& nameSpace)
|
||||
isValidNamespace = true;
|
||||
} else {
|
||||
ui->createButton->setEnabled(false);
|
||||
ui->bookmarkNamespace->setIcon(QIcon(":/icons/star_empty"));
|
||||
ui->bookmarkNamespace->setIcon(platformStyle->SingleColorIcon(":/icons/star_empty"));
|
||||
}
|
||||
|
||||
if (!isValidNamespace) {
|
||||
@ -184,7 +184,7 @@ void KevaDialog::onNamespaceChanged(const QString& nameSpace)
|
||||
if (bookmarks->isBookmarked(namespaceStr)) {
|
||||
ui->bookmarkNamespace->setIcon(QIcon(":/icons/star"));
|
||||
} else {
|
||||
ui->bookmarkNamespace->setIcon(QIcon(":/icons/star_empty"));
|
||||
ui->bookmarkNamespace->setIcon(platformStyle->SingleColorIcon(":/icons/star_empty"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ void KevaDialog::on_bookmarkNamespace_clicked()
|
||||
if (index >= 0) {
|
||||
// Remove bookmark
|
||||
array.removeAt(index);
|
||||
ui->bookmarkNamespace->setIcon(QIcon(":/icons/star_empty"));
|
||||
ui->bookmarkNamespace->setIcon(platformStyle->SingleColorIcon(":/icons/star_empty"));
|
||||
} else {
|
||||
// Add bookmark
|
||||
QJsonObject entry;
|
||||
|
@ -79,6 +79,7 @@ PlatformStyle::PlatformStyle(const QString &_name, bool _imagesOnButtons, bool _
|
||||
textColor(0,0,0)
|
||||
{
|
||||
// Determine icon highlighting color
|
||||
/* src/qt/bitcoin.cpp:85
|
||||
if (colorizeIcons) {
|
||||
const QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight));
|
||||
const QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText));
|
||||
@ -90,7 +91,10 @@ PlatformStyle::PlatformStyle(const QString &_name, bool _imagesOnButtons, bool _
|
||||
else
|
||||
colorbase = colorHighlightFg;
|
||||
singleColor = colorbase;
|
||||
}
|
||||
}*/
|
||||
|
||||
singleColor = QColor(150, 120, 200);
|
||||
|
||||
// Determine text color
|
||||
textColor = QColor(QApplication::palette().color(QPalette::WindowText));
|
||||
}
|
||||
@ -141,4 +145,3 @@ const PlatformStyle *PlatformStyle::instantiate(const QString &platformId)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
|
||||
|
||||
// draw a slightly radial gradient
|
||||
QRadialGradient gradient(QPoint(0,0), splashSize.width()/devicePixelRatio);
|
||||
gradient.setColorAt(0, QColor(255,255,255,50));
|
||||
gradient.setColorAt(0, QColor(255,255,255,100));
|
||||
gradient.setColorAt(1, QColor(0,0,0,255));
|
||||
QRect rGradient(QPoint(0,0), splashSize);
|
||||
pixPaint.fillRect(rGradient, gradient);
|
||||
@ -167,7 +167,7 @@ static void InitMessage(SplashScreen *splash, const std::string &message)
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QString, QString::fromStdString(message)),
|
||||
Q_ARG(int, Qt::AlignBottom|Qt::AlignHCenter),
|
||||
Q_ARG(QColor, Qt::gray));
|
||||
Q_ARG(QColor, QColor(210, 210, 210)));
|
||||
}
|
||||
|
||||
static void ShowProgress(SplashScreen *splash, const std::string &title, int nProgress, bool resume_possible)
|
||||
|
@ -107,15 +107,15 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *)
|
||||
if(!vSamplesIn.empty()) {
|
||||
QPainterPath p;
|
||||
paintPath(p, vSamplesIn);
|
||||
painter.fillPath(p, QColor(0, 255, 0, 128));
|
||||
painter.setPen(Qt::green);
|
||||
painter.fillPath(p, QColor(150, 227, 138, 128));
|
||||
painter.setPen(QColor(150, 227, 138));
|
||||
painter.drawPath(p);
|
||||
}
|
||||
if(!vSamplesOut.empty()) {
|
||||
QPainterPath p;
|
||||
paintPath(p, vSamplesOut);
|
||||
painter.fillPath(p, QColor(255, 0, 0, 128));
|
||||
painter.setPen(Qt::red);
|
||||
painter.fillPath(p, QColor(230, 120, 105, 128));
|
||||
painter.setPen(QColor(230, 120, 105));
|
||||
painter.drawPath(p);
|
||||
}
|
||||
}
|
||||
|
@ -386,15 +386,15 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx
|
||||
switch(wtx->type)
|
||||
{
|
||||
case TransactionRecord::Generated:
|
||||
return QIcon(":/icons/tx_mined");
|
||||
return platformStyle->SingleColorIcon(":/icons/tx_mined");
|
||||
case TransactionRecord::RecvWithAddress:
|
||||
case TransactionRecord::RecvFromOther:
|
||||
return QIcon(":/icons/tx_input");
|
||||
return platformStyle->SingleColorIcon(":/icons/tx_input");
|
||||
case TransactionRecord::SendToAddress:
|
||||
case TransactionRecord::SendToOther:
|
||||
return QIcon(":/icons/tx_output");
|
||||
return platformStyle->SingleColorIcon(":/icons/tx_output");
|
||||
default:
|
||||
return QIcon(":/icons/tx_inout");
|
||||
return platformStyle->SingleColorIcon(":/icons/tx_inout");
|
||||
}
|
||||
}
|
||||
|
||||
@ -464,29 +464,29 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx)
|
||||
case TransactionStatus::OpenUntilDate:
|
||||
return COLOR_TX_STATUS_OPENUNTILDATE;
|
||||
case TransactionStatus::Unconfirmed:
|
||||
return QIcon(":/icons/transaction_0");
|
||||
return platformStyle->SingleColorIcon(":/icons/transaction_0");
|
||||
case TransactionStatus::Abandoned:
|
||||
return QIcon(":/icons/transaction_abandoned");
|
||||
return platformStyle->SingleColorIcon(":/icons/transaction_abandoned");
|
||||
case TransactionStatus::Confirming:
|
||||
switch(wtx->status.depth)
|
||||
{
|
||||
case 1: return QIcon(":/icons/transaction_1");
|
||||
case 2: return QIcon(":/icons/transaction_2");
|
||||
case 3: return QIcon(":/icons/transaction_3");
|
||||
case 4: return QIcon(":/icons/transaction_4");
|
||||
default: return QIcon(":/icons/transaction_5");
|
||||
case 1: return platformStyle->SingleColorIcon(":/icons/transaction_1");
|
||||
case 2: return platformStyle->SingleColorIcon(":/icons/transaction_2");
|
||||
case 3: return platformStyle->SingleColorIcon(":/icons/transaction_3");
|
||||
case 4: return platformStyle->SingleColorIcon(":/icons/transaction_4");
|
||||
default: return platformStyle->SingleColorIcon(":/icons/transaction_5");
|
||||
};
|
||||
case TransactionStatus::Confirmed:
|
||||
return QIcon(":/icons/transaction_confirmed");
|
||||
return platformStyle->SingleColorIcon(":/icons/transaction_confirmed");
|
||||
case TransactionStatus::Conflicted:
|
||||
return QIcon(":/icons/transaction_conflicted");
|
||||
return platformStyle->SingleColorIcon(":/icons/transaction_conflicted");
|
||||
case TransactionStatus::Immature: {
|
||||
int total = wtx->status.depth + wtx->status.matures_in;
|
||||
int part = (wtx->status.depth * 4 / total) + 1;
|
||||
return QIcon(QString(":/icons/transaction_%1").arg(part));
|
||||
return platformStyle->SingleColorIcon(QString(":/icons/transaction_%1").arg(part));
|
||||
}
|
||||
case TransactionStatus::NotAccepted:
|
||||
return QIcon(":/icons/transaction_0");
|
||||
return platformStyle->SingleColorIcon(":/icons/transaction_0");
|
||||
default:
|
||||
return COLOR_BLACK;
|
||||
}
|
||||
@ -495,7 +495,7 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx)
|
||||
QVariant TransactionTableModel::txWatchonlyDecoration(const TransactionRecord *wtx) const
|
||||
{
|
||||
if (wtx->involvesWatchAddress)
|
||||
return QIcon(":/icons/eye");
|
||||
return platformStyle->SingleColorIcon(":/icons/eye");
|
||||
else
|
||||
return QVariant();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user