Skip to content

Commit 88a80ed

Browse files
committed
First pass at system settings & theming
1 parent f7c5ef8 commit 88a80ed

19 files changed

Lines changed: 319 additions & 37 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.app-side-bar {
2+
grid-area: side-bar;
3+
width: 100%;
4+
height: 100%;
5+
&__items {
6+
width: 100%;
7+
box-sizing: border-box;
8+
}
9+
10+
&__item {
11+
border-radius: 10px;
12+
padding: 6px 10px;
13+
box-sizing: border-box;
14+
box-shadow: 2px 2px 4px rgb(0, 0, 0, 0);
15+
&:hover {
16+
backdrop-filter: brightness(150%);
17+
transition: ease-in 0.2s;
18+
}
19+
&:active {
20+
box-shadow: 2px 2px 4px rgb(0, 0, 0, 0.5) inset;
21+
}
22+
}
23+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import "./AppSideBar.scss";
2+
3+
interface SideBarItem {
4+
title: string;
5+
onClick: () => void;
6+
isActive?: boolean;
7+
}
8+
9+
interface AppSideBarProps {
10+
items: Array<SideBarItem>;
11+
}
12+
13+
function AppSideBar({ items }: AppSideBarProps) {
14+
return (
15+
<div className="app-side-bar">
16+
<div className="app-side-bar__items">
17+
{items.map((item) => {
18+
return (
19+
<div
20+
className={`app-side-bar__item ${item.isActive ? "active" : ""} `}
21+
onClick={item.onClick}
22+
key={item.title}
23+
>
24+
{item.title}
25+
</div>
26+
);
27+
})}
28+
</div>
29+
</div>
30+
);
31+
}
32+
33+
export default AppSideBar;

src/components/AppSideBar/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import AppSideBar from "./AppSideBar";
2+
3+
export default AppSideBar;

src/components/BorderedApp/BorderedApp.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import BorderedAppMenu, {
99
import usePositionableElement from "../../hooks/usePositionableElement";
1010

1111
import "./BorderedApp.scss";
12+
import useSystemSettings from "../../stores/systemSettingsStore";
1213
interface BorderedAppProps extends BaseProps {
1314
title: string;
1415
type: string;
@@ -30,6 +31,7 @@ function BorderedApp({
3031
zIndex,
3132
}: React.PropsWithChildren<BorderedAppProps>) {
3233
const winMan = useWindowManagerStore();
34+
const settings = useSystemSettings();
3335

3436
// Need a ref to point to the app for moving it around the screen
3537
const appRef = useRef<HTMLDivElement>(null);
@@ -64,6 +66,7 @@ function BorderedApp({
6466
width: initialDimensions.width,
6567
height: initialDimensions.height,
6668
zIndex,
69+
backgroundColor: settings.mainColor,
6770
}}
6871
>
6972
<div className="bordered-app__corner-nw" ref={resizeHandleNW} />

src/components/BorderedApp/BorderedAppMenu/BorderedAppMenu.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
width: auto;
77
position: fixed;
88
box-sizing: border-box;
9+
box-shadow: 0 0 2px rgb(0, 0, 0, 0.5);
910
// Cant use backdrop-filter on fixed elements :(
1011
// backdrop-filter: blur(8px) brightness(130%);
11-
background-color: darkmagenta;
12+
// background-color: darkmagenta;
1213

1314
&__content {
1415
box-sizing: border-box;

src/components/BorderedApp/BorderedAppMenu/BorderedAppMenu.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useEffect, useRef, useState } from "react";
22
import "./BorderedAppMenu.scss";
3+
import useSystemSettings from "../../../stores/systemSettingsStore";
34

45
export interface BorderedAppMenuItemProps {
56
title: string;
@@ -88,12 +89,14 @@ function BorderedAppMenuItems({
8889
items: Array<BorderedAppMenuItemProps>;
8990
position: { x: number; y: number };
9091
}) {
92+
const settings = useSystemSettings();
9193
return (
9294
<div
9395
className="bordered-app-menu-items"
9496
style={{
9597
left: position.x,
9698
top: position.y,
99+
backgroundColor: settings.mainColor,
97100
}}
98101
>
99102
<div className="bordered-app-menu-items__content">
@@ -116,6 +119,7 @@ function BorderedAppMenu({ title, items }: BorderedAppMenuProps) {
116119
const [open, setOpen] = useState<boolean>(false);
117120
const elementRef = useRef<HTMLDivElement>(null);
118121
const position = useRef<{ x: number; y: number }>({ x: 0, y: 0 });
122+
const settings = useSystemSettings();
119123

120124
useEffect(() => {
121125
const rect = elementRef.current?.getBoundingClientRect();

src/components/BottomBar/BottomBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
import CalculatorLauncher from "../../programs/Calculator/CalculatorLauncher";
22
import FileBrowserLauncher from "../../programs/FileBrowser/FileBrowserLauncher";
3+
import SettingsLauncher from "../../programs/Settings/SettingsLauncher";
34
import TextEditorLauncher from "../../programs/TextEditor/TextEditorLauncher";
45
import WebBrowserLauncher from "../../programs/WebBrowser/WebBrowserLauncher";
6+
import useSystemSettings from "../../stores/systemSettingsStore";
57

68
import "./BottomBar.scss";
79

810
interface BottomBarProps {}
911

1012
// eslint-disable-next-line no-empty-pattern
1113
function BottomBar({}: BottomBarProps) {
14+
const settings = useSystemSettings();
1215
return (
1316
<div id="bottom-bar__container">
14-
<div id="bottom-bar">
17+
<div id="bottom-bar" style={{ backgroundColor: settings.mainColor }}>
1518
<div id="bottom-bar__contents">
1619
<TextEditorLauncher />
1720
<CalculatorLauncher />
1821
<WebBrowserLauncher />
1922
<FileBrowserLauncher />
23+
<SettingsLauncher />
2024
</div>
2125
</div>
2226
</div>

src/components/Desktop/Desktop.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
// background: url("https://cdn.dribbble.com/users/1658867/screenshots/4721860/attachments/1064507/wallpaper_1280x720.jpg");
2121
/** Background credit to https://dribbble.com/erikalam **/
2222

23-
background: url("https://images.pling.com/img/00/00/66/42/38/1904144/nord-lake.png");
24-
background: url("https://regolith-linux.org/images/releases/nord-dark.png");
23+
// background: url("https://images.pling.com/img/00/00/66/42/38/1904144/nord-lake.png");
24+
// background: url("https://regolith-linux.org/images/releases/nord-dark.png");
2525

2626
background-size: cover;
2727
background-repeat: no-repeat;

src/components/Desktop/Desktop.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ import Content from "../Content";
33
import BottomBar from "../BottomBar";
44

55
import "./Desktop.scss";
6+
import useSystemSettings from "../../stores/systemSettingsStore";
67

78
interface DesktopProps {}
89

910
// eslint-disable-next-line no-empty-pattern
1011
function Desktop({}: DesktopProps) {
12+
const settings = useSystemSettings();
1113
return (
1214
<div id="desktop">
13-
<div id="desktop__background" />
15+
<div
16+
id="desktop__background"
17+
style={{
18+
backgroundImage: `url(${settings.background})`,
19+
}}
20+
/>
1421
<TopBar />
1522
<Content />
1623
<BottomBar />

src/components/TopBar/TopBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import useSystemSettings from "../../stores/systemSettingsStore";
12
import ClockMenu from "./ClockMenu";
23
import FocusedWindowMenu from "./FocusedWindowMenu";
34
import SystemTray from "./SystemTray";
@@ -7,9 +8,10 @@ interface TopBarProps {}
78

89
// eslint-disable-next-line no-empty-pattern
910
function TopBar({}: TopBarProps) {
11+
const settings = useSystemSettings();
1012
return (
1113
<div id="top-bar__container">
12-
<div id="top-bar">
14+
<div id="top-bar" style={{ backgroundColor: settings.mainColor }}>
1315
<div id="top-bar__contents">
1416
<FocusedWindowMenu />
1517
<ClockMenu />

0 commit comments

Comments
 (0)