Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto

pupgui2/resources/themes/steamdeck/__init__.py binary
3 changes: 3 additions & 0 deletions pupgui2/resources/themes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import pupgui2.resources.themes.steamdeck as steamdeck

__all__ = ["steamdeck"]
28 changes: 0 additions & 28 deletions pupgui2/resources/themes/steamdeck.qss

This file was deleted.

159 changes: 159 additions & 0 deletions pupgui2/resources/themes/steamdeck/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.8.2
# WARNING! All changes made in this file will be lost!

from PySide6 import QtCore

qt_resource_data = b"\
\x00\x00\x02\xb5\
\x00\
\x00\x0b\xc1x\x9c\xd5VQo\x9b0\x10~\xcf\xafp\
3M\xda*\x91\x10\xa0I\xe3\xbcu\xad\xb4I\xd3\xba\
j\xd1\xf6\xec\xe0\x0bX\x01\x8cl\xd3\xa4\xab\xf6\xdfw\
\x04H\x02\x84\xa8\xdbZi\xe5\x05\xe9l\x7f\xf7}w\
\xf7\x19\x86\xe7d\x1e\x0aM\x96\x22\x02\x82o\x96\x19i\
\x05\x90\x80b\x068Y*\x19\x93\xbe6\x0f\x11\xe8\x10\
\xc0\x0c\xd2\x87>9\x1f\xf6\x86\xe7\xe4\xfa\x96|\xb9\x9d\
\x93\x9b\xebO\xf3\xb3\xb3\xb3<\xd8\xbb\xfb!x\x00\x86\
<\xf6\x08>\xbe\x8c\xa4\xa2\xe4\x0dl\x9f\xd96\xb6`\
\xfe*P2K\xb8U-\x8f&#\xee\x5c\x14\xcbK\
\x99\x18k\x0d\x22\x08\x0d%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e\x00s\x00o\x00u\x00r\x00c\x00e\x00s\
\x00\x06\
\x07\xae\xc3\xc3\
\x00t\
\x00h\x00e\x00m\x00e\x00s\
\x00\x09\
\x0b\x83^\xdb\
\x00s\
\x00t\x00e\x00a\x00m\x00d\x00e\x00c\x00k\
\x00\x0e\
\x03\xc2\xd5\xc3\
\x00s\
\x00t\x00y\x00l\x00e\x00s\x00h\x00e\x00e\x00t\x00.\x00q\x00s\x00s\
\x00\x13\
\x0a4fG\
\x00i\
\x00c\x00o\x00n\x00-\x00d\x00o\x00w\x00n\x00-\x00a\x00r\x00r\x00o\x00w\x00.\x00s\
\x00v\x00g\
\x00\x11\
\x01R\xb3\xa7\
\x00i\
\x00c\x00o\x00n\x00-\x00u\x00p\x00-\x00a\x00r\x00r\x00o\x00w\x00.\x00s\x00v\x00g\
\
\x00\x12\
\x0a$\xb9g\
\x00i\
\x00c\x00o\x00n\x00-\x00d\x00r\x00o\x00p\x00-\x00d\x00o\x00w\x00n\x00.\x00s\x00v\
\x00g\
"

qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x18\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00*\x00\x02\x00\x00\x00\x04\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x90\x00\x01\x00\x00\x00\x01\x00\x00\x03s\
\x00\x00\x01\x96+}A\xa5\
\x00\x00\x00B\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x96g\xd1\xce\x1d\
\x00\x00\x00\xb8\x00\x01\x00\x00\x00\x01\x00\x00\x04@\
\x00\x00\x01\x96+}A\xa5\
\x00\x00\x00d\x00\x01\x00\x00\x00\x01\x00\x00\x02\xb9\
\x00\x00\x01\x96+}A\xa5\
"

def qInitResources():
QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)

def qCleanupResources():
QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)

qInitResources()
4 changes: 4 additions & 0 deletions pupgui2/resources/themes/steamdeck/icon-down-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions pupgui2/resources/themes/steamdeck/icon-drop-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions pupgui2/resources/themes/steamdeck/icon-up-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
164 changes: 164 additions & 0 deletions pupgui2/resources/themes/steamdeck/stylesheet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
import os

import qstylizer.style
from PySide6.QtGui import QColor
from PySide6.scripts.pyside_tool import qt_tool_wrapper

verbose = True
compressLevel = 6
compressAlgo = "zlib"
compressThreshold = 0

color = QColor("#EEEEEE")
background_color_base = QColor("#171D25")
background_color_item = QColor("#282D36")
background_color_hover = QColor("#464D58")
background_color_pressed = QColor("#393F49")
background_color_disabled = QColor("#1D2026")

border_radius_base: int = 2

margin_min: int = 1

padding_min: int = 1
padding_base: int = 8
padding_item: int = 4

subcontrol_width_base: int = 18
subcontrol_width_sbar: int = subcontrol_width_base + padding_min
subcontrol_width_sbar_control: int = subcontrol_width_base - padding_min

style = qstylizer.style.StyleSheet()

