How to use the qdarkstyle.MAIN_SCSS_FILE function in QDarkStyle

To help you get started, we’ve selected a few QDarkStyle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ColinDuquesnoy / QDarkStyleSheet / qdarkstyle / utils / scss.py View on Github external
custom_palette.COLOR_FOREGROUND_LIGHT = color_foreground_light
    custom_palette.COLOR_FOREGROUND_NORMAL = color_foreground_normal
    custom_palette.COLOR_FOREGROUND_DARK = color_foreground_dark
    custom_palette.COLOR_SELECTION_LIGHT = color_selection_light
    custom_palette.COLOR_SELECTION_NORMAL = color_selection_normal
    custom_palette.COLOR_SELECTION_DARK = color_selection_dark
    custom_palette.SIZE_BORDER_RADIUS = border_radius
    custom_palette.PATH_RESOURCES = "'{}'".format(theme_root_path)

    # Process images and save them to the custom platte rc folder
    create_images(rc_path=theme_rc_path, palette=custom_palette)
    create_palette_image(path=theme_root_path, palette=custom_palette)

    # Compile SCSS
    variables_scss_filepath = os.path.join(theme_qss_path, VARIABLES_SCSS_FILE)
    theme_main_scss_filepath = os.path.join(theme_qss_path, MAIN_SCSS_FILE)
    theme_qss_filepath = os.path.join(theme_root_path, QSS_FILE)
    stylesheet = create_qss(
        qss_filepath=theme_qss_filepath,
        main_scss_filepath=theme_main_scss_filepath,
        variables_scss_filepath=variables_scss_filepath,
        palette=custom_palette,
    )

    # Update colors in text
    with open(theme_main_scss_filepath, 'r') as fh:
        data = fh.read()

    for key, color in DarkPalette.color_palette().items():
        custom_color = custom_palette.color_palette()[key].upper()
        data = data.replace(color, custom_color)
        stylesheet = stylesheet.replace(color, custom_color)