-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99c4e25
commit 1535a91
Showing
14 changed files
with
217 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useSetting } from "@Core/Hooks"; | ||
import { Field, Switch } from "@fluentui/react-components"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export const AlwaysOnTop = () => { | ||
const { t } = useTranslation(); | ||
const { value, updateValue } = useSetting({ key: "window.alwaysOnTop", defaultValue: false }); | ||
|
||
return ( | ||
<Field label={t("alwaysOnTop", { ns: "settingsWindow" })}> | ||
<Switch checked={value} onChange={(_, { checked }) => updateValue(checked)} /> | ||
</Field> | ||
); | ||
}; |
25 changes: 25 additions & 0 deletions
25
src/renderer/Core/Settings/Pages/Window/BackgroundMaterial.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Dropdown, Field, Option } from "@fluentui/react-components"; | ||
|
||
type Props = { | ||
backgroundMaterial: string; | ||
setBackgroundMaterial: (backgroundMaterial: string) => void; | ||
}; | ||
|
||
export const BackgroundMaterial = ({ backgroundMaterial, setBackgroundMaterial }: Props) => { | ||
const backgroundMaterialOptions = ["Acrylic", "Mica", "None", "Tabbed"]; | ||
|
||
return ( | ||
<Field label="Background material"> | ||
<Dropdown | ||
value={backgroundMaterial} | ||
onOptionSelect={(_, { optionValue }) => optionValue && setBackgroundMaterial(optionValue)} | ||
> | ||
{backgroundMaterialOptions.map((b) => ( | ||
<Option key={`background-material-option-${b}`} value={b}> | ||
{b} | ||
</Option> | ||
))} | ||
</Dropdown> | ||
</Field> | ||
); | ||
}; |
21 changes: 21 additions & 0 deletions
21
src/renderer/Core/Settings/Pages/Window/HideWindowAfterExecution.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useSetting } from "@Core/Hooks"; | ||
import { Field, Switch } from "@fluentui/react-components"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export const HideWindowAfterExecution = () => { | ||
const { t } = useTranslation(); | ||
|
||
const { value: hideWindowAfterExecution, updateValue: setHideWindowAfterExecution } = useSetting({ | ||
key: "window.hideWindowAfterExecution", | ||
defaultValue: true, | ||
}); | ||
|
||
return ( | ||
<Field label={t("hideWindowAfterExecution", { ns: "settingsWindow" })}> | ||
<Switch | ||
checked={hideWindowAfterExecution} | ||
onChange={(_, { checked }) => setHideWindowAfterExecution(checked)} | ||
/> | ||
</Field> | ||
); | ||
}; |
18 changes: 18 additions & 0 deletions
18
src/renderer/Core/Settings/Pages/Window/HideWindowOnBlur.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useSetting } from "@Core/Hooks"; | ||
import { Field, Switch } from "@fluentui/react-components"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export const HideWindowOnBlur = () => { | ||
const { t } = useTranslation(); | ||
|
||
const { value: hideWindowOnBlur, updateValue: setHideWindowOnBlur } = useSetting({ | ||
key: "window.hideWindowOnBlur", | ||
defaultValue: true, | ||
}); | ||
|
||
return ( | ||
<Field label={t("hideWindowOnBlur", { ns: "settingsWindow" })}> | ||
<Switch checked={hideWindowOnBlur} onChange={(_, { checked }) => setHideWindowOnBlur(checked)} /> | ||
</Field> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useSetting } from "@Core/Hooks"; | ||
import { Field, Slider } from "@fluentui/react-components"; | ||
|
||
export const Opacity = () => { | ||
const { value: acrylicOpacity, updateValue: setAcrylicOpacity } = useSetting({ | ||
key: "window.acrylicOpacity", | ||
defaultValue: 0.6, | ||
}); | ||
|
||
return ( | ||
<Field label={`Opacity: ${acrylicOpacity}`}> | ||
<Slider | ||
min={0} | ||
max={1} | ||
step={0.05} | ||
value={acrylicOpacity} | ||
onChange={(_, { value }) => setAcrylicOpacity(value)} | ||
/> | ||
</Field> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useSetting } from "@Core/Hooks"; | ||
import { Dropdown, Field, Option } from "@fluentui/react-components"; | ||
import { Virtualizer, useStaticVirtualizerMeasure } from "@fluentui/react-components/unstable"; | ||
|
||
export const Vibrancy = () => { | ||
const { value: vibrancy, updateValue: setVibrancy } = useSetting({ key: "window.vibrancy", defaultValue: "None" }); | ||
|
||
const vibrancyOptions = [ | ||
"None", | ||
"content", | ||
"fullscreen-ui", | ||
"header", | ||
"hud", | ||
"menu", | ||
"popover", | ||
"selection", | ||
"sheet", | ||
"sidebar", | ||
"titlebar", | ||
"tooltip", | ||
"under-page", | ||
"under-window", | ||
"window", | ||
]; | ||
|
||
const { virtualizerLength, bufferItems, bufferSize, scrollRef } = useStaticVirtualizerMeasure({ | ||
defaultItemSize: 20, | ||
direction: "vertical", | ||
}); | ||
|
||
return ( | ||
<Field label="Vibrancy"> | ||
<Dropdown | ||
value={vibrancy} | ||
onOptionSelect={(_, { optionValue }) => optionValue && setVibrancy(optionValue)} | ||
listbox={{ ref: scrollRef, style: { maxHeight: 145 } }} | ||
> | ||
<Virtualizer | ||
numItems={vibrancyOptions.length} | ||
virtualizerLength={virtualizerLength} | ||
bufferItems={bufferItems} | ||
bufferSize={bufferSize} | ||
itemSize={20} | ||
> | ||
{(i) => ( | ||
<Option key={`window-vibrancy-option-${vibrancyOptions[i]}`} value={vibrancyOptions[i]}> | ||
{vibrancyOptions[i]} | ||
</Option> | ||
)} | ||
</Virtualizer> | ||
</Dropdown> | ||
</Field> | ||
); | ||
}; |
Oops, something went wrong.