Skip to content
Permalink
Browse files

Make Night Mapping theme hidpi-compatible

  • Loading branch information
nirvn committed Dec 31, 2018
1 parent 0d52194 commit c67e590e6e69480f0f64a4f69502e8155c038d6b
Showing with 70 additions and 40 deletions.
  1. +70 −40 resources/themes/Night Mapping/style.qss
@@ -46,7 +46,7 @@ QMenuBar::item:pressed
}

QAbstractSpinBox {
padding: 3px 0px 3px 3px;
padding: 0.1em 0em 0.1em 0.1em;
border: 1px solid #222;
border-radius:0px;
background-color: @darkgradient;
@@ -56,14 +56,20 @@ QAbstractSpinBox {
QAbstractSpinBox::up-button {
subcontrol-origin: border;
subcontrol-position: top right;
width: 16px;
padding-top:-0.2em;
padding-right:0.05em;
width: 0.8em;
height: 1.2em;
image: url(@theme_path/icons/arrow-up.svg);
}

QAbstractSpinBox::down-button {
subcontrol-origin: border;
subcontrol-position: bottom right;
width: 16px;
padding-top:0.2em;
padding-right:0.05em;
width: 0.8em;
height: 1.2em;
image: url(@theme_path/icons/arrow-down.svg);
}

@@ -76,21 +82,21 @@ QMenu
{
background: #444;
border: 1px solid #222;
padding: 4px;
padding-right: 0px;
padding: 0.2em;
padding-right: 0em;
}

QMenu::item
{
background: transparent;
padding: 5px 20px 5px 20px;
padding: 0.2em 1.3em 0.2em 1.3em;
}

QMenu::item:disabled
{
color: #555;
background: transparent;
padding: 2px 20px 2px 20px;
padding: 0.2em 1.3em 0.2em 1.3em;
}


@@ -108,15 +114,15 @@ QWidget:disabled

QLineEdit
{
padding: 3px;
padding: 0.1em;
border: 1px solid #111;
background-color: #888;
color: #111;
}

QTextEdit, QPlainTextEdit
{
padding: 3px;
padding: 0.1em;
border-width: 1px;
border-color: @itemdarkbackground;
border-style: solid;
@@ -127,7 +133,7 @@ QTextEdit, QPlainTextEdit

QPushButton
{
padding: 3px;
padding: 0.1em;
border-width: 1px;
border-color: @itembackground;
border-style: solid;
@@ -138,7 +144,7 @@ QPushButton

QToolButton
{
padding: 2px;
padding: 0.1em;
border-width: 1px;
border-color: @itembackground;
border-style: solid;
@@ -148,10 +154,10 @@ QToolButton
}
QToolButton[popupMode="1"]
{
padding-right: 18px;
padding-right: 0.9em;
}
QToolButton::menu-button {
width: 14px;
width: 0.8em;
border-width: 1px;
border-color: none;
border-radius: 0px;
@@ -172,6 +178,8 @@ QToolButton:checked
QToolButton::menu-arrow
{
image: url(@theme_path/icons/arrow-down.svg);
width: 0.8em;
height: 1.2em;
}
QToolBar QToolButton, QToolButton::menu-button
{
@@ -190,7 +198,7 @@ QComboBox {
border-style: solid;
border: 1px solid #1e1e1e;
border-radius: 0px;
padding: 3px;
padding: 0.1em;
}


@@ -199,8 +207,8 @@ QComboBox:hover,QPushButton:hover,QToolButton:hover,QAbstractSpinBox:hover {
}

QComboBox:on {
padding-top: 1px;
padding-left: 3px;
padding: 0.1em;
padding-left: 0.2em;
background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #555,
stop: 0.1 #4C4C4C,
@@ -222,7 +230,7 @@ QComboBox:editable QLineEdit {
QComboBox QAbstractItemView, QComboBox QListView {
border: none;
border-radius: 0px;
padding: 3px;
padding: 0.1em;
background: @itemdarkbackground;
color: @text;
selection-background-color: @selection;
@@ -231,13 +239,15 @@ QComboBox QAbstractItemView, QComboBox QListView {
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
width: 0.8em;
border: 0px;
}

QComboBox::down-arrow
{
image: url(@theme_path/icons/arrow-down.svg);
width: 0.8em;
height: 1.2em;
}


@@ -258,7 +268,7 @@ QTextEdit:focus

QScrollBar:horizontal {
background-color: #333;
height: 8px;
height: 0.5em;
margin: 0px;
padding: 0px;
}
@@ -276,7 +286,7 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {

QScrollBar:vertical {
background-color: #333;
width: 8px;
width: 0.5em;
margin: 0;
}

@@ -294,14 +304,14 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {

QSizeGrip
{
width: 1px;
width: 0.1em;
}

QHeaderView::section
{
/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565);*/
color: @text;
padding-left: 4px;
padding-left: 0.5em;
border: 1px solid #6c6c6c;
}
QDockWidget
@@ -317,9 +327,9 @@ QDockWidget::separator
QDockWidget::title
{
text-align: center;
spacing: 3px; /* spacing between items in the tool bar */
spacing: 0.1em; /* spacing between items in the tool bar */
background-color: @background;
font-weight: bold;
font-weight: bold;
}

QDockWidget::close-button, QDockWidget::float-button
@@ -342,19 +352,19 @@ QMainWindow::separator
{
/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434);*/
color: white;
padding-left: 4px;
padding-left: 0.2em;
border: 0px solid #4c4c4c;
spacing: 3px; /* spacing between items in the tool bar */
spacing: 0.1m; /* spacing between items in the tool bar */
}

QMainWindow::separator:hover
{

/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f);*/
color: white;
padding-left: 4px;
padding-left: 0.2em;
border: 1px solid #6c6c6c;
spacing: 3px; /* spacing between items in the tool bar */
spacing: 0.1em; /* spacing between items in the tool bar */
}

QToolBar {
@@ -365,21 +375,29 @@ QToolBar {
QToolBar::handle:horizontal
{
image: url(@theme_path/icons/handle-horizontal.svg);
width: 0.2em;
height: 0.5em;
}

QToolBar::handle:vertical
{
image: url(@theme_path/icons/handle-vertical.svg);
width: 0.5em;
height: 0.2em;
}

QToolBar::separator:horizontal
{
image: url(@theme_path/icons/separator-horizontal.svg);
width: 0.2em;
height: 0.5em;
}

QToolBar::separator:vertical
{
image: url(@theme_path/icons/separator-vertical.svg);
width: 0.5em;
height: 0.2em;
}

QMenu::separator
@@ -410,11 +428,11 @@ QTabBar::tab {
border: 1px solid @itemdarkbackground;
border-bottom: none;
background-color: @background;
padding-left: 10px;
padding-right: 10px;
padding-top: 3px;
padding-bottom: 2px;
margin-right: -1px;
padding-left: 0.8em;
padding-right: 0.8em;
padding-top: 0.1em;
padding-bottom: 0.1em;
margin-right: -0.05em;
}

QTabBar::tab:last
@@ -434,7 +452,7 @@ QTabBar::tab:bottom {

QTabBar::tab:!selected
{
margin-top: 5px;
margin-top: 0.3em;
}

QTabBar::tab:selected
@@ -467,11 +485,15 @@ QGroupBox::title {
QGroupBox::indicator:unchecked {
border: 1px solid @background;
image: url(@theme_path/icons/qcheckbox-unchecked.svg);
width:0.8em;
height:0.8em;
}

QGroupBox::indicator:checked {
border: 1px solid @background;
image: url(@theme_path/icons/qcheckbox-checked.svg);
width:0.8em;
height:0.8em;
}

/* ==================================================================================== */
@@ -481,11 +503,15 @@ QGroupBox::indicator:checked {
QRadioButton::indicator:unchecked {
border: 1px solid @background;
image: url(@theme_path/icons/qradiobox-unchecked.svg);
width:0.8em;
height:0.8em;
}

QRadioButton::indicator:checked {
border: 1px solid @background;
image: url(@theme_path/icons/qradiobox-checked.svg);
width:0.8em;
height:0.8em;
}

/* ==================================================================================== */
@@ -495,11 +521,15 @@ QRadioButton::indicator:checked {
QCheckBox::indicator:unchecked {
border: 1px solid @background;
image: url(@theme_path/icons/qcheckbox-unchecked.svg);
width:0.8em;
height:0.8em;
}

QCheckBox::indicator:checked {
border: 1px solid @background;
image: url(@theme_path/icons/qcheckbox-checked.svg);
width:0.8em;
height:0.8em;
}

/* ==================================================================================== */
@@ -509,22 +539,22 @@ QCheckBox::indicator:checked {
QSlider::groove:horizontal,
QSlider::groove:vertical {
border: 1px solid @itemdarkbackground;
height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
height: 0.4em; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background-color: @itembackground;
margin: 2px 0;
}

QSlider::handle:horizontal {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
border: 1px solid itemdarkbackground;
width: 18px;
width: 1em;
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
border-radius: 0px;
}
QSlider::handle:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
border: 1px solid itemdarkbackground;
height: 18px;
height: 1em;
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
border-radius: 0px;
}
@@ -594,7 +624,7 @@ QTreeView#viewRules::item
{
border-top: 0.5px solid rgba(108,108,108,50);
border-bottom: 0.5px solid rgba(108,108,108,50);
padding: 1px 0px 1px 0px;
padding: 0.1em 0em 0.1em 0em;
}

QgsLayerTreeView::indicator:unchecked,
@@ -626,7 +656,7 @@ QHeaderView::section {
background-color: @background;
color: @text;
border-right: 1px solid @itemdarkbackground;
padding: 0 0 2px 3px
padding: 0 0 0.1em 0.2em;
}

/* ==================================================================================== */
@@ -653,5 +683,5 @@ QListWidget#mOptionsListWidget {
}

QListWidget#mOptionsListWidget::item {
padding: 3px;
padding: 0.1em;
}

0 comments on commit c67e590

Please sign in to comment.
You can’t perform that action at this time.