Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Wallet Dark Mode #925

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ RES_ICONS = \
qt/res/icons/[email protected] \
qt/res/icons/ic-copy.png \
qt/res/icons/simbol.png \
qt/res/icons/simbol-white.png \
qt/res/icons/[email protected] \
qt/res/icons/ic-watch-off.png \
qt/res/icons/ic-close-active.png \
Expand Down Expand Up @@ -698,7 +699,8 @@ RES_IMAGES =
RES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png)

RES_CSS = \
qt/res/css/main.css
qt/res/css/main.css \
qt/res/css/main-dark.css

BITCOIN_RC = qt/res/bitcoin-qt-res.rc

Expand Down
8 changes: 8 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty

this->setStyleSheet(GUIUtil::loadStyleSheet());

if(!gArgs.GetArg("-darkmode", "").empty()){
QPalette pal= QApplication::palette();
pal.setColor(QPalette::Text, QColor("#ababaa"));
pal.setColor(QPalette::Window, QColor(Qt::black));
pal.setColor(QPalette::Background, QColor(Qt::black));
QApplication::setPalette(pal);
}

QSettings settings;
if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) {
// Restore failed (perhaps missing setting), center the window
Expand Down
41 changes: 0 additions & 41 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@
</property>
<item>
<widget class="QFrame" name="txes_container">
<property name="styleSheet">
<string notr="true">#txes_container{
background-color:white;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
<property name="spacing">
<number>0</number>
Expand Down Expand Up @@ -146,9 +141,6 @@
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#comboFilter{\n margin-right:6px;\n}</string>
</property>
<property name="currentText">
<string/>
</property>
Expand All @@ -171,11 +163,6 @@
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">#comboSort{
margin-right:6px;
}</string>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -338,34 +325,6 @@ background-color:#0e45b4;
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">QListView {
background: transparent;
}

/* Works for both QListView and QListWidget */
QListView::item {
/* Won't work without borders set */
border: 0px;
padding: 10px;
}

QListView::item:selected
{
background-color:#a10;
}

/* For icon only */
QListView::icon {
left: 10px;
}

/* For text only */
QListView::text {
left: 13px;
}
</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down
97 changes: 0 additions & 97 deletions src/qt/forms/sendcoinsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
<property name="windowTitle">
<string>Send veil</string>
</property>
<property name="styleSheet">
<string notr="true">border:none;
padding:0px;
margin:0px;
background-color:white;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
Expand All @@ -37,10 +31,6 @@ background-color:white;</string>
</property>
<item>
<widget class="QFrame" name="frame_1">
<property name="styleSheet">
<string notr="true">background-color:white;
border:none;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down Expand Up @@ -438,35 +428,6 @@ margin:0px;</string>
<property name="toolTip">
<string>Clear all fields of the form.</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
border-radius: 6px;
border: 1px solid #707070;
background-color:#ffffff;
color: #707070;
font-size: 14px;
padding:8;
text-align:center !important;
}

QPushButton:checked {
border: 1px solid #105aef;
background-color:#105aef;
color: #FFFFFF;
}

QPushButton:hover {
border: 1px solid #bababa;
background-color:#bababa;
color: #FFFFFF;
}

QPushButton:unchecked {
border: 1px solid #707070;
background-color:#ffffff;
color: #707070;
}</string>
</property>
<property name="text">
<string>Clear All</string>
</property>
Expand All @@ -484,35 +445,6 @@ QPushButton:unchecked {
<property name="toolTip">
<string>Send to multiple recipients at once</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
border-radius: 6px;
border: 1px solid #707070;
background-color:#ffffff;
color: #707070;
font-size: 14px;
padding:8;
text-align:center !important;
}

QPushButton:checked {
border: 1px solid #105aef;
background-color:#105aef;
color: #FFFFFF;
}

QPushButton:hover {
border: 1px solid #bababa;
background-color:#bababa;
color: #FFFFFF;
}

QPushButton:unchecked {
border: 1px solid #707070;
background-color:#ffffff;
color: #707070;
}</string>
</property>
<property name="text">
<string>Add Recipient</string>
</property>
Expand All @@ -527,35 +459,6 @@ QPushButton:unchecked {
</item>
<item>
<widget class="QPushButton" name="pushButtonCoinControl">
<property name="styleSheet">
<string notr="true">QPushButton {
border-radius: 6px;
border: 1px solid #707070;
background-color:#ffffff;
color: #707070;
font-size: 14px;
padding:8;
text-align:center !important;
}

QPushButton:checked {
border: 1px solid #105aef;
background-color:#105aef;
color: #FFFFFF;
}

QPushButton:hover {
border: 1px solid #bababa;
background-color:#bababa;
color: #FFFFFF;
}

QPushButton:unchecked {
border: 1px solid #707070;
background-color:#ffffff;
color: #707070;
}</string>
</property>
<property name="text">
<string>Coin Control</string>
</property>
Expand Down
9 changes: 7 additions & 2 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ namespace GUIUtil {

QString loadStyleSheet(){
QFile file(":/css/main");
QFile fileDark(":/css/main-dark");
QString stylesheet = QString();
if(file.open(QFile::ReadOnly)){
return QLatin1String(file.readAll());
stylesheet += QLatin1String(file.readAll());
}
return QString();
if(fileDark.open(QFile::ReadOnly) && !gArgs.GetArg("-darkmode", "").empty()){
stylesheet += QLatin1String(fileDark.readAll());
}
return stylesheet;
}

QString dateTimeStr(const QDateTime &date)
Expand Down
Loading