diff --git a/src-tauri/run.bat b/src-tauri/run.bat.old
similarity index 92%
rename from src-tauri/run.bat
rename to src-tauri/run.bat.old
index c3ea2425d..70ae2a8c8 100644
--- a/src-tauri/run.bat
+++ b/src-tauri/run.bat.old
@@ -1,5 +1,8 @@
@echo off
setlocal enableextensions
+
+echo "TEST"
+
cd /d "C:\Program Files (x86)\SlimeVR Server"
jre\bin\java.exe -Xmx512M -jar slimevr.jar --no-gui
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index b8f088946..4a452227c 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -4,7 +4,7 @@
)]
use std::path::PathBuf;
-use std::process::Command;
+use std::process::{Command};
// the payload type must implement `Serialize` and `Clone`.
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 327388637..9ce4a450c 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -53,7 +53,9 @@
"width": 1150,
"height": 660,
"resizable": true,
- "fullscreen": false
+ "fullscreen": false,
+ "decorations": false,
+ "transparent": true
}
],
"security": {
diff --git a/src/App.tsx b/src/App.tsx
index 81b949a05..0bd1ef093 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,4 +1,3 @@
-import { Navbar } from './components/Navbar';
import { useProvideWebsocketApi, useWebsocketAPI, WebSocketApiContext } from './hooks/websocket-api';
import {
BrowserRouter as Router,
@@ -6,23 +5,15 @@ import {
Route,
} from "react-router-dom";
import { Overview } from './components/Overview';
-import { BigButton } from './components/commons/BigButton';
-import { QuickResetIcon, ResetIcon } from './components/commons/icon/ResetIcon';
-import { useReset } from './hooks/reset';
-import { Button } from './components/commons/Button';
-import { useLayout } from './hooks/layout';
import { BodyProportions } from './components/proportions/BodyProportions';
-import { BVHButton } from './components/BVHButton';
import { AppContextProvider } from './components/providers/AppContext';
import { useEffect } from 'react';
-import { DataFeedConfigT, DataFeedMessage, DeviceDataMaskT, ResetType, StartDataFeedT, TrackerDataMaskT } from 'solarxr-protocol';
-import { Settings } from './components/Settings';
-
+import { DataFeedConfigT, DataFeedMessage, DeviceDataMaskT, StartDataFeedT, TrackerDataMaskT } from 'solarxr-protocol';
+import { Settings } from './components/settings/Settings';
+import { MainLayoutRoute } from './components/MainLayout';
+import { SettingsLayoutRoute } from './components/settings/SettingsLayout';
function Layout() {
- const { layoutHeight, ref } = useLayout();
- const { reset, timer, reseting } = useReset()
-
const { sendDataFeedPacket } = useWebsocketAPI();
useEffect(() => {
@@ -47,36 +38,25 @@ function Layout() {
sendDataFeedPacket(DataFeedMessage.StartDataFeed, startDataFeed)
}, [])
-
-
return (
<>
-
-
-
-
- }/>
- }/>
- }/>
-
-
-
-
- } onClick={() => reset(ResetType.Quick)} >
-
-
- } onClick={() => reset(ResetType.Full)} disabled={reseting}>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ }/>
+
+
+
+ }/>
+
+
+
+ }/>
+
>
)
}
@@ -88,15 +68,10 @@ function App() {
-
+
{!websocketAPI.isConnected &&
Connection lost to server
}
- {websocketAPI.isConnected &&
- <>
-
-
- >
- }
+ {websocketAPI.isConnected &&
}
diff --git a/src/components/MainLayout.tsx b/src/components/MainLayout.tsx
new file mode 100644
index 000000000..a4853e3ed
--- /dev/null
+++ b/src/components/MainLayout.tsx
@@ -0,0 +1,52 @@
+import { ReactChild } from "react";
+import { NavLink } from "react-router-dom";
+import { ResetType } from "solarxr-protocol";
+import { useLayout } from "../hooks/layout";
+import { BVHButton } from "./BVHButton";
+import { Button } from "./commons/Button";
+import { CubeIcon } from "./commons/icon/CubeIcon";
+import { GearIcon } from "./commons/icon/GearIcon";
+import { Navbar, NavButton } from "./Navbar";
+import { ResetButton } from "./ResetButton";
+
+
+export function MainLayoutRoute({ children }: { children: ReactChild }) {
+
+ const { layoutHeight, ref } = useLayout();
+
+ return (
+ <>
+
+ <>
+ }>Overview
+ }>Body proportions
+ >
+
+
+
+
+ {children}
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
*/}
+
+
+ Settings
+
+
+
+
+
+ >
+ )
+ }
\ No newline at end of file
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 491268ac9..89ec89648 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -7,6 +7,11 @@ import {
import { CubeIcon } from './commons/icon/CubeIcon';
import { GearIcon } from './commons/icon/GearIcon';
import { SlimeVRIcon } from './commons/icon/SimevrIcon';
+import { appWindow } from '@tauri-apps/api/window'
+import { MinimiseIcon } from './commons/icon/MinimiseIcon';
+import { MaximiseIcon } from './commons/icon/MaximiseIcon';
+import { CloseIcon } from './commons/icon/CloseIcon';
+import { useWebsocketAPI } from '../hooks/websocket-api';
export function NavButton({ to, children, match, icon }: { to: string, children: ReactChild, match?: string, icon: ReactChild }) {
@@ -16,31 +21,40 @@ export function NavButton({ to, children, match, icon }: { to: string, children:
});
return (
-
+
{children}
-
+
)
}
-export function Navbar() {
+export function Navbar({ children }: { children?: ReactChild }) {
return (
-
-
-
-
-
+
+
-
-
}>Overview
-
}>Body proportions
-
}>Settings
+ {children &&
+ {children}
+
}
+
+
appWindow.minimize()}>
+
+
+
appWindow.maximize()}>
+
+
+
appWindow.close()}>
+
+
)
diff --git a/src/components/Overview.tsx b/src/components/Overview.tsx
index 84908ea3d..594894378 100644
--- a/src/components/Overview.tsx
+++ b/src/components/Overview.tsx
@@ -35,7 +35,7 @@ export function Overview() {
return (
- Tracker Overview
+ Assigned Trackers
{asignedTrackers.map(({ tracker, device }, index) =>
)}
diff --git a/src/hooks/reset.ts b/src/components/ResetButton.tsx
similarity index 69%
rename from src/hooks/reset.ts
rename to src/components/ResetButton.tsx
index 14b7e2a27..52ffd794f 100644
--- a/src/hooks/reset.ts
+++ b/src/components/ResetButton.tsx
@@ -1,16 +1,19 @@
import { useRef, useState } from "react";
import { ResetRequestT, ResetType, RpcMessage } from "solarxr-protocol";
-import { useWebsocketAPI } from "./websocket-api";
+import { useWebsocketAPI } from "../hooks/websocket-api";
+import { BigButton } from "./commons/BigButton";
+import { QuickResetIcon, ResetIcon } from "./commons/icon/ResetIcon";
-export function useReset() {
+export function ResetButton({ type }: { type: ResetType }) {
+
const timerid = useRef(null);
const [reseting, setReseting] = useState(false);
const [timer, setTimer] = useState(0);
const { sendRPCPacket } = useWebsocketAPI();
- const reset = (type: ResetType) => {
+ const reset = () => {
const req = new ResetRequestT();
req.resetType = type;
setReseting(true);
@@ -35,9 +38,13 @@ export function useReset() {
}
}
- return {
- reset,
- timer,
- reseting
- }
+ return (
+ : }
+ onClick={reset}
+ disabled={reseting}>
+
+ )
+
+
}
\ No newline at end of file
diff --git a/src/components/commons/icon/CloseIcon.tsx b/src/components/commons/icon/CloseIcon.tsx
new file mode 100644
index 000000000..b9a64f49c
--- /dev/null
+++ b/src/components/commons/icon/CloseIcon.tsx
@@ -0,0 +1,11 @@
+
+
+
+export function CloseIcon({ className }: { className?: string }) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/src/components/commons/icon/MaximiseIcon.tsx b/src/components/commons/icon/MaximiseIcon.tsx
new file mode 100644
index 000000000..886e23a38
--- /dev/null
+++ b/src/components/commons/icon/MaximiseIcon.tsx
@@ -0,0 +1,10 @@
+
+
+
+export function MaximiseIcon({ className }: { className?: string }) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/src/components/commons/icon/MinimiseIcon.tsx b/src/components/commons/icon/MinimiseIcon.tsx
new file mode 100644
index 000000000..79c503016
--- /dev/null
+++ b/src/components/commons/icon/MinimiseIcon.tsx
@@ -0,0 +1,10 @@
+
+
+
+export function MinimiseIcon({ className }: { className?: string }) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/src/components/commons/icon/SimevrIcon.tsx b/src/components/commons/icon/SimevrIcon.tsx
index 2c1153489..76957a211 100644
--- a/src/components/commons/icon/SimevrIcon.tsx
+++ b/src/components/commons/icon/SimevrIcon.tsx
@@ -1,9 +1,9 @@
-export function SlimeVRIcon() {
+export function SlimeVRIcon({ drag }: { drag: boolean }) {
return (
-