use different toolbar size on Mac

see discussion on 984ab9b6fe
This commit is contained in:
Damien Elmes 2021-06-05 11:28:36 +10:00
parent f5fbad2c20
commit dbfe12edbf
3 changed files with 13 additions and 8 deletions

View File

@ -30,6 +30,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script>
<script lang="typescript">
import { isApplePlatform } from "lib/platform";
import StickyBar from "components/StickyBar.svelte";
import ButtonToolbar from "components/ButtonToolbar.svelte";
import ButtonToolbarItem from "components/ButtonToolbarItem.svelte";
@ -47,7 +48,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export const colorButtons = {};
export const templateButtons = {};
export let size = 1.85;
export let size = isApplePlatform() ? 1.6 : 2.0;
export let wrap = true;
</script>

9
ts/lib/platform.ts Normal file
View File

@ -0,0 +1,9 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export function isApplePlatform(): boolean {
return (
window.navigator.platform.startsWith("Mac") ||
window.navigator.platform.startsWith("iP")
);
}

View File

@ -1,16 +1,11 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import * as tr from "./i18n";
import { isApplePlatform } from "./platform";
export type Modifier = "Control" | "Alt" | "Shift" | "Meta";
function isApplePlatform(): boolean {
return (
window.navigator.platform.startsWith("Mac") ||
window.navigator.platform.startsWith("iP")
);
}
// how modifiers are mapped
const platformModifiers = isApplePlatform()
? ["Meta", "Alt", "Shift", "Control"]