Skip to content

Commit

Permalink
Make Night Mapping theme hidpi-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 1, 2019
1 parent 3c94d2f commit aa7d4a7
Showing 1 changed file with 70 additions and 40 deletions.
110 changes: 70 additions & 40 deletions resources/themes/Night Mapping/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand All @@ -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;
}


Expand All @@ -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;
Expand All @@ -127,7 +133,7 @@ QTextEdit, QPlainTextEdit

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

QToolButton
{
padding: 2px;
padding: 0.1em;
border-width: 1px;
border-color: @itembackground;
border-style: solid;
Expand All @@ -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;
Expand All @@ -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
{
Expand All @@ -190,7 +198,7 @@ QComboBox {
border-style: solid;
border: 1px solid #1e1e1e;
border-radius: 0px;
padding: 3px;
padding: 0.1em;
}


Expand All @@ -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,
Expand All @@ -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;
Expand All @@ -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;
}


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

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

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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -434,7 +452,7 @@ QTabBar::tab:bottom {

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

QTabBar::tab:selected
Expand Down Expand Up @@ -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;
}

/* ==================================================================================== */
Expand All @@ -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;
}

/* ==================================================================================== */
Expand All @@ -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;
}

/* ==================================================================================== */
Expand All @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}

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

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

0 comments on commit aa7d4a7

Please sign in to comment.