mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 07:19:45 +02:00
Fix pointer window drag
This commit is contained in:
Binary file not shown.
@@ -1,11 +1,14 @@
|
|||||||
import { memo } from 'react';
|
|
||||||
import { useActiveRequestId } from '../hooks/useActiveRequestId';
|
import { useActiveRequestId } from '../hooks/useActiveRequestId';
|
||||||
import { useDeleteRequest } from '../hooks/useDeleteRequest';
|
import { useDeleteRequest } from '../hooks/useDeleteRequest';
|
||||||
import { Dropdown } from './core/Dropdown';
|
import { Dropdown } from './core/Dropdown';
|
||||||
import { Icon } from './core/Icon';
|
import { Icon } from './core/Icon';
|
||||||
import { IconButton } from './core/IconButton';
|
import { IconButton } from './core/IconButton';
|
||||||
|
|
||||||
export const RequestSettingsDropdown = memo(function RequestSettingsDropdown() {
|
interface Props {
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RequestSettingsDropdown({ className }: Props) {
|
||||||
const activeRequestId = useActiveRequestId();
|
const activeRequestId = useActiveRequestId();
|
||||||
const deleteRequest = useDeleteRequest(activeRequestId ?? null);
|
const deleteRequest = useDeleteRequest(activeRequestId ?? null);
|
||||||
return (
|
return (
|
||||||
@@ -24,7 +27,7 @@ export const RequestSettingsDropdown = memo(function RequestSettingsDropdown() {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<IconButton size="sm" title="Request Options" icon="gear" />
|
<IconButton className={className} size="sm" title="Request Options" icon="gear" />
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
|||||||
@@ -37,26 +37,22 @@ export default function Workspace() {
|
|||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-[auto_1fr] grid-rows-1 h-full text-gray-900">
|
<div className="grid grid-cols-[auto_1fr] grid-rows-1 h-full text-gray-900">
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
<div
|
<div ref={mainContentRef} className="grid grid-rows-[auto_minmax(0,1fr)] h-full">
|
||||||
ref={mainContentRef}
|
|
||||||
data-tauri-drag-region
|
|
||||||
className="grid grid-rows-[auto_minmax(0,1fr)] h-full"
|
|
||||||
>
|
|
||||||
<HStack
|
<HStack
|
||||||
as={WindowDragRegion}
|
as={WindowDragRegion}
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
className="pointer-events-none px-3 bg-gray-50 text-gray-900 border-b border-b-gray-200 pt-[1px]"
|
className="px-3 bg-gray-50 text-gray-900 border-b border-b-gray-200 pt-[1px]"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
>
|
>
|
||||||
<div className="flex-1 -ml-2 pointer-events-none">
|
<div className="flex-1 -ml-2 pointer-events-none">
|
||||||
<WorkspaceDropdown className="pointer-events-auto" />
|
<WorkspaceDropdown className="pointer-events-auto" />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-[2] text-center text-gray-700 text-sm truncate">
|
<div className="flex-[2] text-center text-gray-700 text-sm truncate pointer-events-none">
|
||||||
{activeRequest?.name}
|
{activeRequest?.name}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 flex justify-end -mr-2">
|
<div className="flex-1 flex justify-end -mr-2 pointer-events-none">
|
||||||
<IconButton size="sm" title="" icon="magnifyingGlass" />
|
<IconButton size="sm" title="" icon="magnifyingGlass" />
|
||||||
<RequestSettingsDropdown />
|
<RequestSettingsDropdown className="pointer-events-auto" />
|
||||||
</div>
|
</div>
|
||||||
</HStack>
|
</HStack>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
@apply bg-transparent;
|
@apply bg-transparent;
|
||||||
}
|
}
|
||||||
&.cm-focused .cm-selectionBackground {
|
&.cm-focused .cm-selectionBackground {
|
||||||
@apply bg-violet-500/20;
|
@apply bg-selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Style gutters */
|
/* Style gutters */
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ module.exports = {
|
|||||||
"5xl": "3.052rem"
|
"5xl": "3.052rem"
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
|
selection: "hsl(var(--color-violet-500) / 0.4)",
|
||||||
focus: "hsl(var(--color-blue-500) / 0.6)",
|
focus: "hsl(var(--color-blue-500) / 0.6)",
|
||||||
invalid: "hsl(var(--color-red-500))",
|
invalid: "hsl(var(--color-red-500))",
|
||||||
highlight: "hsl(var(--color-gray-200) / 0.3)",
|
highlight: "hsl(var(--color-gray-200) / 0.3)",
|
||||||
|
|||||||
Reference in New Issue
Block a user