mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 01:49:42 +02:00
refactor: remove core/ folder
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from interface.dialogs.theme import _theme_colors
|
||||
from PySide6.QtWidgets import QStyledItemDelegate
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
class HoverRowDelegate(QStyledItemDelegate):
|
||||
|
||||
def paint(self, painter, option, index):
|
||||
from interface.gui import MainWindow
|
||||
|
||||
opt = QtWidgets.QStyleOptionViewItem(option)
|
||||
option.state &= ~QtWidgets.QStyle.StateFlag.State_HasFocus
|
||||
option.state &= ~QtWidgets.QStyle.StateFlag.State_Selected
|
||||
|
||||
hovered_row = MainWindow._instance._hovered_row if MainWindow._instance else -1
|
||||
if index.row() == hovered_row:
|
||||
painter.save()
|
||||
painter.fillRect(option.rect, _theme_colors()["hover"])
|
||||
painter.restore()
|
||||
super().paint(painter, opt, index)
|
||||
Reference in New Issue
Block a user