Add dedicated OS window bars (#22)

This commit is contained in:
jeffvli 2023-03-28 23:59:51 -07:00
parent ececc394e2
commit 58c7370536
25 changed files with 823 additions and 462 deletions

View file

@ -2,14 +2,20 @@ import { useLocation } from 'react-router';
import { AppRoute } from '/@/renderer/router/routes';
import { useSidebarRightExpanded } from '/@/renderer/store';
import { useGeneralSettings } from '/@/renderer/store/settings.store';
import { Platform } from '/@/renderer/types';
export const useShouldPadTitlebar = () => {
const location = useLocation();
const isSidebarExpanded = useSidebarRightExpanded();
const isQueuePage = location.pathname === AppRoute.NOW_PLAYING;
const { sideQueueType } = useGeneralSettings();
const { sideQueueType, windowBarStyle } = useGeneralSettings();
// If the sidebar is expanded, the sidebar queue is enabled, and the user is not on the queue page
const conditions = [
windowBarStyle === Platform.WEB,
!(isSidebarExpanded && sideQueueType === 'sideQueue' && !isQueuePage),
];
return !(isSidebarExpanded && sideQueueType === 'sideQueue' && !isQueuePage);
const shouldPadTitlebar = conditions.every((condition) => condition);
return shouldPadTitlebar;
};