1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 13:07:58 +00:00

Correctly open settings & about dialogs

This commit is contained in:
Romein van Buren 2023-12-23 14:10:48 +01:00
parent 3a325fe064
commit 4e68bf324c
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 18 additions and 9 deletions

View File

@ -30,6 +30,10 @@
</Modal> </Modal>
<style> <style>
.brand, .info {
line-height: 1.2;
}
.brand { .brand {
display: flex; display: flex;
align-items: center; align-items: center;
@ -40,9 +44,9 @@
flex: 0 1 125px; flex: 0 1 125px;
} }
.brand .title { .brand .title {
font-size: 2.25rem; font-size: 2.25em;
font-weight: 600; font-weight: 600;
line-height: 2.5rem; margin-bottom: .25em;
} }
.brand .title .version { .brand .title .version {
font-size: 80%; font-size: 80%;
@ -51,7 +55,6 @@
} }
.brand .description { .brand .description {
font-size: 1.5rem; font-size: 1.5rem;
line-height: 1.6rem;
} }
hr { hr {
@ -60,7 +63,6 @@
.info { .info {
font-size: 1.25rem; font-size: 1.25rem;
line-height: 1.25rem;
margin: 0 1rem 1rem; margin: 0 1rem 1rem;
text-align: center; text-align: center;
} }

View File

@ -1,13 +1,20 @@
import './styles/reset.css'; import './styles/reset.css';
import './styles/style.css'; import './styles/style.css';
import { LogError } from '$wails/runtime/runtime.js'; import { EventsOn, LogError } from '$wails/runtime/runtime.js';
import dialogs from '$lib/dialogs.js';
import App from './app.svelte'; import App from './app.svelte';
import AboutDialog from './dialogs/about.svelte';
import SettingsDialog from './dialogs/settings/index.svelte';
window.addEventListener('unhandledrejection', event => { window.addEventListener('unhandledrejection', event => {
LogError('Unhandled JS rejection: ' + event.reason); LogError('Unhandled JS rejection: ' + event.reason);
}); });
EventsOn('global.about', () => dialogs.new(AboutDialog));
EventsOn('global.settings', () => dialogs.new(SettingsDialog));
const app = new App({ target: document.getElementById('app') }); const app = new App({ target: document.getElementById('app') });
export default app; export default app;

View File

@ -24,12 +24,12 @@ func (a *App) Menu() *menu.Menu {
appMenu := menu.NewMenu() appMenu := menu.NewMenu()
aboutMenu := appMenu.AddSubmenu("Rolens") aboutMenu := appMenu.AddSubmenu("Rolens")
aboutMenu.AddText("About Rolens", nil, menuCallbackEmit(a, "OpenAboutModal")) aboutMenu.AddText("About Rolens", nil, menuCallbackEmit(a, "global.about"))
aboutMenu.AddSeparator() aboutMenu.AddSeparator()
aboutMenu.AddText("Preferences…", keys.CmdOrCtrl(","), menuCallbackEmit(a, "OpenPreferences")) aboutMenu.AddText("Preferences…", keys.CmdOrCtrl(","), menuCallbackEmit(a, "global.settings"))
aboutMenu.AddSeparator() aboutMenu.AddSeparator()
aboutMenu.AddText("Open data directory", nil, func(cd *menu.CallbackData) { a.ui.Reveal(a.Env.DataDirectory) }) aboutMenu.AddText("Open data directory", nil, func(cd *menu.CallbackData) { a.ui.Reveal(a.Env.DataDirectory) })
aboutMenu.AddText("Open log directory", nil, func(cd *menu.CallbackData) { a.ui.Reveal(a.Env.LogDirectory) }) aboutMenu.AddText("Open log directory", nil, func(cd *menu.CallbackData) { a.ui.Reveal(a.Env.LogDirectory) })
aboutMenu.AddText("Purge logs…", nil, func(cd *menu.CallbackData) { a.PurgeLogDirectory() }) aboutMenu.AddText("Purge logs…", nil, func(cd *menu.CallbackData) { a.PurgeLogDirectory() })
aboutMenu.AddSeparator() aboutMenu.AddSeparator()