This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt5.QtCore import QModelIndex, QPoint, QSize, Qt | |
from PyQt5.QtGui import QTextDocument, QAbstractTextDocumentLayout, QPainter, QLinearGradient, QColor, QPalette | |
from PyQt5.QtWidgets import QStyledItemDelegate, QStyle, QStyleOptionViewItem | |
def find_colors(option: QStyleOptionViewItem, even_row: bool): | |
if option.state & QStyle.State_Active and option.state & QStyle.State_Selected: | |
text_color = option.palette.color(QPalette.Active, QPalette.HighlightedText) | |
bg_color = option.palette.color(QPalette.Active, QPalette.Highlight) | |
elif option.state & QStyle.State_Selected: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import ctypes | |
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import Gtk, Gdk | |
gi.require_version('GL', '1.0') | |
from OpenGL import GL, GLX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One CLI to format the code tree - https://github.com/numtide/treefmt | |
# Do not exit with error if a configured formatter is missing | |
# Env $TREEFMT_ALLOW_MISSING_FORMATTER | |
# allow-missing-formatter = false | |
# The file into which a cpu profile will be written | |
# Env $TREEFMT_CPU_PROFILE | |
# cpu-profile = ./cpu.pprof |