diff --git a/src/renderer/src/components/DeviceFrames.scss b/src/renderer/src/components/DeviceFrames.scss
index 06dd0ea..9322873 100644
--- a/src/renderer/src/components/DeviceFrames.scss
+++ b/src/renderer/src/components/DeviceFrames.scss
@@ -64,7 +64,7 @@
}
}
-#frame-desktop {
+#frame-tdesktop {
display: flex;
aspect-ratio: 0.566;
max-width: 100%;
@@ -79,9 +79,25 @@
}
}
+#frame-macos {
+ display: flex;
+ aspect-ratio: 0.621;
+ max-width: 100%;
+ height: 70%;
+ position: relative;
+ overflow: hidden;
+
+ > div {
+ display: flex;
+ flex-grow: 1;
+ overflow: hidden;
+ }
+}
+
#frame-iphone,
#frame-android,
-#frame-desktop {
+#frame-tdesktop,
+#frame-macos {
&.placeholder {
background-color: var(--device-frame-color-placeholder);
border-color: var(--device-frame-border-placeholder);
@@ -106,6 +122,10 @@
border-radius: 12% / 6%;
}
-#frame-desktop.placeholder {
+#frame-tdesktop.placeholder {
+ border-radius: 0.625rem;
+}
+
+#frame-macos.placeholder {
border-radius: 0.625rem;
}
diff --git a/src/renderer/src/components/DeviceFrames.tsx b/src/renderer/src/components/DeviceFrames.tsx
index dde2bf0..b1bd82f 100644
--- a/src/renderer/src/components/DeviceFrames.tsx
+++ b/src/renderer/src/components/DeviceFrames.tsx
@@ -2,7 +2,7 @@ import "./DeviceFrames.scss";
import type { ParentComponent } from "solid-js";
-export const IPhoneFrame: ParentComponent<{
+export const FrameIPhone: ParentComponent<{
classList?: {
[k: string]: boolean | undefined;
};
@@ -14,7 +14,7 @@ export const IPhoneFrame: ParentComponent<{
);
};
-export const AndroidFrame: ParentComponent<{
+export const FrameAndroid: ParentComponent<{
classList?: {
[k: string]: boolean | undefined;
};
@@ -26,13 +26,25 @@ export const AndroidFrame: ParentComponent<{
);
};
-export const DesktopFrame: ParentComponent<{
+export const FrameDesktop: ParentComponent<{
classList?: {
[k: string]: boolean | undefined;
};
}> = (props) => {
return (
-
+
+ );
+};
+
+export const FrameMacOS: ParentComponent<{
+ classList?: {
+ [k: string]: boolean | undefined;
+ };
+}> = (props) => {
+ return (
+
);
diff --git a/src/renderer/src/components/DialogCreateProject.tsx b/src/renderer/src/components/DialogCreateProject.tsx
index 8cb000d..b1ef844 100644
--- a/src/renderer/src/components/DialogCreateProject.tsx
+++ b/src/renderer/src/components/DialogCreateProject.tsx
@@ -14,6 +14,7 @@ import Input from "./Input";
import { isValidURL } from "@renderer/utils/general";
import type { TelegramPlatform } from "@renderer/utils/themes";
import Alert from "./Alert";
+import { defaultProjectSettings } from "@renderer/utils/telegram";
const DialogCreateProject: Component = () => {
const [form, setForm] = createStore({
@@ -50,24 +51,17 @@ const DialogCreateProject: Component = () => {
token: form.token,
};
- const defaultSettings: Project["settings"][TelegramPlatform] = {
- expanded: false,
- mode: "light",
- open: true,
- floating: false,
- };
-
setPreferences("projects", [
...preferences.projects,
{
...project,
settings: {
- android: defaultSettings,
- ios: defaultSettings,
- tdesktop: defaultSettings,
- web: defaultSettings,
- weba: defaultSettings,
- macos: defaultSettings,
+ android: defaultProjectSettings,
+ ios: defaultProjectSettings,
+ tdesktop: defaultProjectSettings,
+ web: defaultProjectSettings,
+ weba: defaultProjectSettings,
+ macos: defaultProjectSettings,
},
},
]);
diff --git a/src/renderer/src/components/FloatingProject.scss b/src/renderer/src/components/FloatingProject.scss
index 6f65c49..aed3904 100644
--- a/src/renderer/src/components/FloatingProject.scss
+++ b/src/renderer/src/components/FloatingProject.scss
@@ -29,7 +29,8 @@ body.floating-project {
#section-telegram-ios,
#section-telegram-android,
- #section-telegram-tdesktop {
+ #section-telegram-tdesktop,
+ #section-telegram-macos {
> div {
width: 100%;
@@ -43,11 +44,13 @@ body.floating-project {
#frame-iphone,
#frame-android,
- #frame-desktop {
+ #frame-tdesktop,
+ #frame-macos {
width: 100% !important;
}
- #viewport-telegram-desktop {
+ #viewport-telegram-tdesktop,
+ #viewport-telegram-macos {
> section {
> header {
> div {
diff --git a/src/renderer/src/components/FloatingProject.tsx b/src/renderer/src/components/FloatingProject.tsx
index 037aa2f..6da6daa 100644
--- a/src/renderer/src/components/FloatingProject.tsx
+++ b/src/renderer/src/components/FloatingProject.tsx
@@ -11,11 +11,15 @@ import { initStore } from "@renderer/utils/store";
import { preferences, setPreferences } from "@renderer/utils/preferences";
import { createStore, produce } from "solid-js/store";
import type { TMAProjectFrame } from "@renderer/pages/Project";
-import { generateProjectFrame } from "@renderer/utils/telegram";
+import {
+ defaultProjectSettings,
+ generateProjectFrame,
+} from "@renderer/utils/telegram";
import { deserializeObject } from "@renderer/utils/general";
import { useSettings } from "@renderer/contexts/SettingsContext";
import { PlatformNames } from "@renderer/utils/platforms";
import { ViewportDesktop } from "@renderer/sections/ViewportDesktop";
+import { ViewportMacOS } from "@renderer/sections/ViewportMacOS";
const FloatingProject: Component = () => {
const params = useParams();
@@ -40,12 +44,14 @@ const FloatingProject: Component = () => {
const projectItem = store.projects.find(
(item) => item.id === project.id,
);
+
if (projectItem) {
- projectItem.settings[platform].mode = projectFrame.state.mode;
- projectItem.settings[platform].expanded = projectFrame.state.expanded;
- projectItem.settings[platform].open = projectFrame.state.open;
- projectItem.settings[platform].floating =
- projectFrame.window.floating;
+ projectItem.settings[platform] = {
+ expanded: projectFrame.state.expanded,
+ floating: projectFrame.window.floating,
+ mode: projectFrame.state.mode,
+ open: projectFrame.state.open,
+ };
}
}),
);
@@ -61,67 +67,50 @@ const FloatingProject: Component = () => {
});
return (
-
-
-
);
};
diff --git a/src/renderer/src/components/PlatformToggle.tsx b/src/renderer/src/components/PlatformToggle.tsx
index a0ed5ce..d3e92d2 100644
--- a/src/renderer/src/components/PlatformToggle.tsx
+++ b/src/renderer/src/components/PlatformToggle.tsx
@@ -10,7 +10,7 @@ import { produce } from "solid-js/store";
export const PlatformToggle: Component = () => {
return (
diff --git a/src/renderer/src/sections/ViewportAndroid.tsx b/src/renderer/src/sections/ViewportAndroid.tsx
index bfa89b7..06f3b39 100644
--- a/src/renderer/src/sections/ViewportAndroid.tsx
+++ b/src/renderer/src/sections/ViewportAndroid.tsx
@@ -1,6 +1,6 @@
import "../scss/sections/_viewport-android.scss";
-import { AndroidFrame } from "@renderer/components/DeviceFrames";
+import { FrameAndroid } from "@renderer/components/DeviceFrames";
import type { Project } from "@renderer/types";
import { stringToColorDark, getNameInitials } from "@renderer/utils/general";
import {
@@ -62,7 +62,7 @@ export const ViewportAndroid: Component<{
});
return (
-
-
+
);
};
diff --git a/src/renderer/src/sections/ViewportDesktop.tsx b/src/renderer/src/sections/ViewportDesktop.tsx
index b4e00b0..942c6bc 100644
--- a/src/renderer/src/sections/ViewportDesktop.tsx
+++ b/src/renderer/src/sections/ViewportDesktop.tsx
@@ -1,6 +1,6 @@
-import "../scss/sections/_viewport-desktop.scss";
+import "../scss/sections/_viewport-tdesktop.scss";
-import { DesktopFrame } from "@renderer/components/DeviceFrames";
+import { FrameDesktop } from "@renderer/components/DeviceFrames";
import type { Project } from "@renderer/types";
import { stringToColorDark, getNameInitials } from "@renderer/utils/general";
import {
@@ -40,7 +40,7 @@ export const ViewportDesktop: Component<{
setProjectFrame("state", "expanded", true);
return (
-
-
+
);
};
diff --git a/src/renderer/src/sections/ViewportIOS.tsx b/src/renderer/src/sections/ViewportIOS.tsx
index 96ccc9b..625008b 100644
--- a/src/renderer/src/sections/ViewportIOS.tsx
+++ b/src/renderer/src/sections/ViewportIOS.tsx
@@ -1,6 +1,6 @@
import "../scss/sections/_viewport-ios.scss";
-import { IPhoneFrame } from "@renderer/components/DeviceFrames";
+import { FrameIPhone } from "@renderer/components/DeviceFrames";
import type { Project } from "@renderer/types";
import { stringToColorDark, getNameInitials } from "@renderer/utils/general";
import {
@@ -54,7 +54,7 @@ export const ViewportIOS: Component<{
});
return (
-