feat: added sound effects support to themes

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-07-16 11:10:31 +05:00
parent f0df1f89be
commit 889ba4af2b
6 changed files with 143 additions and 6 deletions

View File

@ -9,12 +9,13 @@
- [Metadata](#metadata)
- [Screenshots](#screenshots)
- [Fonts and Icons](#fonts-and-icons)
- [Sound Effects](#sound-effects)
---
## 📖 Overview
Themes in `PortProtonQT` allow customizing the UI appearance. Themes are stored under:
Themes in `PortProtonQT` allow customizing the UI appearance and sounds. Themes are stored under:
- `~/.local/share/PortProtonQT/themes`.
@ -34,6 +35,12 @@ Create a `styles.py` in the theme root. It should define variables or functions
**Example:**
```python
# Sound effects mapping
SOUNDS = {
"app_start": "app_start.wav", # Application startup
"app_exit": "app_exit.wav", # Application exit
}
def custom_button_style(color1, color2):
return f"""
QPushButton {{
@ -69,3 +76,19 @@ Folder: `images/screenshots/` — place UI screenshots there.
- Icons: `images/icons/*.svg/.png`
---
## 🔊 Sound Effects (optional)
Folder: `sounds/` — place interface sound effects here.
Supported formats:
- `.wav` - Wave audio files
Available sound events:
- Interface sounds:
- `app_start.wav` - Application startup
- `app_exit.wav` - Application exit
If a sound file is missing in a custom theme, the default sound from the standard theme will be used.
---

View File

@ -9,12 +9,13 @@
- [Метаинформация](#метаинформация)
- [Скриншоты](#скриншоты)
- [Шрифты и иконки](#шрифты-и-иконки)
- [Звуковые эффекты](#звуковые-эффекты)
---
## 📖 Обзор
Темы в `PortProtonQT` позволяют изменить внешний вид интерфейса. Все темы хранятся в папке:
Темы в `PortProtonQT` позволяют изменить внешний вид интерфейса и звуковое оформление. Все темы хранятся в папке:
- `~/.local/share/PortProtonQT/themes`.
@ -32,8 +33,14 @@ mkdir -p ~/.local/share/PortProtonQT/themes/my_custom_theme
Создайте `styles.py` в корне темы. В нём определите переменные и/или функции, возвращающие CSS-оформление.
**Пример функции:**
**Пример:**
```python
# Карта звуковых эффектов
SOUNDS = {
"app_start": "app_start.wav", # Запуск приложения
"app_exit": "app_exit.wav", # Закрытие приложения
}
def custom_button_style(color1, color2):
return f"""
QPushButton {{
@ -69,3 +76,19 @@ description = Описание вашей темы.
- Иконки: `images/icons/*.svg/.png`
---
## 🔊 Звуковые эффекты (опционально)
Папка: `sounds/` — звуковые эффекты интерфейса.
Поддерживаемые форматы:
- `.wav` - Wave аудио файлы
Доступные звуковые события:
- Звуки интерфейса:
- `app_start.wav` - Запуск приложения
- `app_exit.wav` - Закрытие приложения
Если звуковой файл отсутствует в пользовательской теме, будет использован звук из стандартной темы.
---