Add hardware acceleration toggle in Settings > Appearance
GPU rendering is opt-in via a toggle with restart-required toast. Recovery from crash: QBZ_HARDWARE_ACCEL=0 qbz (env var always overrides the stored setting). i18n keys added to all 4 locales.
This commit is contained in:
1 parent
3cd7e7c55f
commit
2eeb8cf865
5 files changed
+33
No files matched your search
@@ -226,6 +226,7 @@
|
|||||||
let storageCollapsed = $state(true);
|
let storageCollapsed = $state(true);
|
||||||
let developerCollapsed = $state(true);
|
let developerCollapsed = $state(true);
|
||||||
let forceDmabuf = $state(false);
|
let forceDmabuf = $state(false);
|
||||||
|
let hardwareAcceleration = $state(false);
|
||||||
let showLogsModal = $state(false);
|
let showLogsModal = $state(false);
|
||||||
|
|
||||||
// Navigation section IDs with translation keys
|
// Navigation section IDs with translation keys
|
||||||
@@ -811,6 +812,11 @@
|
|||||||
forceDmabuf = settings.force_dmabuf;
|
forceDmabuf = settings.force_dmabuf;
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
|
|
||||||
|
// Load graphics settings
|
||||||
|
invoke('get_graphics_settings').then((settings: any) => {
|
||||||
|
hardwareAcceleration = settings.hardware_acceleration;
|
||||||
|
}).catch(() => {});
|
||||||
|
|
||||||
// Subscribe to offline state changes
|
// Subscribe to offline state changes
|
||||||
const unsubscribeOffline = subscribeOffline(() => {
|
const unsubscribeOffline = subscribeOffline(() => {
|
||||||
offlineStatus = getOfflineStatus();
|
offlineStatus = getOfflineStatus();
|
||||||
@@ -2171,6 +2177,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleHardwareAccelerationChange(enabled: boolean) {
|
||||||
|
try {
|
||||||
|
await invoke('set_hardware_acceleration', { enabled });
|
||||||
|
hardwareAcceleration = enabled;
|
||||||
|
showToast($t('settings.developer.restartRequired'), 'info');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to set hardware_acceleration:', err);
|
||||||
|
showToast(String(err), 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleForceDmabufChange(enabled: boolean) {
|
async function handleForceDmabufChange(enabled: boolean) {
|
||||||
try {
|
try {
|
||||||
await invoke('set_developer_force_dmabuf', { enabled });
|
await invoke('set_developer_force_dmabuf', { enabled });
|
||||||
@@ -2664,6 +2681,14 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="setting-row">
|
||||||
|
<div class="setting-info">
|
||||||
|
<span class="setting-label">{$t('settings.appearance.hardwareAcceleration')}</span>
|
||||||
|
<span class="setting-desc">{$t('settings.appearance.hardwareAccelerationDesc')}</span>
|
||||||
|
</div>
|
||||||
|
<Toggle enabled={hardwareAcceleration} onchange={(v) => handleHardwareAccelerationChange(v)} />
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- System Tray subsection -->
|
<!-- System Tray subsection -->
|
||||||
<h4 class="subsection-title">{$t('settings.appearance.tray.title')}</h4>
|
<h4 class="subsection-title">{$t('settings.appearance.tray.title')}</h4>
|
||||||
<div class="setting-row">
|
<div class="setting-row">
|
||||||
|
|||||||
@@ -611,6 +611,8 @@
|
|||||||
"split-suggestions": "Geteilt: Vorschläge",
|
"split-suggestions": "Geteilt: Vorschläge",
|
||||||
"split-queue": "Geteilt: Warteschlange"
|
"split-queue": "Geteilt: Warteschlange"
|
||||||
},
|
},
|
||||||
|
"hardwareAcceleration": "Hardwarebeschleunigung (GPU)",
|
||||||
|
"hardwareAccelerationDesc": "GPU-beschleunigtes Rendering aktivieren. Standardmäßig deaktiviert für maximale Kompatibilität. Falls QBZ nach dem Aktivieren beim Start abstürzt: QBZ_HARDWARE_ACCEL=0 qbz",
|
||||||
"tray": {
|
"tray": {
|
||||||
"title": "Systemtray",
|
"title": "Systemtray",
|
||||||
"enableTray": "Tray-Symbol aktivieren",
|
"enableTray": "Tray-Symbol aktivieren",
|
||||||
|
|||||||
@@ -629,6 +629,8 @@
|
|||||||
"split-suggestions": "Split: Suggestions",
|
"split-suggestions": "Split: Suggestions",
|
||||||
"split-queue": "Split: Queue"
|
"split-queue": "Split: Queue"
|
||||||
},
|
},
|
||||||
|
"hardwareAcceleration": "Hardware acceleration (GPU)",
|
||||||
|
"hardwareAccelerationDesc": "Enable GPU-accelerated rendering. Disabled by default for maximum compatibility. If QBZ crashes on startup after enabling, run: QBZ_HARDWARE_ACCEL=0 qbz",
|
||||||
"tray": {
|
"tray": {
|
||||||
"title": "System Tray",
|
"title": "System Tray",
|
||||||
"enableTray": "Enable tray icon",
|
"enableTray": "Enable tray icon",
|
||||||
|
|||||||
@@ -629,6 +629,8 @@
|
|||||||
"split-suggestions": "Dividido: Sugerencias",
|
"split-suggestions": "Dividido: Sugerencias",
|
||||||
"split-queue": "Dividido: Cola"
|
"split-queue": "Dividido: Cola"
|
||||||
},
|
},
|
||||||
|
"hardwareAcceleration": "Aceleración por hardware (GPU)",
|
||||||
|
"hardwareAccelerationDesc": "Habilitar renderizado acelerado por GPU. Desactivado por defecto para máxima compatibilidad. Si QBZ se cierra al iniciar después de activar esto, ejecuta: QBZ_HARDWARE_ACCEL=0 qbz",
|
||||||
"tray": {
|
"tray": {
|
||||||
"title": "Bandeja del Sistema",
|
"title": "Bandeja del Sistema",
|
||||||
"enableTray": "Habilitar icono de bandeja",
|
"enableTray": "Habilitar icono de bandeja",
|
||||||
|
|||||||
@@ -611,6 +611,8 @@
|
|||||||
"split-suggestions": "Divisé : Suggestions",
|
"split-suggestions": "Divisé : Suggestions",
|
||||||
"split-queue": "Divisé : File d'attente"
|
"split-queue": "Divisé : File d'attente"
|
||||||
},
|
},
|
||||||
|
"hardwareAcceleration": "Accélération matérielle (GPU)",
|
||||||
|
"hardwareAccelerationDesc": "Activer le rendu accéléré par GPU. Désactivé par défaut pour une compatibilité maximale. Si QBZ plante au démarrage après activation : QBZ_HARDWARE_ACCEL=0 qbz",
|
||||||
"tray": {
|
"tray": {
|
||||||
"title": "Barre d'état système",
|
"title": "Barre d'état système",
|
||||||
"enableTray": "Activer l'icône dans la barre système",
|
"enableTray": "Activer l'icône dans la barre système",
|
||||||
|
|||||||
Reference in new issue
Block a user