mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 23:31:21 +02:00
Fix interface zoom
This commit is contained in:
@@ -20,7 +20,7 @@ pub struct Settings {
|
|||||||
pub theme_light: String,
|
pub theme_light: String,
|
||||||
pub update_channel: String,
|
pub update_channel: String,
|
||||||
pub interface_font_size: i32,
|
pub interface_font_size: i32,
|
||||||
pub interface_scale: i32,
|
pub interface_scale: f32,
|
||||||
pub editor_font_size: i32,
|
pub editor_font_size: i32,
|
||||||
pub editor_soft_wrap: bool,
|
pub editor_soft_wrap: bool,
|
||||||
pub telemetry: bool,
|
pub telemetry: bool,
|
||||||
|
|||||||
@@ -162,15 +162,16 @@ export function GlobalHooks() {
|
|||||||
document.documentElement.style.setProperty('--editor-font-size', `${editorFontSize}px`);
|
document.documentElement.style.setProperty('--editor-font-size', `${editorFontSize}px`);
|
||||||
}, [settings]);
|
}, [settings]);
|
||||||
|
|
||||||
// Handle Zoom. Note, Mac handles it in app menu, so need to also handle keyboard
|
// Handle Zoom.
|
||||||
|
// Note, Mac handles it in the app menu, so need to also handle keyboard
|
||||||
// shortcuts for Windows/Linux
|
// shortcuts for Windows/Linux
|
||||||
const zoom = useZoom();
|
const zoom = useZoom();
|
||||||
useHotKey('app.zoom_in', () => zoom.zoomIn);
|
useHotKey('app.zoom_in', zoom.zoomIn);
|
||||||
useListenToTauriEvent('zoom_in', () => zoom.zoomIn);
|
useListenToTauriEvent('zoom_in', zoom.zoomIn);
|
||||||
useHotKey('app.zoom_out', () => zoom.zoomOut);
|
useHotKey('app.zoom_out', zoom.zoomOut);
|
||||||
useListenToTauriEvent('zoom_out', () => zoom.zoomOut);
|
useListenToTauriEvent('zoom_out', zoom.zoomOut);
|
||||||
useHotKey('app.zoom_reset', () => zoom.zoomReset);
|
useHotKey('app.zoom_reset', zoom.zoomReset);
|
||||||
useListenToTauriEvent('zoom_reset', () => zoom.zoomReset);
|
useListenToTauriEvent('zoom_reset', zoom.zoomReset);
|
||||||
|
|
||||||
const copy = useCopy();
|
const copy = useCopy();
|
||||||
useListenToTauriEvent('generate_theme_css', () => {
|
useListenToTauriEvent('generate_theme_css', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user