move title to default layout

This commit is contained in:
Kendall Garner
2025-09-15 20:10:56 -07:00
parent dad80adb8b
commit d68165dab5
2 changed files with 33 additions and 27 deletions
+8 -23
View File
@@ -12,14 +12,9 @@ import macMinHover from './assets/min-mac-hover.png';
import macMin from './assets/min-mac.png';
import styles from './window-bar.module.css';
import {
useAppStore,
useCurrentStatus,
useQueueStatus,
useWindowSettings,
} from '/@/renderer/store';
import { useWindowSettings } from '/@/renderer/store';
import { Text } from '/@/shared/components/text/text';
import { Platform, PlayerStatus } from '/@/shared/types/types';
import { Platform } from '/@/shared/types/types';
const localSettings = isElectron() ? window.api.localSettings : null;
@@ -126,26 +121,16 @@ const MacOsControls = ({ controls, title }: WindowBarControlsProps) => {
);
};
export const WindowBar = () => {
const playerStatus = useCurrentStatus();
const { currentSong, index, length } = useQueueStatus();
const { windowBarStyle } = useWindowSettings();
const { privateMode } = useAppStore();
interface WindowBarProps {
title: string;
}
const statusString = playerStatus === PlayerStatus.PAUSED ? '(Paused) ' : '';
const queueString = length ? `(${index + 1} / ${length}) ` : '';
const privateModeString = privateMode ? '(Private mode)' : '';
const title = `${
length
? `${statusString}${queueString}${currentSong?.name}${currentSong?.artistName ? `${currentSong?.artistName}` : ''}`
: 'Feishin'
}${privateMode ? ` ${privateModeString}` : ''}`;
document.title = title;
export const WindowBar = ({ title }: WindowBarProps) => {
const { windowBarStyle } = useWindowSettings();
const handleMinimize = () => minimize();
const [max, setMax] = useState(localSettings?.env.START_MAXIMIZED || false);
const handleMinimize = () => minimize();
const handleMaximize = useCallback(() => {
if (max) {
unmaximize();