diff --git a/.github/workflows/linux-tests.yml b/.github/workflows/linux-tests.yml index e604ac2b..1a9d0aa5 100644 --- a/.github/workflows/linux-tests.yml +++ b/.github/workflows/linux-tests.yml @@ -11,6 +11,7 @@ on: jobs: linux: name: Linux Py${{ matrix.PYTHON_VERSION }} + timeout-minutes: 15 runs-on: ubuntu-latest env: CI: True diff --git a/.github/workflows/macos-tests.yml b/.github/workflows/macos-tests.yml index ba393c5b..65a55a41 100644 --- a/.github/workflows/macos-tests.yml +++ b/.github/workflows/macos-tests.yml @@ -11,6 +11,7 @@ on: jobs: macos: name: Mac Py${{ matrix.PYTHON_VERSION }} + timeout-minutes: 15 runs-on: macos-latest env: CI: True diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 4e150da8..4f6f05f4 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -10,7 +10,8 @@ on: jobs: windows: - name: Windows Py${{ matrix.PYTHON_VERSION }} + name: Windows Py${{ matrix.PYTHON_VERSION }} + timeout-minutes: 15 runs-on: windows-latest env: CI: True diff --git a/README.md b/README.md index 1dcd16cc..1ea507a0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)
[![PyPI status](https://img.shields.io/pypi/status/qtawesome.svg)](https://github.com/spyder-ide/qtawesome) [![Github build status](https://github.com/spyder-ide/qtawesome/workflows/Tests/badge.svg)](https://github.com/spyder-ide/qtawesome/actions) -[![Documentation Status](https://readthedocs.org/projects/qtawesomedocs/badge/?version=latest)](https://qtawesomedocs.readthedocs.io/en/latest/?badge=latest) +[![Documentation Status](https://readthedocs.org/projects/qtawesome/badge/?version=latest)](https://qtawesome.readthedocs.io/en/latest/?badge=latest) *Copyright © 2015–2022 Spyder Project Contributors* @@ -142,6 +142,16 @@ stack_button = QtWidgets.QPushButton(camera_ban, 'Stack') stack_button.setIconSize(QtCore.QSize(32, 32)) ``` +- Define the way to draw icons (`text`- default for icons without animation, `path` - default for icons with animations, `glyphrun` and `image`) + +```python +# Icon drawn with the `image` option +drawn_image_icon = qta.icon('ri.truck-fill', + options=[{'draw': 'image'}]) +drawn_image_button = QtWidgets.QPushButton(drawn_image_icon, + 'Icon drawn as an image') +``` + - Animations ```python @@ -170,6 +180,12 @@ simple_widget = qta.IconWidget('mdi.web', color='blue') ![QtAwesome screenshot](qtawesome-screenshot.gif) +To check these options you can launch the `example.py` script and pass to it the options as arguments. For example, to test how the icons could look using the `glyphrun` draw option, you can run something like: + +``` +python example.py draw=glyphrun +``` + ## Other features - QtAwesome comes bundled with _Font Awesome_, _Elusive Icons_, _Material Design_ diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 9f781aaa..a7608340 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -115,7 +115,7 @@ Examples color_active='orange') music_button = QtWidgets.QPushButton(styling_icon, 'Styling') -- Set alpha in colors +- Set alpha in colors: .. code:: python @@ -138,6 +138,16 @@ Examples toggle_button = QtWidgets.QPushButton(toggle_icon, 'Toggle') toggle_button.setCheckable(True) +- Define the way to draw icons (`text`- default for icons without animation, `path` - default for icons with animations, `glyphrun` and `image`): + +.. code:: python + + # Icon drawn with the `image` option + drawn_image_icon = qta.icon('ri.truck-fill', + options=[{'draw': 'image'}]) + drawn_image_button = QtWidgets.QPushButton(drawn_image_icon, + 'Icon drawn as an image') + - Stack multiple icons: .. code:: python diff --git a/example.py b/example.py index 99ddc072..34b0e34d 100644 --- a/example.py +++ b/example.py @@ -98,6 +98,12 @@ def __init__(self): iconwidgetholder.setLayout(lo) iconwidget2 = qta.IconWidget('mdi.web', color='blue') + # Icon drawn with the `image` option + drawn_image_icon = qta.icon('ri.truck-fill', + options=[{'draw': 'image'}]) + drawn_image_button = QtWidgets.QPushButton(drawn_image_icon, + 'Icon drawn as an image') + # Stack icons camera_ban = qta.icon('fa5s.camera', 'fa5s.ban', options=[{'scale_factor': 0.5, @@ -160,7 +166,8 @@ def __init__(self): rot_button, hflip_button, vflip_button, - toggle_button + toggle_button, + drawn_image_button ] animated_widgets = [ spin_button, @@ -216,6 +223,8 @@ def main(): if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'): app.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps) + # Timer needed to close the example application + # when testing QtCore.QTimer.singleShot(10000, app.exit) _ = AwesomeExample() sys.exit(app.exec_()) diff --git a/qtawesome-screenshot.gif b/qtawesome-screenshot.gif index 78222b6e..63e80c41 100644 Binary files a/qtawesome-screenshot.gif and b/qtawesome-screenshot.gif differ