Merge pull request #6 from KeksPirates/main

Merge upstream
This commit is contained in:
noschXL
2026-03-09 05:52:35 +00:00
committed by GitHub
+13 -4
View File
@@ -91,10 +91,13 @@ def _table_stylesheet(view_type="QTableWidget"):
{view_type}::item:selected {{
background: {c["selected"]};
outline: none;
border: none;
border-bottom: 1px solid {c["border"]};
}}
{view_type}::item:focus {{
outline: none;
border: none;
border-bottom: 1px solid {c["border"]};
}}
QHeaderView {{
background: transparent;
@@ -427,21 +430,27 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
class HoverRowDelegate(QStyledItemDelegate):
def paint(self, painter, option, index):
opt = QtWidgets.QStyleOptionViewItem(option)
opt.state &= ~QtWidgets.QStyle.StateFlag.State_HasFocus
opt.state &= ~QtWidgets.QStyle.StateFlag.State_Selected
if index.row() == MainWindow._instance._hovered_row:
painter.save()
painter.fillRect(option.rect, _theme_colors()["hover"])
painter.fillRect(opt.rect, _theme_colors()["hover"])
painter.restore()
super().paint(painter, option, index)
super().paint(painter, opt, index)
class PauseResumeDelegate(QStyledItemDelegate):
clicked = Signal(int)
def paint(self, painter, option, index):
opt = QtWidgets.QStyleOptionViewItem(option)
opt.state &= ~QtWidgets.QStyle.StateFlag.State_HasFocus
opt.state &= ~QtWidgets.QStyle.StateFlag.State_Selected
if index.row() == MainWindow._instance._hovered_row:
painter.save()
painter.fillRect(option.rect, _theme_colors()["hover"])
painter.fillRect(opt.rect, _theme_colors()["hover"])
painter.restore()
super().paint(painter, option, index)
super().paint(painter, opt, index)
def setEditorData(self, editor, index):
button = editor.findChild(QtWidgets.QPushButton)