Use standard palette for alternating table rows

This commit is contained in:
Rebecca Breu 2024-02-27 21:31:46 +01:00
parent 052bfb9fa5
commit 2a9487a5e9
2 changed files with 2 additions and 9 deletions

View file

@ -22,6 +22,7 @@ COPYRIGHT = 'Copyright © 2021-2023 Rebecca Breu'
COLORS = {
# Qt:
'Active:Base': (60, 60, 60),
'Active:AlternateBase': (70, 70, 70),
'Active:Window': (40, 40, 40),
'Active:Button': (40, 40, 40),
'Active:Text': (200, 200, 200),
@ -37,6 +38,4 @@ COLORS = {
'Scene:Selection': (116, 234, 231),
'Scene:Canvas': (60, 60, 60),
'Scene:Text': (200, 200, 200),
'Table:AlternativeRow': (70, 70, 70),
}

View file

@ -322,13 +322,6 @@ class KeyboardShortcutsProxy(QtCore.QSortFilterProxyModel):
self.setFilterCaseSensitivity(
QtCore.Qt.CaseSensitivity.CaseInsensitive)
def data(self, index, role):
if (role == QtCore.Qt.ItemDataRole.BackgroundRole
and index.row() % 2):
return QtGui.QColor(*constants.COLORS['Table:AlternativeRow'])
else:
return super().data(index, role)
def setData(self, index, value, role, remove_from_other=None):
result = self.sourceModel().setData(
self.mapToSource(index),
@ -352,6 +345,7 @@ class KeyboardShortcutsView(QtWidgets.QTableView):
1, QtWidgets.QHeaderView.ResizeMode.ResizeToContents)
self.setSelectionMode(
QtWidgets.QHeaderView.SelectionMode.SingleSelection)
self.setAlternatingRowColors(True)
settings_events.restore_keyboard_defaults.connect(
self.on_restore_defaults)