mirror of
https://github.com/siddharthvaddem/openscreen.git
synced 2026-11-01 20:32:20 +08:00
Improve tray layout documentation
This commit is contained in:
@@ -60,6 +60,7 @@ const ICON_CONFIG = {
|
||||
|
||||
type IconName = keyof typeof ICON_CONFIG;
|
||||
|
||||
/** Renders the configured icon for a HUD control. */
|
||||
function getIcon(name: IconName, className?: string) {
|
||||
const { icon: Icon, size } = ICON_CONFIG[name];
|
||||
return <Icon size={size} className={className} />;
|
||||
@@ -81,6 +82,7 @@ const hudSidebarClasses = "ml-0.5 pl-1.5 border-l border-white/10 flex items-cen
|
||||
const hudSidebarVerticalClasses =
|
||||
"mt-0.5 pt-1.5 border-t border-white/10 flex flex-col items-center gap-0.5";
|
||||
|
||||
/** Launches the floating recording HUD and its recorder controls. */
|
||||
export function LaunchWindow() {
|
||||
const t = useScopedT("launch");
|
||||
const availableLocales = getAvailableLocales();
|
||||
@@ -371,6 +373,7 @@ export function LaunchWindow() {
|
||||
window.electronAPI.hudOverlayClose();
|
||||
}
|
||||
};
|
||||
/** Switches the HUD between horizontal and vertical tray layouts. */
|
||||
const toggleTrayLayout = () => {
|
||||
const nextLayout = trayLayout === "horizontal" ? "vertical" : "horizontal";
|
||||
setTrayLayout(nextLayout);
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"resumeRecording": "繼續錄製",
|
||||
"openVideoFile": "開啟影片檔案",
|
||||
"openProject": "開啟專案",
|
||||
"useVerticalTray": "使用直向工具列",
|
||||
"useHorizontalTray": "使用橫向工具列"
|
||||
"useVerticalTray": "使用直向托盤",
|
||||
"useHorizontalTray": "使用橫向托盤"
|
||||
},
|
||||
"audio": {
|
||||
"enableSystemAudio": "啟用系統音訊",
|
||||
|
||||
@@ -42,6 +42,7 @@ export const DEFAULT_PREFS: UserPreferences = {
|
||||
trayLayout: "horizontal",
|
||||
};
|
||||
|
||||
/** Parses stored preferences without throwing on malformed JSON. */
|
||||
function safeJsonParse(text: string | null): Record<string, unknown> | null {
|
||||
if (!text) return null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user