mirror of
https://github.com/ColinDuquesnoy/QDarkStyleSheet.git
synced 2026-08-29 08:34:30 +08:00
Change global variable names to better fit content
This commit is contained in:
@@ -74,7 +74,6 @@ __version__ = "3.1"
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Dir names
|
||||
REPO_PATH = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
|
||||
EXAMPLE_PATH = os.path.join(REPO_PATH, 'example')
|
||||
@@ -84,15 +83,15 @@ QSS_PATH = os.path.join(PACKAGE_PATH, 'qss')
|
||||
SVG_PATH = os.path.join(PACKAGE_PATH, 'svg')
|
||||
|
||||
# File names
|
||||
QSS_FILE = 'style.qss'
|
||||
QRC_FILE = QSS_FILE.replace('.qss', '.qrc')
|
||||
|
||||
MAIN_SCSS_FILE = 'main.scss'
|
||||
STYLES_SCSS_FILE = '_styles.scss'
|
||||
VARIABLES_SCSS_FILE = '_variables.scss'
|
||||
|
||||
# File paths
|
||||
STYLES_SCSS_FILEPATH = os.path.join(QSS_PATH, STYLES_SCSS_FILE)
|
||||
# Prefixes and suffixes
|
||||
RESOURCE_PREFIX = "qss_icons"
|
||||
STYLE_PREFIX = "qdarkstyle"
|
||||
QSS_FILE_SUFFIX = 'style.qss'
|
||||
QRC_FILE_SUFFIX = 'style.qrc'
|
||||
|
||||
# Todo: check if we are deprecate all those functions or keep them
|
||||
DEPRECATION_MSG = '''This function will be deprecated in v3.0.
|
||||
@@ -255,7 +254,7 @@ def _load_stylesheet(qt_api='', palette=None):
|
||||
# Thus, by importing the binary we can access the resources
|
||||
package_dir = os.path.basename(PACKAGE_PATH)
|
||||
palette_dir = os.path.join(package_dir, palette.ID)
|
||||
qss_rc_path = ":" + os.path.join(palette_dir, palette.ID + QSS_FILE)
|
||||
qss_rc_path = ":" + os.path.join(palette_dir, palette.ID + QSS_FILE_SUFFIX)
|
||||
|
||||
_logger.debug("Reading QSS file in: %s" % qss_rc_path)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import logging
|
||||
import sys
|
||||
|
||||
# Local imports
|
||||
from qdarkstyle import PACKAGE_PATH, QRC_FILE
|
||||
from qdarkstyle import PACKAGE_PATH, QRC_FILE_SUFFIX
|
||||
from qdarkstyle.utils.images import (compile_qrc_file, create_images,
|
||||
create_palette_image, generate_qrc_file)
|
||||
from qdarkstyle.utils.scss import create_qss
|
||||
|
||||
@@ -20,8 +20,8 @@ from qtpy.QtGui import QIcon
|
||||
from qtpy.QtWidgets import QApplication
|
||||
|
||||
# Local imports
|
||||
from qdarkstyle import (IMAGES_PATH, PACKAGE_PATH, QRC_FILE, QSS_FILE,
|
||||
STYLES_SCSS_FILEPATH, SVG_PATH)
|
||||
from qdarkstyle import (IMAGES_PATH, PACKAGE_PATH, QRC_FILE_SUFFIX, QSS_FILE_SUFFIX, QSS_PATH,
|
||||
STYLES_SCSS_FILE, SVG_PATH)
|
||||
|
||||
|
||||
IMAGE_BLACKLIST = ['base_palette']
|
||||
@@ -269,8 +269,8 @@ def generate_qrc_file(resource_prefix='qss_icons', style_prefix='qdarkstyle',
|
||||
|
||||
palette_path = os.path.join(PACKAGE_PATH, palette.ID)
|
||||
rc_path = os.path.join(palette_path, 'rc')
|
||||
qss_file = palette.ID + QSS_FILE
|
||||
qrc_file = palette.ID + QRC_FILE
|
||||
qss_file = palette.ID + QSS_FILE_SUFFIX
|
||||
qrc_file = palette.ID + QRC_FILE_SUFFIX
|
||||
qrc_filepath = os.path.join(palette_path, qrc_file)
|
||||
resource_prefix = resource_prefix + '/' + palette.ID
|
||||
style_prefix = style_prefix + '/' + palette.ID
|
||||
@@ -309,7 +309,9 @@ def get_rc_links_from_scss(pattern=r"\/rc.*\.png"):
|
||||
list(str): list of unique links found.
|
||||
"""
|
||||
|
||||
with open(STYLES_SCSS_FILEPATH, 'r') as fh:
|
||||
style_scss_filepath = os.path.join(QSS_PATH, STYLES_SCSS_FILE)
|
||||
|
||||
with open(style_scss_filepath, 'r') as fh:
|
||||
data = fh.read()
|
||||
|
||||
lines = data.split("\n")
|
||||
@@ -359,7 +361,7 @@ def compile_qrc_file(compile_for='qtpy', qrc_path=None, palette=None):
|
||||
if not qrc_path:
|
||||
qrc_path = os.path.join(PACKAGE_PATH, palette.ID)
|
||||
|
||||
qrc_file = palette.ID + QRC_FILE
|
||||
qrc_file = palette.ID + QRC_FILE_SUFFIX
|
||||
|
||||
# get name without extension
|
||||
filename = os.path.splitext(qrc_file)[0]
|
||||
|
||||
@@ -14,7 +14,7 @@ import sys
|
||||
import qtsass
|
||||
|
||||
# Local imports
|
||||
from qdarkstyle import (MAIN_SCSS_FILE, PACKAGE_PATH, QSS_FILE, QSS_PATH,
|
||||
from qdarkstyle import (MAIN_SCSS_FILE, PACKAGE_PATH, QSS_FILE_SUFFIX, QSS_PATH,
|
||||
VARIABLES_SCSS_FILE)
|
||||
from qdarkstyle.palette import Palette
|
||||
from qdarkstyle.utils.images import create_images, create_palette_image
|
||||
|
||||
Reference in New Issue
Block a user