mirror of
https://git.srhtnin.garden/sarah/SaraSuite.git
synced 2026-10-15 02:33:17 +02:00
macOS support (code only, no build yet)
This commit is contained in:
1 parent
1feb6d4336
commit
ca04dcd4a7
17 files changed
+572
-126
No files matched your search
+11
-8
@@ -8,8 +8,8 @@ from typing import Callable
|
||||
import flet as ft
|
||||
|
||||
from Core import (
|
||||
AppConfig, BundledFontFamily, ChildEnvironment, ChipButtonStyle, EnsureSharedThemes, IsWindows,
|
||||
LoadSharedSettings, Palette, SharedSettings, ThemesDir,
|
||||
AppConfig, BundledFontFamily, ChildEnvironment, ChipButtonStyle, EnsureSharedThemes, IsMac, IsWindows,
|
||||
LoadSharedSettings, Palette, SharedConfigPath, SharedSettings, ThemesDir,
|
||||
)
|
||||
from Installer import DefaultAnswers, DefaultOptions
|
||||
from Manifests import Program
|
||||
@@ -32,12 +32,15 @@ def _Themes() -> list[str]:
|
||||
|
||||
|
||||
def _Fonts() -> list[str]:
|
||||
"""Installed font families (fontconfig, or the registry on Windows), with
|
||||
the bundled font first."""
|
||||
if IsWindows:
|
||||
import WindowsSupport
|
||||
"""Installed font families (fontconfig, the registry on Windows, the font
|
||||
files themselves on macOS), with the bundled font first."""
|
||||
if IsWindows or IsMac:
|
||||
if IsMac:
|
||||
import MacSupport as Support
|
||||
else:
|
||||
import WindowsSupport as Support
|
||||
|
||||
Families = WindowsSupport.FontFamilies()
|
||||
Families = Support.FontFamilies()
|
||||
Families.discard(BundledFontFamily)
|
||||
return [BundledFontFamily] + sorted(Families, key=str.lower)
|
||||
try:
|
||||
@@ -98,7 +101,7 @@ def ShowSettingsDialog(Page: ft.Page, Config: AppConfig, Programs: list[Program]
|
||||
Categories: dict[str, ft.Control] = {
|
||||
"Shared": ft.Column(
|
||||
[
|
||||
_Note("Shared by every SaraSuite program (~/.config/SaraSuite/Config.toml)."),
|
||||
_Note(f"Shared by every SaraSuite program ({SharedConfigPath})."),
|
||||
UseSharedSwitch,
|
||||
ft.Divider(height=1, color=Palette.Surface1),
|
||||
SharedTheme,
|
||||
|
||||
Reference in new issue
Block a user