Skip to content

Commit c327dec

Browse files
committed
[themes] Properly style widget focus
1 parent 977d778 commit c327dec

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

resources/themes/Night Mapping/style.qss

+33-12
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,6 @@ QComboBox::indicator {
303303
selection-color:transparent;
304304
}
305305

306-
QLineEdit:focus
307-
{
308-
border: 1px solid @focus;
309-
}
310-
311-
312-
QTextEdit:focus
313-
{
314-
border: 1px solid @focus;
315-
}
316-
317306
/* ==================================================================================== */
318307
/* SCROLL BAR */
319308
/* ==================================================================================== */
@@ -732,6 +721,27 @@ QHeaderView::section {
732721
padding: 0 0 0.1em 0.2em;
733722
}
734723

724+
QToolButton[autoRaise=true]:focus:!pressed {
725+
border:1px solid @focusdark;
726+
}
727+
728+
QToolButton[autoRaise=false]:focus:!pressed {
729+
border:1px solid @focusdark;
730+
}
731+
732+
/* ==================================================================================== */
733+
/* FOCUS */
734+
/* ==================================================================================== */
735+
736+
QToolButton:focus, QPushButton:focus, QCheckBox:focus, QRadioButton:focus, QGroupBox:focus {
737+
outline:1px solid @focusdark;
738+
outline-radius: 0.2em;
739+
}
740+
741+
QComboBox:focus, QAbstractSpinBox:focus, QLineEdit:focus, QPlainTextEdit:focus, QTextEdit:focus {
742+
border:1px solid @focusdark;
743+
}
744+
735745
/* ==================================================================================== */
736746
/* QGIS-SPECIFIC TWEAKS */
737747
/* ==================================================================================== */
@@ -746,6 +756,10 @@ QgsColorButton:hover, QgsColorRampButton:hover, QgsSymbolButton:hover, QgsFontBu
746756
color:@itembackground;
747757
}
748758

759+
QgsColorButton:focus, QgsColorRampButton:focus, QgsSymbolButton:focus, QgsFontButton:focus {
760+
border:1px solid @focusdark;
761+
}
762+
749763
QgsMessageBar QLabel, QgsMessageBar QTextEdit, QMessageBar QToolButton, QMessageBar QToolButton::menu-button {
750764
background: transparent;
751765
border: none;
@@ -788,10 +802,17 @@ QgsMessageBar QScrollBar::down-arrow:vertical {
788802
image: url(@theme_path/icons/arrow-down.svg);
789803
}
790804

791-
QgsPropertyOverrideButton {
805+
QgsPropertyOverrideButton, QgsPropertyOverrideButton:hover, QgsPropertyOverrideButton:pressed {
806+
background: none;
807+
border: 1px solid rgba(0, 0, 0, 0%);
792808
padding: 0px;
793809
}
794810

811+
QgsPropertyOverrideButton:focus {
812+
border:1px solid @focusdark;
813+
border-radius: 0.2em;
814+
}
815+
795816
QListWidget#mOptionsListWidget {
796817
background-color: @itembackground;
797818
color: @text;

resources/themes/Night Mapping/variables.qss

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
@toggleoff: #535353
1111
@toggleon: #0f6e00
1212
@selection: #0f6e00
13+
@focusdark: rgba(215,128,26,100)
1314
@focus: #d7801a

0 commit comments

Comments
 (0)