From e006344dccc3becbedf96ef53d4d8bddb15e5000 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Mon, 29 Jun 2020 07:51:35 +0200 Subject: [PATCH] [doc] add how to create icon-only widgets fixes #669 --- docs/development/theme.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/development/theme.rst b/docs/development/theme.rst index 7ea8af6..24e7cbe 100644 --- a/docs/development/theme.rst +++ b/docs/development/theme.rst @@ -52,6 +52,21 @@ JSON file located in ``$(THEME_DIRECTORY)/icons/``. The format of the icon file is identical to the theme itself (as the two are essentially just merged into a single JSON. +To create an "icon-only" widget (e.g. the play/pause/forward/rewind buttons +of a media player), you need to do the following: + +1. In the module, create a widget, and set its state to a descriptive value + (for example `widget.set("state", "next")` +2. In the theme's icon definition JSON, define a `prefix` for that state: + +.. code:: json + + { + "spotify": { + "next": { "prefix": "" } + }, + } + Color definitions and pyWAL support -----------------------------------