mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Add dedicated OS window bars (#22)
This commit is contained in:
parent
ececc394e2
commit
58c7370536
25 changed files with 823 additions and 462 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue