Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13711162
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Subscribers
None
View Options
diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h
index dc9709a2bd..1f4e682e86 100644
--- a/src/qt/guiconstants.h
+++ b/src/qt/guiconstants.h
@@ -1,54 +1,55 @@
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_GUICONSTANTS_H
#define BITCOIN_QT_GUICONSTANTS_H
/* Milliseconds between model updates */
static const int MODEL_UPDATE_DELAY = 250;
/* AskPassphraseDialog -- Maximum passphrase length */
static const int MAX_PASSPHRASE_SIZE = 1024;
/* BitcoinGUI -- Size of icons in status bar */
static const int STATUSBAR_ICONSIZE = 16;
static const bool DEFAULT_SPLASHSCREEN = true;
/* Invalid field background style */
#define STYLE_INVALID "background:#FF8080"
/* Transaction list -- unconfirmed transaction */
#define COLOR_UNCONFIRMED QColor(128, 128, 128)
/* Transaction list -- negative amount */
#define COLOR_NEGATIVE QColor(255, 0, 0)
/* Transaction list -- bare address (without label) */
#define COLOR_BAREADDRESS QColor(140, 140, 140)
/* Transaction list -- TX status decoration - open until date */
#define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255)
/* Transaction list -- TX status decoration - danger, tx needs attention */
#define COLOR_TX_STATUS_DANGER QColor(200, 100, 100)
/* Transaction list -- TX status decoration - default color */
#define COLOR_BLACK QColor(0, 0, 0)
/* Tooltips longer than this (in characters) are converted into rich text,
so that they can be word-wrapped.
*/
static const int TOOLTIP_WRAP_THRESHOLD = 80;
/* Maximum allowed URI length */
static const int MAX_URI_LENGTH = 255;
/* QRCodeDialog -- size of exported QR Code image */
#define QR_IMAGE_SIZE 350
/* Number of frames in spinner animation */
#define SPINNER_FRAMES 36
#define QAPP_ORG_NAME "BitcoinABC"
#define QAPP_ORG_DOMAIN "bitcoinabc.org"
#define QAPP_APP_NAME_DEFAULT "BitcoinABC-Qt"
#define QAPP_APP_NAME_TESTNET "BitcoinABC-Qt-testnet"
+#define QAPP_APP_NAME_REGTEST "BitcoinABC-Qt-regtest"
#endif // BITCOIN_QT_GUICONSTANTS_H
diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp
index f9f08f81a4..dac8e69067 100644
--- a/src/qt/networkstyle.cpp
+++ b/src/qt/networkstyle.cpp
@@ -1,86 +1,86 @@
// Copyright (c) 2014-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <qt/networkstyle.h>
#include <qt/guiconstants.h>
#include <QApplication>
static const struct {
const char *networkId;
const char *appName;
const int iconColorHueShift;
const int iconColorSaturationReduction;
const char *titleAddText;
} network_styles[] = {{"main", QAPP_APP_NAME_DEFAULT, 0, 0, ""},
{"test", QAPP_APP_NAME_TESTNET, 70, 30,
QT_TRANSLATE_NOOP("SplashScreen", "[testnet]")},
- {"regtest", QAPP_APP_NAME_TESTNET, 160, 30, "[regtest]"}};
+ {"regtest", QAPP_APP_NAME_REGTEST, 160, 30, "[regtest]"}};
static const unsigned network_styles_count =
sizeof(network_styles) / sizeof(*network_styles);
// titleAddText needs to be const char* for tr()
NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift,
const int iconColorSaturationReduction,
const char *_titleAddText)
: appName(_appName),
titleAddText(qApp->translate("SplashScreen", _titleAddText)) {
// load pixmap
QPixmap pixmap(":/icons/bitcoin");
if (iconColorHueShift != 0 && iconColorSaturationReduction != 0) {
// generate QImage from QPixmap
QImage img = pixmap.toImage();
int h, s, l, a;
// traverse though lines
for (int y = 0; y < img.height(); y++) {
QRgb *scL = reinterpret_cast<QRgb *>(img.scanLine(y));
// loop through pixels
for (int x = 0; x < img.width(); x++) {
// preserve alpha because QColor::getHsl doesn't return the
// alpha value
a = qAlpha(scL[x]);
QColor col(scL[x]);
// get hue value
col.getHsl(&h, &s, &l);
// rotate color on RGB color circle
// 70° should end up with the typical "testnet" green
h += iconColorHueShift;
// change saturation value
if (s > iconColorSaturationReduction) {
s -= iconColorSaturationReduction;
}
col.setHsl(h, s, l, a);
// set the pixel
scL[x] = col.rgba();
}
}
// convert back to QPixmap
pixmap.convertFromImage(img);
}
appIcon = QIcon(pixmap);
trayAndWindowIcon = QIcon(pixmap.scaled(QSize(256, 256)));
}
const NetworkStyle *NetworkStyle::instantiate(const QString &networkId) {
for (unsigned x = 0; x < network_styles_count; ++x) {
if (networkId == network_styles[x].networkId) {
return new NetworkStyle(
network_styles[x].appName, network_styles[x].iconColorHueShift,
network_styles[x].iconColorSaturationReduction,
network_styles[x].titleAddText);
}
}
return nullptr;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Apr 27, 10:37 (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5573307
Default Alt Text
(5 KB)
Attached To
rSTAGING Bitcoin ABC staging
Event Timeline
Log In to Comment