refactor(components): add window dragging + remove resize
This commit is contained in:
parent
32dfc41589
commit
9652ec9122
@ -5,31 +5,33 @@ import { Image } from '../Image'
|
|||||||
|
|
||||||
export const TitleBar: React.FC = () => {
|
export const TitleBar: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<nav className='flex h-[37.5px] items-center justify-between bg-[#1f1f1f] text-white'>
|
<nav className='flex w-full h-[40px] items-center justify-between bg-[#1f1f1f] text-white'>
|
||||||
|
<div
|
||||||
|
className='w-full select-none'
|
||||||
|
onMouseDown={async () => {
|
||||||
|
return await appWindow.startDragging()
|
||||||
|
}}>
|
||||||
<Image src='/Logo.svg' size={60} className='ml-3 p-1' />
|
<Image src='/Logo.svg' size={60} className='ml-3 p-1' />
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul className='flex h-full'>
|
<ul className='flex h-full'>
|
||||||
<li
|
<li
|
||||||
|
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-[#2a2a2a]'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
return await appWindow.minimize()
|
return await appWindow.minimize()
|
||||||
}}
|
}}>
|
||||||
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-[#2a2a2a]'>
|
|
||||||
<Minus />
|
<Minus />
|
||||||
</li>
|
</li>
|
||||||
<li
|
|
||||||
onClick={async () => {
|
<li className='grid h-full w-14 place-items-center cursor-not-allowed opacity-40'>
|
||||||
return (await appWindow.isMaximized())
|
|
||||||
? await appWindow.unmaximize()
|
|
||||||
: await appWindow.maximize()
|
|
||||||
}}
|
|
||||||
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-[#2a2a2a]'>
|
|
||||||
<Maximize size={20} />
|
<Maximize size={20} />
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
|
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-red-500'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
return await appWindow.close()
|
return await appWindow.close()
|
||||||
}}
|
}}>
|
||||||
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-red-500'>
|
|
||||||
<X />
|
<X />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user