mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
fix window bar position on mobile layout
This commit is contained in:
@@ -14,6 +14,11 @@
|
|||||||
background: var(--theme-colors-background);
|
background: var(--theme-colors-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.windows,
|
||||||
|
.macos {
|
||||||
|
grid-template-rows: 30px calc(100vh - 120px) 90px;
|
||||||
|
}
|
||||||
|
|
||||||
.drawer-button {
|
.drawer-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: calc(90px + 0.75rem);
|
bottom: calc(90px + 0.75rem);
|
||||||
|
|||||||
@@ -11,10 +11,11 @@ import { CommandPalette } from '/@/renderer/features/search/components/command-p
|
|||||||
import { MobileSidebar } from '/@/renderer/features/sidebar/components/mobile-sidebar';
|
import { MobileSidebar } from '/@/renderer/features/sidebar/components/mobile-sidebar';
|
||||||
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
|
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
|
||||||
import { useFullScreenPlayerStore } from '/@/renderer/store';
|
import { useFullScreenPlayerStore } from '/@/renderer/store';
|
||||||
import { useCommandPalette } from '/@/renderer/store';
|
import { useCommandPalette, useWindowSettings } from '/@/renderer/store';
|
||||||
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||||
import { Drawer } from '/@/shared/components/drawer/drawer';
|
import { Drawer } from '/@/shared/components/drawer/drawer';
|
||||||
import { useDisclosure } from '/@/shared/hooks/use-disclosure';
|
import { useDisclosure } from '/@/shared/hooks/use-disclosure';
|
||||||
|
import { Platform } from '/@/shared/types/types';
|
||||||
|
|
||||||
const WindowBar = lazy(() =>
|
const WindowBar = lazy(() =>
|
||||||
import('/@/renderer/layouts/window-bar').then((module) => ({
|
import('/@/renderer/layouts/window-bar').then((module) => ({
|
||||||
@@ -30,10 +31,17 @@ export const MobileLayout = ({ shell }: MobileLayoutProps) => {
|
|||||||
const { opened, ...handlers } = useCommandPalette();
|
const { opened, ...handlers } = useCommandPalette();
|
||||||
const [sidebarOpened, { close: closeSidebar, open: openSidebar }] = useDisclosure(false);
|
const [sidebarOpened, { close: closeSidebar, open: openSidebar }] = useDisclosure(false);
|
||||||
const { expanded: isFullScreenPlayerExpanded } = useFullScreenPlayerStore();
|
const { expanded: isFullScreenPlayerExpanded } = useFullScreenPlayerStore();
|
||||||
|
const { windowBarStyle } = useWindowSettings();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={clsx(styles.layout)} id="mobile-layout">
|
<div
|
||||||
|
className={clsx(styles.layout, {
|
||||||
|
[styles.macos]: windowBarStyle === Platform.MACOS,
|
||||||
|
[styles.windows]: windowBarStyle === Platform.WINDOWS,
|
||||||
|
})}
|
||||||
|
id="mobile-layout"
|
||||||
|
>
|
||||||
{!shell && <WindowBar />}
|
{!shell && <WindowBar />}
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
className={styles.drawerButton}
|
className={styles.drawerButton}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
|
.window-bar {
|
||||||
|
grid-area: window-bar;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
.windows-container {
|
.windows-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
background: var(--theme-colors-background);
|
background: var(--theme-colors-background);
|
||||||
border-bottom: 1px solid alpha(var(--theme-colors-border), 0.5);
|
border-bottom: 1px solid alpha(var(--theme-colors-border), 0.5);
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
@@ -50,11 +56,23 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media only screen and (width < 768px) {
|
||||||
|
.player-status-container {
|
||||||
|
max-width: calc(100vw - 150px);
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.windows-button-group {
|
||||||
|
width: 120px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.macos-container {
|
.macos-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
background: var(--theme-colors-background);
|
background: var(--theme-colors-background);
|
||||||
border-bottom: 1px solid alpha(var(--theme-colors-border), 0.5);
|
border-bottom: 1px solid alpha(var(--theme-colors-border), 0.5);
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export const WindowBar = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className={styles.windowBar}>
|
||||||
{windowBarStyle === Platform.WINDOWS && (
|
{windowBarStyle === Platform.WINDOWS && (
|
||||||
<WindowsControls
|
<WindowsControls
|
||||||
controls={{ handleClose, handleMaximize, handleMinimize }}
|
controls={{ handleClose, handleMaximize, handleMinimize }}
|
||||||
@@ -211,6 +211,6 @@ export const WindowBar = () => {
|
|||||||
title={title}
|
title={title}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user