PyQtDarkTheme-fork


NamePyQtDarkTheme-fork JSON
Version 2.3.2 PyPI version JSON
download
home_pagehttps://github.com/5yutan5/PyQtDarkTheme
SummaryFlat dark theme for PySide and PyQt.
upload_time2024-03-07 13:04:17
maintainer
docs_urlNone
authorYunosuke Ohsugi
requires_python>=3.8,<3.13
licenseMIT
keywords qt stylesheets dark-theme
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fork Purpose

This repository performs the following:

- Includes fixes to run on newer Python versions
- Publishes to PyPi as `pyqtdarktheme-fork`

# PyQtDarkTheme

PyQtDarkTheme applies a flat dark theme to QtWidgets application. There's a light theme too. Color balanced from the dark theme for easy viewing in daylight.

Check out the [complete documentation](https://pyqtdarktheme.readthedocs.io).

**Project status**
[![PyPI Latest Release](https://img.shields.io/pypi/v/pyqtdarktheme.svg?color=orange)](https://pypi.org/project/pyqtdarktheme/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pyqtdarktheme.svg?color=blue)](https://www.python.org/downloads/)
[![Qt Versions](https://img.shields.io/badge/Qt-5%20|%206-blue.svg?&logo=Qt&logoWidth=18&logoColor=white)](https://www.qt.io/qt-for-python)
[![License](https://img.shields.io/github/license/5yutan5/PyQtDarkTheme.svg?color=green)](https://github.com/5yutan5/PyQtDarkTheme/blob/main/LICENSE.txt/)

**Tests**
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/5yutan5/PyQtDarkTheme/main.svg)](https://results.pre-commit.ci/latest/github/5yutan5/PyQtDarkTheme/main)
[![codecov](https://codecov.io/gh/5yutan5/PyQtDarkTheme/branch/main/graph/badge.svg?token=RTS8O0V6SF)](https://codecov.io/gh/5yutan5/PyQtDarkTheme)
[![Documentation Status](https://readthedocs.org/projects/pyqtdarktheme/badge/?version=latest)](https://pyqtdarktheme.readthedocs.io/en/latest/?badge=latest)

## Features

- A flat dark and light theme
- Support PySide and PyQt
- Sync with OS's theme and accent (Mac, Windows, Linux)
- Resolve the style differences between Qt versions
- Provide dark/light theme QPalette
- Override Qt old standard icons

## Themes

### Dark Theme

![widget_gallery_dark_theme](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/widget_gallery_dark.png)

### Light Theme

![widget_gallery_light_them](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/widget_gallery_light.png)

## Requirements

- [Python 3.8+](https://www.python.org/downloads/)
- Qt 5.15+
- PySide6, PyQt6, PyQt5 or PySide2

## Installation Method

- Last released version

   ```plaintext
   pip install pyqtdarktheme-fork
   ```

- Latest development version

   ```plaintext
   pip install git+https://github.com/5yutan5/PyQtDarkTheme.git@main
   ```

## Usage

```Python
import sys

from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton

import qdarktheme

app = QApplication(sys.argv)
# Apply the complete dark theme to your Qt App.
qdarktheme.setup_theme()

main_win = QMainWindow()
push_button = QPushButton("PyQtDarkTheme!!")
main_win.setCentralWidget(push_button)

main_win.show()

app.exec()
```

Further information can be found in our docs:

- [Usage Guide](https://pyqtdarktheme.readthedocs.io/en/latest/how_to_use.html)

### Enable HiDPI

```Python
# enable_hi_dpi() must be called before the instantiation of QApplication.
qdarktheme.enable_hi_dpi()
app = QApplication(sys.argv)
qdarktheme.setup_theme()
```

For Qt6 bindings, HiDPI “just works” without using this function.

### Light theme

```Python
qdarktheme.setup_theme("light")
```

### Sync with OS's theme and accent

```Python
qdarktheme.setup_theme("auto")
```

![sync with os theme](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/sync_with_os_theme.gif)

On macOS, qdarktheme also syncs with accent colors.
![sync with os accent](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/sync_with_os_accent.gif)

### Customizing colors

You can customize the theme color.

```python
# Customize accent color.
qdarktheme.setup_theme(custom_colors={"primary": "#D0BCFF"})
```

For a list of all customizable colors, see the Theme Color Reference:

- [Theme Color](https://pyqtdarktheme.readthedocs.io/en/latest/reference/theme_color.html)

### Sharp frame

You can change the corner style.

```python
# Default is "rounded".
stylesheet = qdarktheme.setup_theme(corner_shape="sharp")
```

### QPalette and stylesheet

You can also only load QPalette and stylesheet. `qdarktheme.setup_theme` uses the following functions internally.

```Python
palette = qdarktheme.load_palette(theme="dark")
stylesheet = qdarktheme.load_stylesheet(theme="dark")
```

## Example

To check all Qt widgets, run:

```plaintext
python -m qdarktheme.widget_gallery
```

## License

The svg files for the PyQtDarkTheme are derived [Material design icons](https://fonts.google.com/icons)(Apache License Version 2.0). Qt stylesheets are originally fork of [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet)(MIT License). Other files are covered by PyQtDarkTheme's MIT license. The accent detector(qdarktheme/_os_appearance/_accent/_mac_detect) is inspired by [darkdetect](https://github.com/albertosottile/darkdetect)(3-clause BSD License).

## Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. You can get started by reading this:

- [Contributing Guide](https://pyqtdarktheme.readthedocs.io/en/latest/contributing.html)

## Change log

See [Releases](https://github.com/5yutan5/PyQtDarkTheme/releases).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/5yutan5/PyQtDarkTheme",
    "name": "PyQtDarkTheme-fork",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.13",
    "maintainer_email": "",
    "keywords": "qt,stylesheets,dark-theme",
    "author": "Yunosuke Ohsugi",
    "author_email": "63651161+5yutan5@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/65/8b/e7e525927257ecab3a372fb8791197f1f707ff7b4a3b8dd1dcceb3e0f860/pyqtdarktheme_fork-2.3.2.tar.gz",
    "platform": null,
    "description": "# Fork Purpose\n\nThis repository performs the following:\n\n- Includes fixes to run on newer Python versions\n- Publishes to PyPi as `pyqtdarktheme-fork`\n\n# PyQtDarkTheme\n\nPyQtDarkTheme applies a flat dark theme to QtWidgets application. There's a light theme too. Color balanced from the dark theme for easy viewing in daylight.\n\nCheck out the [complete documentation](https://pyqtdarktheme.readthedocs.io).\n\n**Project status**\n[![PyPI Latest Release](https://img.shields.io/pypi/v/pyqtdarktheme.svg?color=orange)](https://pypi.org/project/pyqtdarktheme/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pyqtdarktheme.svg?color=blue)](https://www.python.org/downloads/)\n[![Qt Versions](https://img.shields.io/badge/Qt-5%20|%206-blue.svg?&logo=Qt&logoWidth=18&logoColor=white)](https://www.qt.io/qt-for-python)\n[![License](https://img.shields.io/github/license/5yutan5/PyQtDarkTheme.svg?color=green)](https://github.com/5yutan5/PyQtDarkTheme/blob/main/LICENSE.txt/)\n\n**Tests**\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/5yutan5/PyQtDarkTheme/main.svg)](https://results.pre-commit.ci/latest/github/5yutan5/PyQtDarkTheme/main)\n[![codecov](https://codecov.io/gh/5yutan5/PyQtDarkTheme/branch/main/graph/badge.svg?token=RTS8O0V6SF)](https://codecov.io/gh/5yutan5/PyQtDarkTheme)\n[![Documentation Status](https://readthedocs.org/projects/pyqtdarktheme/badge/?version=latest)](https://pyqtdarktheme.readthedocs.io/en/latest/?badge=latest)\n\n## Features\n\n- A flat dark and light theme\n- Support PySide and PyQt\n- Sync with OS's theme and accent (Mac, Windows, Linux)\n- Resolve the style differences between Qt versions\n- Provide dark/light theme QPalette\n- Override Qt old standard icons\n\n## Themes\n\n### Dark Theme\n\n![widget_gallery_dark_theme](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/widget_gallery_dark.png)\n\n### Light Theme\n\n![widget_gallery_light_them](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/widget_gallery_light.png)\n\n## Requirements\n\n- [Python 3.8+](https://www.python.org/downloads/)\n- Qt 5.15+\n- PySide6, PyQt6, PyQt5 or PySide2\n\n## Installation Method\n\n- Last released version\n\n   ```plaintext\n   pip install pyqtdarktheme-fork\n   ```\n\n- Latest development version\n\n   ```plaintext\n   pip install git+https://github.com/5yutan5/PyQtDarkTheme.git@main\n   ```\n\n## Usage\n\n```Python\nimport sys\n\nfrom PySide6.QtWidgets import QApplication, QMainWindow, QPushButton\n\nimport qdarktheme\n\napp = QApplication(sys.argv)\n# Apply the complete dark theme to your Qt App.\nqdarktheme.setup_theme()\n\nmain_win = QMainWindow()\npush_button = QPushButton(\"PyQtDarkTheme!!\")\nmain_win.setCentralWidget(push_button)\n\nmain_win.show()\n\napp.exec()\n```\n\nFurther information can be found in our docs:\n\n- [Usage Guide](https://pyqtdarktheme.readthedocs.io/en/latest/how_to_use.html)\n\n### Enable HiDPI\n\n```Python\n# enable_hi_dpi() must be called before the instantiation of QApplication.\nqdarktheme.enable_hi_dpi()\napp = QApplication(sys.argv)\nqdarktheme.setup_theme()\n```\n\nFor Qt6 bindings, HiDPI \u201cjust works\u201d without using this function.\n\n### Light theme\n\n```Python\nqdarktheme.setup_theme(\"light\")\n```\n\n### Sync with OS's theme and accent\n\n```Python\nqdarktheme.setup_theme(\"auto\")\n```\n\n![sync with os theme](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/sync_with_os_theme.gif)\n\nOn macOS, qdarktheme also syncs with accent colors.\n![sync with os accent](https://raw.githubusercontent.com/5yutan5/PyQtDarkTheme/main/images/sync_with_os_accent.gif)\n\n### Customizing colors\n\nYou can customize the theme color.\n\n```python\n# Customize accent color.\nqdarktheme.setup_theme(custom_colors={\"primary\": \"#D0BCFF\"})\n```\n\nFor a list of all customizable colors, see the Theme Color Reference:\n\n- [Theme Color](https://pyqtdarktheme.readthedocs.io/en/latest/reference/theme_color.html)\n\n### Sharp frame\n\nYou can change the corner style.\n\n```python\n# Default is \"rounded\".\nstylesheet = qdarktheme.setup_theme(corner_shape=\"sharp\")\n```\n\n### QPalette and stylesheet\n\nYou can also only load QPalette and stylesheet. `qdarktheme.setup_theme` uses the following functions internally.\n\n```Python\npalette = qdarktheme.load_palette(theme=\"dark\")\nstylesheet = qdarktheme.load_stylesheet(theme=\"dark\")\n```\n\n## Example\n\nTo check all Qt widgets, run:\n\n```plaintext\npython -m qdarktheme.widget_gallery\n```\n\n## License\n\nThe svg files for the PyQtDarkTheme are derived [Material design icons](https://fonts.google.com/icons)(Apache License Version 2.0). Qt stylesheets are originally fork of [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet)(MIT License). Other files are covered by PyQtDarkTheme's MIT license. The accent detector(qdarktheme/_os_appearance/_accent/_mac_detect) is inspired by [darkdetect](https://github.com/albertosottile/darkdetect)(3-clause BSD License).\n\n## Contributing\n\nAll contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. You can get started by reading this:\n\n- [Contributing Guide](https://pyqtdarktheme.readthedocs.io/en/latest/contributing.html)\n\n## Change log\n\nSee [Releases](https://github.com/5yutan5/PyQtDarkTheme/releases).\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Flat dark theme for PySide and PyQt.",
    "version": "2.3.2",
    "project_urls": {
        "Documentation": "https://pyqtdarktheme.readthedocs.io",
        "Homepage": "https://github.com/5yutan5/PyQtDarkTheme",
        "Repository": "https://github.com/5yutan5/PyQtDarkTheme"
    },
    "split_keywords": [
        "qt",
        "stylesheets",
        "dark-theme"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d068a77ddbc37efd415602237fbb9685e0a52e112d31dfc3a7cb28c8656dd2c",
                "md5": "8fbd424ace120b9be56705c51c82bf9d",
                "sha256": "d96ee64f0884678fad9b6bc352d5e37d84ca786fa60ed32ffaa7e6c6bc67e964"
            },
            "downloads": -1,
            "filename": "pyqtdarktheme_fork-2.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8fbd424ace120b9be56705c51c82bf9d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.13",
            "size": 54394,
            "upload_time": "2024-03-07T13:04:15",
            "upload_time_iso_8601": "2024-03-07T13:04:15.796734Z",
            "url": "https://files.pythonhosted.org/packages/4d/06/8a77ddbc37efd415602237fbb9685e0a52e112d31dfc3a7cb28c8656dd2c/pyqtdarktheme_fork-2.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "658be7e525927257ecab3a372fb8791197f1f707ff7b4a3b8dd1dcceb3e0f860",
                "md5": "c675a67960a61b07f39019e0678f7a04",
                "sha256": "3ea94fed5df262d960378409357c63032639f749794d766f41a45ad8558b2523"
            },
            "downloads": -1,
            "filename": "pyqtdarktheme_fork-2.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c675a67960a61b07f39019e0678f7a04",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.13",
            "size": 41627,
            "upload_time": "2024-03-07T13:04:17",
            "upload_time_iso_8601": "2024-03-07T13:04:17.664257Z",
            "url": "https://files.pythonhosted.org/packages/65/8b/e7e525927257ecab3a372fb8791197f1f707ff7b4a3b8dd1dcceb3e0f860/pyqtdarktheme_fork-2.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 13:04:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "5yutan5",
    "github_project": "PyQtDarkTheme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyqtdarktheme-fork"
}
        
Elapsed time: 0.26065s