style.QWidget.setValues(
color=color.name(),
backgroundColor=background_color_base.name(),
fontWeight=300,
)

for widget in (
style.QPushButton,
style.QListWidget,
style.QComboBox,
style.QToolButton,
style.QLineEdit,
style.QHeaderView.section,
):
widget.setValues(
backgroundColor=background_color_item.name(),
border=None,
borderRadius=f"{border_radius_base}px",
padding=f"{padding_base}px",
)

style.QListWidget.item.setValues(padding=f"{padding_item}px")
style.QPushButton.hover.setValues(backgroundColor=background_color_hover.name())
style.QPushButton.pressed.setValues(backgroundColor=background_color_pressed.name())
style.QPushButton.disabled.setValues(backgroundColor=background_color_disabled.name())

style.QHeaderView.setValues(padding=f"{padding_min}px")
style.QHeaderView.section.setValues(
padding=f"{padding_item}px",
backgroundColor=background_color_item.darker(125).name(),
)
style.QHeaderView.section.horizontal.setValues(marginLeft="0px", marginRight="2px")
style.QHeaderView.section.vertical.setValues(marginTop="0px", marginBottom="2px")
style.QTableView.item.setValues(marginLeft="1px")

style.QComboBox.dropDown.setValues(
subcontrolOrigin="border",
subcontrolPosition="top right",
padding=f"{padding_item / 2}px",
paddingRight=f"{padding_item}px",
border=None,
borderRadius=f"{border_radius_base}px",
width=f"{subcontrol_width_base - 2}px",
image='url(":/resources/themes/steamdeck/icon-drop-down.svg")',
)

style.QProgressBar.setValues(
backgroundColor=background_color_item.name(),
border=None,
borderRadius=f"{border_radius_base}px",
padding=f"{padding_item}px",
textAlign="center",
)
style.QProgressBar.chunk.setValues(
backgroundColor=background_color_item.lighter(150).name(),
borderWidth="0px",
width="2%",
)

style.QScrollBar.setValues(
padding=f"{padding_min}px",
borderRadius=f"{border_radius_base}px",
backgroundColor="transparent",
)
style.QScrollBar.vertical.setValues(
margin=f"{subcontrol_width_sbar}px 0px",
width=f"{subcontrol_width_sbar}px",
)
style.QScrollBar.horizontal.setValues(
margin=f"0px {subcontrol_width_sbar}px",
height=f"{subcontrol_width_sbar}px",
)

for subcontrol in (
style.QScrollBar.addLine.vertical,
style.QScrollBar.subLine.vertical,
style.QScrollBar.addLine.horizontal,
style.QScrollBar.subLine.horizontal,
):
subcontrol.setValues(
margin=f"{margin_min}px",
border=None,
borderRadius=f"{border_radius_base}px",
width=f"{subcontrol_width_sbar_control}px",
height=f"{subcontrol_width_sbar_control}px",
backgroundColor=background_color_item.name(),
subcontrolOrigin="margin",
)
style.QScrollBar.addLine.vertical.subcontrolPosition.setValue("bottom")
style.QScrollBar.subLine.vertical.subcontrolPosition.setValue("top")
style.QScrollBar.addLine.horizontal.subcontrolPosition.setValue("right")
style.QScrollBar.subLine.horizontal.subcontrolPosition.setValue("left")
style.QScrollBar.handle.setValues(
backgroundColor=background_color_item.name(),
borderRadius=f"{border_radius_base}px",
minWidth="30px",
minHeight="30px",
)
scrollbar_arrow_style = {
"width": "13px",
"height": "13px",
}
style.QScrollBar.upArrow.setValues(
**scrollbar_arrow_style,
image='url(":/resources/themes/steamdeck/icon-up-arrow.svg")',
)
style.QScrollBar.downArrow.setValues(
**scrollbar_arrow_style,
image='url(":/resources/themes/steamdeck/icon-down-arrow.svg")',
)


if __name__ == "__main__":
with open(os.path.join(os.path.dirname(__file__), "stylesheet.qss"), "w", encoding="utf-8") as stylesheet:
stylesheet.write(f'/* This file is auto-generated from "{os.path.basename(__file__)}" */\n')
stylesheet.write(f'/* DO NOT EDIT!!! */\n\n')
stylesheet.write(style.toString())

qt_tool_wrapper(
"rcc",
[
"-g",
"python",
"--compress", str(compressLevel),
"--compress-algo", compressAlgo,
"--threshold", str(compressThreshold),
"--verbose" if verbose else "",
os.path.join(os.path.dirname(__file__), "stylesheet.qrc"),
"-o", os.path.join(os.path.dirname(__file__), "__init__.py"),
],
True,
)
8 changes: 8 additions & 0 deletions pupgui2/resources/themes/steamdeck/stylesheet.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/resources/themes/steamdeck">
<file>icon-drop-down.svg</file>
<file>icon-down-arrow.svg</file>
<file>icon-up-arrow.svg</file>
<file>stylesheet.qss</file>
</qresource>
</RCC>
Loading