Skip to content

Commit

Permalink
Adjust stylesheets and scale icons to improve HiDPI display
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Oct 5, 2020
1 parent 3b7a596 commit ff80e9c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ void BitcoinGUI::createToolBars()
toolbar->setMovable(false);
toolbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setIconSize(QSize(50, 25));
toolbar->setIconSize(QSize(50 * logicalDpiX() / 96, 25 * logicalDpiX() / 96));
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
Expand Down
18 changes: 7 additions & 11 deletions src/qt/res/stylesheets/dark_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,20 @@ QFrame[frameShape="5"] {

QToolButton {
color: white;
background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(49,54,59), stop: 1 rgb(49,54,59));
border:none;
background-color: rgb(49,54,59);
}

QToolButton:hover {
background-color:qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(65,0,127), stop: 1 rgb(65,0,127));
color:white;
border:none;
background-color: rgb(65,0,127);
}

QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(64,68,82), stop: 1 rgb(64,68,82));
border:none;
background-color: rgb(64,68,82);
}

QToolButton:checked:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(65,0,127), stop: 1 rgb(65,0,127));
border:none;
background-color: rgb(65,0,127);
}

QMenuBar {
Expand Down Expand Up @@ -407,7 +403,7 @@ QCheckBox{
#toolbar {
border:none;
padding-top:1.25em;
min-width:8em;
min-width:8.5em;
height:100%;
color: white;
}
Expand All @@ -426,8 +422,8 @@ QCheckBox{
}

QToolBar#toolbar QToolButton {
padding-left:1em;
padding-right:1em;
padding-left:1.25em;
padding-right:1.25em;
padding-top:0.5em;
padding-bottom:0.5em;
margin:0.25em;
Expand Down
18 changes: 7 additions & 11 deletions src/qt/res/stylesheets/light_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,20 @@ BitcoinAmountField{

QToolButton {
color: black;
background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(240,240,240), stop: 1 rgb(240,240,240));
border:none;
background-color: rgb(240,240,240);
}

QToolButton:hover {
background-color:qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(65,0,127), stop: 1 rgb(65,0,127));
color:white;
border:none;
background-color: rgb(65,0,127);
}

QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(200,200,200), stop: 1 rgb(200,200,200));
border:none;
background-color: rgb(200,200,200);
}

QToolButton:checked:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 rgb(65,0,127), stop: 1 rgb(65,0,127));
border:none;
background-color: rgb(65,0,127);
}

QMenuBar {
Expand Down Expand Up @@ -380,7 +376,7 @@ QListWidget{
#toolbar {
border:none;
padding-top:1.25em;
min-width:8em;
min-width:8.5em;
height:100%;
color: black;
}
Expand All @@ -399,8 +395,8 @@ QListWidget{
}

QToolBar#toolbar QToolButton {
padding-left:1em;
padding-right:1em;
padding-left:1.25em;
padding-right:1.25em;
padding-top:0.5em;
padding-bottom:0.5em;
margin:0.25em;
Expand Down
20 changes: 17 additions & 3 deletions src/qt/res/stylesheets/native_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ QMainWindow {
font-family: "Inter";
}

QMenuBar {
background: rgb(240,240,240);
color: black;
}

QMenuBar::item {
padding-bottom:0.5em;
padding-top:0.5em;
padding-left:1em;
padding-right:1em;
color: black;
background-color: rgb(240,240,240);
}

QTextEdit {
background-color: white;
}
Expand All @@ -24,7 +38,7 @@ QTextEdit {
#toolbar {
border:none;
padding-top:1.25em;
min-width:8em;
min-width:8.5em;
height:100%;
}

Expand All @@ -41,8 +55,8 @@ QTextEdit {
}

QToolBar#toolbar QToolButton {
padding-left:1em;
padding-right:1em;
padding-left:1.25em;
padding-right:1.25em;
padding-top:0.5em;
padding-bottom:0.5em;
margin:0.25em;
Expand Down

0 comments on commit ff80e9c

Please sign in to comment.