MCPcopy Create free account
hub / github.com/Moebytes/Frame-Player / TitleBar

Function TitleBar

components/TitleBar.tsx:31–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29import "./styles/titlebar.less"
30
31const TitleBar: React.FunctionComponent = () => {
32 const {hover, videoDrag} = useActiveSelector()
33 const {setVideoDrag} = useActiveActions()
34 const {theme, os, transparent, pinned} = useThemeSelector()
35 const {setTheme, setOS, setTransparent, setPinned} = useThemeActions()
36 const [iconHover, setIconHover] = useState(false)
37
38 useEffect(() => {
39 window.ipcRenderer.on("toggle-pinned", switchPinned)
40 return () => {
41 window.ipcRenderer.removeListener("toggle-pinned", switchPinned)
42 }
43 }, [])
44
45 const onMouseDown = () => {
46 window.ipcRenderer.send("moveWindow")
47 }
48
49 const close = () => {
50 window.ipcRenderer.invoke("close")
51 }
52
53 const minimize = async () => {
54 await window.ipcRenderer.invoke("minimize")
55 setIconHover(false)
56 }
57
58 const maximize = () => {
59 window.ipcRenderer.invoke("maximize")
60 }
61
62 const upload = () => {
63 window.ipcRenderer.invoke("upload-file", false)
64 }
65
66 const download = () => {
67 window.ipcRenderer.invoke("trigger-download")
68 }
69
70 const search = () => {
71 window.ipcRenderer.invoke("show-link-dialog")
72 }
73
74 const fx = () => {
75 window.ipcRenderer.invoke("show-fx-dialog")
76 }
77
78 const drag = () => {
79 setVideoDrag(!videoDrag)
80 }
81
82 const switchTheme = () => {
83 setTheme(theme === "light" ? "dark" : "light")
84 }
85
86 const switchOSStyle = () => {
87 setOS(os === "mac" ? "windows" : "mac")
88 }

Callers

nothing calls this directly

Calls 6

useActiveSelectorFunction · 0.85
useActiveActionsFunction · 0.85
useThemeSelectorFunction · 0.85
useThemeActionsFunction · 0.85
macTitleBarFunction · 0.85
windowsTitleBarFunction · 0.85

Tested by

no test coverage detected