Customize title bar (#1184)

* add basic title bar

* add title bar actions

* fix layout

* update title bar

* update layout

* fix title bar for macOS

* UI

* setup menu for macOS

* fix title bar logo
This commit is contained in:
an-lee
2024-11-17 16:02:17 +08:00
committed by GitHub
parent b8167a99d8
commit 8bebf2072c
27 changed files with 771 additions and 277 deletions

View File

@@ -8,7 +8,6 @@ import { DbProviderContext } from "@renderer/context";
import { UserSettingKeyEnum } from "@/types/enums";
import {
AlertDialog,
AlertDialogTrigger,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
@@ -16,10 +15,10 @@ import {
AlertDialogFooter,
AlertDialogCancel,
AlertDialogAction,
Button,
} from "@renderer/components/ui";
import { t } from "i18next";
import { redirect } from "react-router-dom";
import { Preferences } from "@renderer/components";
type AppSettingsProviderState = {
webApi: Client;
@@ -50,6 +49,8 @@ type AppSettingsProviderState = {
setRecorderConfig?: (config: RecorderConfigType) => Promise<void>;
// remote config
ipaMappings?: { [key: string]: string };
displayPreferences?: boolean;
setDisplayPreferences?: (display: boolean) => void;
};
const EnjoyApp = window.__ENJOY_APP__;
@@ -87,6 +88,7 @@ export const AppSettingsProvider = ({
IPA_MAPPINGS
);
const [loggingOut, setLoggingOut] = useState<boolean>(false);
const [displayPreferences, setDisplayPreferences] = useState<boolean>(false);
const db = useContext(DbProviderContext);
@@ -344,12 +346,14 @@ export const AppSettingsProvider = ({
setProxy: setProxyConfigHandler,
vocabularyConfig,
setVocabularyConfig: setVocabularyConfigHandler,
initialized: Boolean(db.state === "connected" && libraryPath),
initialized: Boolean(user && db.state === "connected" && libraryPath),
ahoy,
cable,
recorderConfig,
setRecorderConfig: setRecorderConfigHandler,
ipaMappings,
displayPreferences,
setDisplayPreferences,
}}
>
{children}