Note
Repository Mirrors
- git.nuros.org (sanarde/style): primary, self-hosted Forgejo instance, accounts restricted to the core team.
- GitHub (sanarde/style): mirror for external contributors. Issues and Pull Requests opened here are welcome and are reviewed and processed by the core team.
Shared Material You theme, icon font and base QML components for SanarDE applications.
- Qt 6.8 or newer (Core, Gui, Quick, DBus)
- CMake 3.21 or newer
- A C++20 compiler
Optional at run time:
- Sanar Seurat (
seuratd), for system colors
cmake -S . -B build -G Ninja
cmake --build build
cmake --install build --prefix <prefix>
The install step puts the library in <prefix>/lib, the headers in <prefix>/include/sanar-style, the CMake package in <prefix>/lib/cmake/SanarStyle and the QML module in <prefix>/lib/qt6/qml/Sanar/Style. Use -DSANAR_STYLE_QMLDIR=<path>, relative to the prefix, to change the QML module location. When the prefix is not a system one, set QML_IMPORT_PATH=<prefix>/lib/qt6/qml when running applications that use the module.
In CMake:
find_package(SanarStyle REQUIRED)
target_link_libraries(app PRIVATE SanarStyle::sanar-style)
In the application entry point, after creating the QGuiApplication:
#include <Style.h>
SanarStyle::init();
SanarStyle::init() loads the bundled fonts and sets the application font. In QML:
import Sanar.Style
The module provides the Theme and Icons singletons and the Icon and IconButton components.
When seuratd is running on the session bus (org.nuros.sanar.seurat), Theme uses its color scheme and follows changes without a restart. Without the daemon, Theme uses a palette in the light or dark variant that matches the system.
Built-in palettes are in resources/palettes. Additional palettes are read from $XDG_DATA_HOME/sanar/palettes/*.json (usually ~/.local/share/sanar/palettes). A file with the id of a built-in palette replaces it. Files with a missing or invalid color are ignored.
A palette file has an id, a name (a string or an object keyed by language code with an en fallback) and two color tables, light and dark. Each table must contain all keys listed in resources/palettes/10-teal.json, with colors written as #RRGGBB.
- Roboto Flex, SIL Open Font License 1.1
- Material Symbols, Apache License 2.0
Font files and license texts are in resources/fonts. The icon font is a subset; to change the icon set, edit tools/icon-names.txt and run tools/subset-icons.sh with the full font and codepoints file.
GNU General Public License v3.0. See LICENSE.