mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
replaced style f older in project manager with single file
This commit is contained in:
parent
8bd06f1bd1
commit
148412f048
8 changed files with 1 additions and 279 deletions
|
|
@ -1,11 +1,9 @@
|
||||||
import os
|
|
||||||
from openpype import resources
|
|
||||||
from avalon.vendor import qtawesome
|
from avalon.vendor import qtawesome
|
||||||
|
|
||||||
|
|
||||||
class ResourceCache:
|
class ResourceCache:
|
||||||
colors = {
|
colors = {
|
||||||
"standard": "#333333",
|
"standard": "#bfccd6",
|
||||||
"new": "#2d9a4c",
|
"new": "#2d9a4c",
|
||||||
"warning": "#c83232"
|
"warning": "#c83232"
|
||||||
}
|
}
|
||||||
|
|
@ -68,31 +66,3 @@ class ResourceCache:
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_color(cls, color_name):
|
def get_color(cls, color_name):
|
||||||
return cls.colors[color_name]
|
return cls.colors[color_name]
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def style_fill_data(cls):
|
|
||||||
output = {}
|
|
||||||
for color_name, color_value in cls.colors.items():
|
|
||||||
key = "color:{}".format(color_name)
|
|
||||||
output[key] = color_value
|
|
||||||
return output
|
|
||||||
|
|
||||||
|
|
||||||
def load_stylesheet():
|
|
||||||
from . import qrc_resources
|
|
||||||
|
|
||||||
qrc_resources.qInitResources()
|
|
||||||
|
|
||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
style_path = os.path.join(current_dir, "style.css")
|
|
||||||
with open(style_path, "r") as style_file:
|
|
||||||
stylesheet = style_file.read()
|
|
||||||
|
|
||||||
for key, value in ResourceCache.style_fill_data().items():
|
|
||||||
replacement_key = "{" + key + "}"
|
|
||||||
stylesheet = stylesheet.replace(replacement_key, value)
|
|
||||||
return stylesheet
|
|
||||||
|
|
||||||
|
|
||||||
def app_icon_path():
|
|
||||||
return resources.pype_icon_filepath()
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 166 B |
Binary file not shown.
|
Before Width: | Height: | Size: 165 B |
|
|
@ -1,105 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Resource object code
|
|
||||||
#
|
|
||||||
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
|
|
||||||
#
|
|
||||||
# WARNING! All changes made in this file will be lost!
|
|
||||||
|
|
||||||
from PyQt5 import QtCore
|
|
||||||
|
|
||||||
|
|
||||||
qt_resource_data = b"\
|
|
||||||
\x00\x00\x00\xa5\
|
|
||||||
\x89\
|
|
||||||
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
|
|
||||||
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
|
|
||||||
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
|
|
||||||
\x02\x62\x4b\x47\x44\x00\x9c\x53\x34\xfc\x5d\x00\x00\x00\x09\x70\
|
|
||||||
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
|
|
||||||
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x0b\x02\x04\x6d\
|
|
||||||
\x98\x1b\x69\x00\x00\x00\x29\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
|
|
||||||
\x00\x8c\x0c\x0c\xff\xcf\xa3\x08\x18\x32\x32\x30\x20\x0b\x32\x1a\
|
|
||||||
\x32\x30\x30\x42\x98\x10\x41\x46\x43\x14\x13\x50\xb5\xa3\x01\x00\
|
|
||||||
\xd6\x10\x07\xd2\x2f\x48\xdf\x4a\x00\x00\x00\x00\x49\x45\x4e\x44\
|
|
||||||
\xae\x42\x60\x82\
|
|
||||||
\x00\x00\x00\xa6\
|
|
||||||
\x89\
|
|
||||||
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
|
|
||||||
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
|
|
||||||
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
|
|
||||||
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
|
|
||||||
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
|
|
||||||
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x08\x15\x3b\xdc\
|
|
||||||
\x3b\x0c\x9b\x00\x00\x00\x2a\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
|
|
||||||
\x00\x8c\x0c\x0c\x73\x3e\x20\x0b\xa4\x08\x30\x32\x30\x20\x0b\xa6\
|
|
||||||
\x08\x30\x30\x30\x42\x98\x10\xc1\x14\x01\x14\x13\x50\xb5\xa3\x01\
|
|
||||||
\x00\xc6\xb9\x07\x90\x5d\x66\x1f\x83\x00\x00\x00\x00\x49\x45\x4e\
|
|
||||||
\x44\xae\x42\x60\x82\
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
qt_resource_name = b"\
|
|
||||||
\x00\x08\
|
|
||||||
\x06\xc5\x8e\xa5\
|
|
||||||
\x00\x6f\
|
|
||||||
\x00\x70\x00\x65\x00\x6e\x00\x70\x00\x79\x00\x70\x00\x65\
|
|
||||||
\x00\x06\
|
|
||||||
\x07\x03\x7d\xc3\
|
|
||||||
\x00\x69\
|
|
||||||
\x00\x6d\x00\x61\x00\x67\x00\x65\x00\x73\
|
|
||||||
\x00\x12\
|
|
||||||
\x01\x2e\x03\x27\
|
|
||||||
\x00\x63\
|
|
||||||
\x00\x6f\x00\x6d\x00\x62\x00\x6f\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2e\x00\x70\x00\x6e\
|
|
||||||
\x00\x67\
|
|
||||||
\x00\x1b\
|
|
||||||
\x03\x5a\x32\x27\
|
|
||||||
\x00\x63\
|
|
||||||
\x00\x6f\x00\x6d\x00\x62\x00\x6f\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x5f\x00\x64\x00\x69\
|
|
||||||
\x00\x73\x00\x61\x00\x62\x00\x6c\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
qt_resource_struct_v1 = b"\
|
|
||||||
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
|
|
||||||
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
|
|
||||||
\x00\x00\x00\x16\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\
|
|
||||||
\x00\x00\x00\x28\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
|
|
||||||
\x00\x00\x00\x52\x00\x00\x00\x00\x00\x01\x00\x00\x00\xa9\
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
qt_resource_struct_v2 = 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\x16\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\
|
|
||||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
|
||||||
\x00\x00\x00\x28\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
|
|
||||||
\x00\x00\x01\x76\x41\x9d\xa2\x35\
|
|
||||||
\x00\x00\x00\x52\x00\x00\x00\x00\x00\x01\x00\x00\x00\xa9\
|
|
||||||
\x00\x00\x01\x76\x41\x9d\xa2\x35\
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
|
|
||||||
if qt_version < [5, 8, 0]:
|
|
||||||
rcc_version = 1
|
|
||||||
qt_resource_struct = qt_resource_struct_v1
|
|
||||||
else:
|
|
||||||
rcc_version = 2
|
|
||||||
qt_resource_struct = qt_resource_struct_v2
|
|
||||||
|
|
||||||
|
|
||||||
def qInitResources():
|
|
||||||
QtCore.qRegisterResourceData(
|
|
||||||
rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def qCleanupResources():
|
|
||||||
QtCore.qUnregisterResourceData(
|
|
||||||
rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data
|
|
||||||
)
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
# Resource object code (Python 3)
|
|
||||||
# Created by: object code
|
|
||||||
# Created by: The Resource Compiler for Qt version 5.15.2
|
|
||||||
# WARNING! All changes made in this file will be lost!
|
|
||||||
|
|
||||||
from PySide2 import QtCore
|
|
||||||
|
|
||||||
|
|
||||||
qt_resource_data = b"\
|
|
||||||
\x00\x00\x00\xa5\
|
|
||||||
\x89\
|
|
||||||
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
|
|
||||||
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce|N\
|
|
||||||
\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\
|
|
||||||
\x02bKGD\x00\x9cS4\xfc]\x00\x00\x00\x09p\
|
|
||||||
HYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
|
|
||||||
\x00\x00\x00\x07tIME\x07\xdc\x08\x17\x0b\x02\x04m\
|
|
||||||
\x98\x1bi\x00\x00\x00)IDAT\x08\xd7c`\xc0\
|
|
||||||
\x00\x8c\x0c\x0c\xff\xcf\xa3\x08\x18220 \x0b2\x1a\
|
|
||||||
200B\x98\x10AFC\x14\x13P\xb5\xa3\x01\x00\
|
|
||||||
\xd6\x10\x07\xd2/H\xdfJ\x00\x00\x00\x00IEND\
|
|
||||||
\xaeB`\x82\
|
|
||||||
\x00\x00\x00\xa6\
|
|
||||||
\x89\
|
|
||||||
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
|
|
||||||
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce|N\
|
|
||||||
\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\
|
|
||||||
\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09p\
|
|
||||||
HYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
|
|
||||||
\x00\x00\x00\x07tIME\x07\xdc\x08\x17\x08\x15;\xdc\
|
|
||||||
;\x0c\x9b\x00\x00\x00*IDAT\x08\xd7c`\xc0\
|
|
||||||
\x00\x8c\x0c\x0cs> \x0b\xa4\x08020 \x0b\xa6\
|
|
||||||
\x08000B\x98\x10\xc1\x14\x01\x14\x13P\xb5\xa3\x01\
|
|
||||||
\x00\xc6\xb9\x07\x90]f\x1f\x83\x00\x00\x00\x00IEN\
|
|
||||||
D\xaeB`\x82\
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
qt_resource_name = b"\
|
|
||||||
\x00\x08\
|
|
||||||
\x06\xc5\x8e\xa5\
|
|
||||||
\x00o\
|
|
||||||
\x00p\x00e\x00n\x00p\x00y\x00p\x00e\
|
|
||||||
\x00\x06\
|
|
||||||
\x07\x03}\xc3\
|
|
||||||
\x00i\
|
|
||||||
\x00m\x00a\x00g\x00e\x00s\
|
|
||||||
\x00\x12\
|
|
||||||
\x01.\x03'\
|
|
||||||
\x00c\
|
|
||||||
\x00o\x00m\x00b\x00o\x00b\x00o\x00x\x00_\x00a\x00r\x00r\x00o\x00w\x00.\x00p\x00n\
|
|
||||||
\x00g\
|
|
||||||
\x00\x1b\
|
|
||||||
\x03Z2'\
|
|
||||||
\x00c\
|
|
||||||
\x00o\x00m\x00b\x00o\x00b\x00o\x00x\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00d\x00i\
|
|
||||||
\x00s\x00a\x00b\x00l\x00e\x00d\x00.\x00p\x00n\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\x16\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\
|
|
||||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
|
||||||
\x00\x00\x00(\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
|
|
||||||
\x00\x00\x01vA\x9d\xa25\
|
|
||||||
\x00\x00\x00R\x00\x00\x00\x00\x00\x01\x00\x00\x00\xa9\
|
|
||||||
\x00\x00\x01vA\x9d\xa25\
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
import Qt
|
|
||||||
|
|
||||||
|
|
||||||
initialized = False
|
|
||||||
resources = None
|
|
||||||
if Qt.__binding__ == "PySide2":
|
|
||||||
from . import pyside2_resources as resources
|
|
||||||
elif Qt.__binding__ == "PyQt5":
|
|
||||||
from . import pyqt5_resources as resources
|
|
||||||
|
|
||||||
|
|
||||||
def qInitResources():
|
|
||||||
global resources
|
|
||||||
global initialized
|
|
||||||
if resources is not None and not initialized:
|
|
||||||
initialized = True
|
|
||||||
resources.qInitResources()
|
|
||||||
|
|
||||||
|
|
||||||
def qCleanupResources():
|
|
||||||
global resources
|
|
||||||
global initialized
|
|
||||||
if resources is not None:
|
|
||||||
initialized = False
|
|
||||||
resources.qCleanupResources()
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = (
|
|
||||||
"resources",
|
|
||||||
"qInitResources",
|
|
||||||
"qCleanupResources"
|
|
||||||
)
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<RCC>
|
|
||||||
<qresource prefix="/openpype">
|
|
||||||
<file>images/combobox_arrow.png</file>
|
|
||||||
<file>images/combobox_arrow_disabled.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
QTreeView::item {
|
|
||||||
padding-top: 3px;
|
|
||||||
padding-bottom: 3px;
|
|
||||||
padding-right: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QTreeView::item:selected, QTreeView::item:selected:!active {
|
|
||||||
background: rgba(0, 122, 204, 127);
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
#IconBtn {
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#TypeEditor, #ToolEditor, #NameEditor, #NumberEditor {
|
|
||||||
background: transparent;
|
|
||||||
border: 1px solid #005c99;
|
|
||||||
border-radius: 0.3em;
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue