mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-24 07:20:16 +05:30
feat(settings): expose monospace font toggle in Settings UI
Add a View > Monospace Font menu (font family radio + ligatures
checkbox) — the app's existing reachable UI surface for this class of
preference (mirrors Theme/Font Size/Spell Check). The menu sends the
change to the renderer, which persists it via the already-working
ipcMain.handle('set-monospace-settings', ...) and applies it live via
the same applyMonospaceClasses() used on initial load.
Amit Haridas
This commit is contained in:
@@ -1875,6 +1875,17 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
applyMonospaceClasses(null);
|
||||
}
|
||||
|
||||
// Reachable UI control: View > Monospace Font menu (main.js) sends the
|
||||
// requested change here; persist it via the existing setter and apply it
|
||||
// live the same way the initial load above does.
|
||||
ipcRenderer.on('monospace-setting-change', (event, partial) => {
|
||||
if (!window.electronAPI || typeof window.electronAPI.invoke !== 'function') return;
|
||||
window.electronAPI
|
||||
.invoke('set-monospace-settings', partial)
|
||||
.then(applyMonospaceClasses)
|
||||
.catch(() => {});
|
||||
});
|
||||
|
||||
// Welcome tab on startup
|
||||
const hasLaunched = localStorage.getItem('hasLaunchedBefore');
|
||||
const showWelcome = localStorage.getItem('showWelcomeOnStartup') !== 'false';
|
||||
|
||||
Reference in New Issue
Block a user