Skip to content

Commit

Permalink
ENH: add focus border for fields, related to #211 and #209
Browse files Browse the repository at this point in the history
  • Loading branch information
dpizetta committed Jan 14, 2020
1 parent 1833f5b commit ea34bfe
Show file tree
Hide file tree
Showing 3 changed files with 9,998 additions and 9,908 deletions.
38 changes: 35 additions & 3 deletions qdarkstyle/qss/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,9 @@ QScrollBar {
border-radius: $SIZE_BORDER_RADIUS;
min-width: 8px;
}
&:focus {
border: $BORDER_SELECTION_NORMAL;
}
}

&:vertical {
Expand All @@ -547,7 +550,9 @@ QScrollBar {
border: $BORDER_SELECTION_LIGHT;
border-radius: $SIZE_BORDER_RADIUS;
min-height: 8px;

}
&:focus {
border: $BORDER_SELECTION_NORMAL;
}
}
}
Expand Down Expand Up @@ -666,6 +671,10 @@ QTextEdit {
color: $COLOR_FOREGROUND_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}

&:selected {
background: $COLOR_SELECTION_NORMAL;
color: $COLOR_BACKGROUND_NORMAL;
Expand All @@ -686,6 +695,10 @@ QPlainTextEdit {
color: $COLOR_FOREGROUND_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}

&:selected {
background: $COLOR_SELECTION_NORMAL;
color: $COLOR_BACKGROUND_NORMAL;
Expand Down Expand Up @@ -850,6 +863,10 @@ QAbstractSpinBox {
color: $COLOR_FOREGROUND_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}

&:selected {
background: $COLOR_SELECTION_NORMAL;
color: $COLOR_BACKGROUND_NORMAL;
Expand Down Expand Up @@ -1069,7 +1086,6 @@ QPushButton {

&:focus {
border: $BORDER_SELECTION_NORMAL;
color: $COLOR_FOREGROUND_LIGHT;
}

}
Expand Down Expand Up @@ -1247,6 +1263,10 @@ QComboBox {
border: $BORDER_SELECTION_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}

&:on {
selection-background-color: $COLOR_SELECTION_NORMAL;
}
Expand Down Expand Up @@ -1378,6 +1398,10 @@ QSlider {
background: $COLOR_SELECTION_LIGHT;
border: $BORDER_SELECTION_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}
}

&:vertical {
Expand All @@ -1392,6 +1416,10 @@ QSlider {
background: $COLOR_SELECTION_LIGHT;
border: $BORDER_SELECTION_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}
}
}
}
Expand Down Expand Up @@ -1424,8 +1452,12 @@ QLineEdit {
color: $COLOR_FOREGROUND_LIGHT;
}

&:focus {
border: $BORDER_SELECTION_NORMAL;
}

&:selected {
background: $COLOR_SELECTION_NORMAL;
background-color: $COLOR_SELECTION_NORMAL;
color: $COLOR_BACKGROUND_NORMAL;
}
}
Expand Down
75 changes: 64 additions & 11 deletions qdarkstyle/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ QScrollBar::handle:horizontal:hover {
min-width: 8px;
}

QScrollBar::handle:horizontal:focus {
border: 1px solid #1464A0;
}

QScrollBar::handle:vertical {
background-color: #787878;
border: 1px solid #32414B;
Expand All @@ -558,6 +562,10 @@ QScrollBar::handle:vertical:hover {
min-height: 8px;
}

QScrollBar::handle:vertical:focus {
border: 1px solid #1464A0;
}

QScrollBar::add-line:horizontal {
margin: 0px 0px 0px 0px;
border-image: url(":/qss_icons/rc/arrow_right_disabled.png");
Expand Down Expand Up @@ -659,6 +667,10 @@ QTextEdit:hover {
color: #F0F0F0;
}

QTextEdit:focus {
border: 1px solid #1464A0;
}

QTextEdit:selected {
background: #1464A0;
color: #32414B;
Expand All @@ -679,6 +691,10 @@ QPlainTextEdit:hover {
color: #F0F0F0;
}

QPlainTextEdit:focus {
border: 1px solid #1464A0;
}

QPlainTextEdit:selected {
background: #1464A0;
color: #32414B;
Expand Down Expand Up @@ -831,6 +847,10 @@ QAbstractSpinBox:hover {
color: #F0F0F0;
}

QAbstractSpinBox:focus {
border: 1px solid #1464A0;
}

QAbstractSpinBox:selected {
background: #1464A0;
color: #32414B;
Expand Down Expand Up @@ -1042,7 +1062,6 @@ QPushButton:hover {

QPushButton:focus {
border: 1px solid #1464A0;
color: #F0F0F0;
}

/* QToolButton ------------------------------------------------------------
Expand Down Expand Up @@ -1214,6 +1233,10 @@ QComboBox:hover {
border: 1px solid #148CD2;
}

QComboBox:focus {
border: 1px solid #1464A0;
}

QComboBox:on {
selection-background-color: #1464A0;
}
Expand Down Expand Up @@ -1328,6 +1351,10 @@ QSlider::handle:horizontal:hover {
border: 1px solid #148CD2;
}

QSlider::handle:horizontal:focus {
border: 1px solid #1464A0;
}

QSlider::handle:vertical {
background: #787878;
border: 1px solid #32414B;
Expand All @@ -1342,6 +1369,10 @@ QSlider::handle:vertical:hover {
border: 1px solid #148CD2;
}

QSlider::handle:vertical:focus {
border: 1px solid #1464A0;
}

/* QLineEdit --------------------------------------------------------------

https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlineedit
Expand Down Expand Up @@ -1371,8 +1402,12 @@ QLineEdit:hover {
color: #F0F0F0;
}

QLineEdit:focus {
border: 1px solid #1464A0;
}

QLineEdit:selected {
background: #1464A0;
background-color: #1464A0;
color: #32414B;
}

Expand Down Expand Up @@ -1800,14 +1835,14 @@ QTreeView:selected,
QListView:selected,
QTableView:selected,
QColumnView:selected {
background: #1464A0;
background-color: #1464A0;
color: #32414B;
}

QTreeView::hover,
QListView::hover,
QTableView::hover,
QColumnView::hover {
QTreeView:hover,
QListView:hover,
QTableView:hover,
QColumnView:hover {
background-color: #19232D;
border: 1px solid #148CD2;
}
Expand All @@ -1819,12 +1854,25 @@ QColumnView::item:pressed {
background-color: #1464A0;
}

QTreeView::item:hover,
QListView::item:hover,
QTableView::item:hover,
QColumnView::item:hover {
border: 1px solid #148CD2;
}

QTreeView::item:focus,
QListView::item:focus,
QTableView::item:focus,
QColumnView::item:focus {
border: 1px solid #1464A0;
}

QTreeView::item:selected:hover,
QListView::item:selected:hover,
QTableView::item:selected:hover,
QColumnView::item:selected:hover {
background: #1464A0;
color: #19232D;
border: 1px solid #148CD2;
}

QTreeView::item:selected:active,
Expand All @@ -1834,13 +1882,18 @@ QColumnView::item:selected:active {
background-color: #1464A0;
}

QTreeView::item:selected:focus,
QListView::item:selected:focus,
QTableView::item:selected:focus,
QColumnView::item:selected:focus {
border: 1px solid #1464A0;
}

QTreeView::item:!selected:hover,
QListView::item:!selected:hover,
QTableView::item:!selected:hover,
QColumnView::item:!selected:hover {
outline: 0;
color: #148CD2;
background-color: #32414B;
}

QTableCornerButton::section {
Expand Down
Loading

0 comments on commit ea34bfe

Please sign in to comment.