Skip to main content

Fugue Icons for PyQt5

Project description

About

pyqt5_fugueicons is a library for PyQt5 that provides the icons in the collection Fugue Icons created by Yusuke Kamiyamane. It uses the Qt Resource System to embed icons into the library, which allows them to be used directly in an application.

Installation

> pip install pyqt5-fugueicons

Usage

Icons

import pyqt5_fugueicons as fugue
from PyQt5 import QtWidgets

icon   = fugue.icon('application-blue')
button = QtWidgets.PushButton(icon, 'application-blue')
...

The above call returns the icon named "application-blue" with the dimensions 16x16. The icon can then be assigned to any QtWidgets class that supports a QIcon.

Shadowed and Shadowless

There are two versions of icons, shadowed and shadowless. Shadowed icons have a small shadow, which shadowless ones don't. By default, icon() returns the shadowed version of an icon. This can be changed by passing the parameter shadowless=True:

import pyqt5_fugueicons as fugue

icon = fugue.icon('application-blue', shadowless=True)

Size and Fallback

Some icons also have 24x24 and 32x32 counterparts. The parameter size allows one to specify the desired size of an icon, and the parameter fallback_size defines whether the smaller counterparts of an icon should be tried if an icon with the desired size is not found:

import pyqt5_fugueicons as fugue

icon = fugue.icon('application-blue', size=24, fallback_size=True)

In the above code, if the shadowed version of the icon "application-blue" is not found with dimensions 24x24, the function will try to find the shadowed version of the same icon with dimensions 16x16. If still no icon is found, an empty QIcon is returned. size accepts the values 16, 24, and 32.

Icon Names

Icon names can be found in the author's website. An icon name is simply its file name without the extension. The function iconNames() returns all icon names:

for name in fugue.iconNames():
    print(name)

Animated Icons

Animated icons in the Fugue collection are returned by the function movie():

import pyqt5_fugueicons as fugue
from PyQt5 import QtWidgets

movie = fugue.movie('terminal')
movie.start()

label = QtWidgets.QLabel()
label.setMovie(movie)
...

The reason the library calls it "movie" rather than "animation" is to be consistent with Qt terminology, since Qt animations are something else. The class QMovie is the one responsible for showing gifs on the Qt framework, so the library follows that.

movie() works similar to icon(), with the difference being that there exist only Fugue animations with the dimensions 16x16 and 24x24, so size only accepts the values 16 and 24. There is also a function movieNames() which returns all movie names.

Examples

More elaborated examples of usage can be found in the folder samples of this repository.

Compiling Resources

Since the icon files are already compiled into resource.py, this repository does not include the icon files from the Fugue's website. If you want to compile it by yourself, you must download it, extract it into the folder resources, and run pyrcc5:

pyrcc5 -o pyqt5_fugueicons/resources.py resources/resources.qrc

Or rcc.exe:

rcc.exe -g python pyqt5_fugueicons/resources.py resources/resources.qrc

In the latter case, resources.py has to be manually opened and the line from PySide2 import QtCore must be replaced with from PyQt5 import QtCore.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqt5_fugueicons-3.5.6.2.tar.gz (6.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyqt5_fugueicons-3.5.6.2-py3-none-any.whl (6.9 MB view details)

Uploaded Python 3

File details

Details for the file pyqt5_fugueicons-3.5.6.2.tar.gz.

File metadata

  • Download URL: pyqt5_fugueicons-3.5.6.2.tar.gz
  • Upload date:
  • Size: 6.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.1

File hashes

Hashes for pyqt5_fugueicons-3.5.6.2.tar.gz
Algorithm Hash digest
SHA256 18f9a2d8f04579e8bedffea653846abc2fd484b21d648d2bbf8c98f8bd6200d0
MD5 0d09aa4c80b9695e00b1704c1d130d83
BLAKE2b-256 9f237b9ba9775f8e5b05092fba5e981c57634c40c4d03c2fa834d790fc734527

See more details on using hashes here.

File details

Details for the file pyqt5_fugueicons-3.5.6.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqt5_fugueicons-3.5.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 27eb1d5ab5f8898c310583159c011150ad9302955f4d4ffba507f29fe2ecccb1
MD5 7855aadfd7fbc256fae643376315c908
BLAKE2b-256 822d2a9ebc644f10a8555caa3d98600412d7502bdd86a313842bb261252157ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page