Tooltip colours

This commit is contained in:
Connor Yoh 2025-08-20 16:46:55 +01:00
parent fc9c4fdb7f
commit 12855b1002
4 changed files with 72 additions and 64 deletions

View File

@ -18,27 +18,27 @@ const DesktopLayout: React.FC = () => {
return ( return (
<Grid gutter="xs" h="100%" grow={false} style={{ flexWrap: 'nowrap', minWidth: 0 }}> <Grid gutter="xs" h="100%" grow={false} style={{ flexWrap: 'nowrap', minWidth: 0 }}>
{/* Column 1: File Sources */} {/* Column 1: File Sources */}
<Grid.Col span="content" p="lg" style={{ <Grid.Col span="content" p="lg" style={{
minWidth: '13.625rem', minWidth: '13.625rem',
width: '13.625rem', width: '13.625rem',
flexShrink: 0, flexShrink: 0,
height: '100%', height: '100%',
}}> }}>
<FileSourceButtons /> <FileSourceButtons />
</Grid.Col> </Grid.Col>
{/* Column 2: File List */} {/* Column 2: File List */}
<Grid.Col span="auto" style={{ <Grid.Col span="auto" style={{
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
height: '100%', height: '100%',
minHeight: 0, minHeight: 0,
minWidth: 0, minWidth: 0,
flex: '1 1 0px' flex: '1 1 0px'
}}> }}>
<div style={{ <div style={{
flex: 1, flex: 1,
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
backgroundColor: 'var(--bg-file-list)', backgroundColor: 'var(--bg-file-list)',
border: '1px solid var(--mantine-color-gray-2)', border: '1px solid var(--mantine-color-gray-2)',
@ -47,13 +47,13 @@ const DesktopLayout: React.FC = () => {
}}> }}>
{activeSource === 'recent' && ( {activeSource === 'recent' && (
<> <>
<div style={{ <div style={{
flexShrink: 0, flexShrink: 0,
borderBottom: '1px solid var(--mantine-color-gray-3)' borderBottom: '1px solid var(--mantine-color-gray-3)'
}}> }}>
<SearchInput /> <SearchInput />
</div> </div>
<div style={{ <div style={{
flexShrink: 0, flexShrink: 0,
borderBottom: '1px solid var(--mantine-color-gray-3)' borderBottom: '1px solid var(--mantine-color-gray-3)'
}}> }}>
@ -61,11 +61,11 @@ const DesktopLayout: React.FC = () => {
</div> </div>
</> </>
)} )}
<div style={{ flex: 1, minHeight: 0 }}> <div style={{ flex: 1, minHeight: 0 }}>
<FileListArea <FileListArea
scrollAreaHeight={`calc(${modalHeight} )`} scrollAreaHeight={`calc(${modalHeight} )`}
scrollAreaStyle={{ scrollAreaStyle={{
height: activeSource === 'recent' && recentFiles.length > 0 ? modalHeight : '100%', height: activeSource === 'recent' && recentFiles.length > 0 ? modalHeight : '100%',
backgroundColor: 'transparent', backgroundColor: 'transparent',
border: 'none', border: 'none',
@ -75,12 +75,12 @@ const DesktopLayout: React.FC = () => {
</div> </div>
</div> </div>
</Grid.Col> </Grid.Col>
{/* Column 3: File Details */} {/* Column 3: File Details */}
<Grid.Col p="xl" span="content" style={{ <Grid.Col p="xl" span="content" style={{
minWidth: '25rem', minWidth: '25rem',
width: '25rem', width: '25rem',
flexShrink: 0, flexShrink: 0,
height: '100%', height: '100%',
maxWidth: '18rem' maxWidth: '18rem'
}}> }}>
@ -88,11 +88,11 @@ const DesktopLayout: React.FC = () => {
<FileDetails /> <FileDetails />
</div> </div>
</Grid.Col> </Grid.Col>
{/* Hidden file input for local file selection */} {/* Hidden file input for local file selection */}
<HiddenFileInput /> <HiddenFileInput />
</Grid> </Grid>
); );
}; };
export default DesktopLayout; export default DesktopLayout;

View File

@ -1,21 +1,15 @@
import React from 'react'; import React from "react";
import { Group, Button, Text, Tooltip, ActionIcon } from '@mantine/core'; import { Group, Text, ActionIcon, Tooltip } from "@mantine/core";
import SelectAllIcon from '@mui/icons-material/SelectAll'; import SelectAllIcon from "@mui/icons-material/SelectAll";
import DeleteIcon from '@mui/icons-material/Delete'; import DeleteIcon from "@mui/icons-material/Delete";
import DownloadIcon from '@mui/icons-material/Download'; import DownloadIcon from "@mui/icons-material/Download";
import { useTranslation } from 'react-i18next'; import { useTranslation } from "react-i18next";
import { useFileManagerContext } from '../../contexts/FileManagerContext'; import { useFileManagerContext } from "../../contexts/FileManagerContext";
const FileActions: React.FC = () => { const FileActions: React.FC = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { const { recentFiles, selectedFileIds, filteredFiles, onSelectAll, onDeleteSelected, onDownloadSelected } =
recentFiles, useFileManagerContext();
selectedFileIds,
filteredFiles,
onSelectAll,
onDeleteSelected,
onDownloadSelected,
} = useFileManagerContext();
const handleSelectAll = () => { const handleSelectAll = () => {
onSelectAll(); onSelectAll();
@ -42,52 +36,53 @@ const FileActions: React.FC = () => {
const hasSelection = selectedFileIds.length > 0; const hasSelection = selectedFileIds.length > 0;
return ( return (
<div style={{ <div
padding: '0.75rem 1rem', style={{
backgroundColor: 'var(--mantine-color-gray-0)', padding: "0.75rem 1rem",
display: 'flex', backgroundColor: "var(--mantine-color-gray-1)",
alignItems: 'center', display: "flex",
justifyContent: 'space-between', alignItems: "center",
minHeight: '3rem', justifyContent: "space-between",
position: 'relative', minHeight: "3rem",
}}> position: "relative",
}}
>
{/* Left: Select All */} {/* Left: Select All */}
<div> <div>
<Tooltip <Tooltip
label={allFilesSelected label={allFilesSelected ? t("fileManager.deselectAll", "Deselect All") : t("fileManager.selectAll", "Select All")}
? t('fileManager.deselectAll', 'Deselect All')
: t('fileManager.selectAll', 'Select All')
}
> >
<ActionIcon <ActionIcon
variant="light" variant="light"
size="sm" size="sm"
color='dimmed' color="dimmed"
onClick={handleSelectAll} onClick={handleSelectAll}
disabled={filteredFiles.length === 0} disabled={filteredFiles.length === 0}
radius="sm" radius="sm"
> >
<SelectAllIcon style={{ fontSize: '1rem' }} /> <SelectAllIcon style={{ fontSize: "1rem" }} />
</ActionIcon> </ActionIcon>
</Tooltip> </Tooltip>
</div> </div>
{/* Center: Selected count */} {/* Center: Selected count */}
<div style={{ <div
position: 'absolute', style={{
left: '50%', position: "absolute",
transform: 'translateX(-50%)', left: "50%",
}}> transform: "translateX(-50%)",
}}
>
{hasSelection && ( {hasSelection && (
<Text size="sm" c="dimmed" fw={500}> <Text size="sm" c="dimmed" fw={500}>
{t('fileManager.selectedCount', '{{count}} selected', { count: selectedFileIds.length })} {t("fileManager.selectedCount", "{{count}} selected", { count: selectedFileIds.length })}
</Text> </Text>
)} )}
</div> </div>
{/* Right: Delete and Download */} {/* Right: Delete and Download */}
<Group gap="xs"> <Group gap="xs">
<Tooltip label={t('fileManager.deleteSelected', 'Delete Selected')}> <Tooltip label={t("fileManager.deleteSelected", "Delete Selected")}>
<ActionIcon <ActionIcon
variant="light" variant="light"
size="sm" size="sm"
@ -96,11 +91,11 @@ const FileActions: React.FC = () => {
disabled={!hasSelection} disabled={!hasSelection}
radius="sm" radius="sm"
> >
<DeleteIcon style={{ fontSize: '1rem' }} /> <DeleteIcon style={{ fontSize: "1rem" }} />
</ActionIcon> </ActionIcon>
</Tooltip> </Tooltip>
<Tooltip label={t('fileManager.downloadSelected', 'Download Selected')}> <Tooltip label={t("fileManager.downloadSelected", "Download Selected")}>
<ActionIcon <ActionIcon
variant="light" variant="light"
size="sm" size="sm"
@ -109,7 +104,7 @@ const FileActions: React.FC = () => {
disabled={!hasSelection} disabled={!hasSelection}
radius="sm" radius="sm"
> >
<DownloadIcon style={{ fontSize: '1rem' }} /> <DownloadIcon style={{ fontSize: "1rem" }} />
</ActionIcon> </ActionIcon>
</Tooltip> </Tooltip>
</Group> </Group>

View File

@ -40,7 +40,7 @@ const FileListItem: React.FC<FileListItemProps> = ({
p="sm" p="sm"
style={{ style={{
cursor: 'pointer', cursor: 'pointer',
backgroundColor: isSelected ? 'var(--mantine-color-gray-0)' : (shouldShowHovered ? 'var(--mantine-color-gray-0)' : 'var(--bg-file-list)'), backgroundColor: isSelected ? 'var(--mantine-color-gray-1)' : (shouldShowHovered ? 'var(--mantine-color-gray-1)' : 'var(--bg-file-list)'),
opacity: isSupported ? 1 : 0.5, opacity: isSupported ? 1 : 0.5,
transition: 'background-color 0.15s ease', transition: 'background-color 0.15s ease',
userSelect: 'none', userSelect: 'none',

View File

@ -191,6 +191,19 @@ export const mantineTheme = createTheme({
}, },
}, },
}, },
Tooltip: {
styles: {
tooltip: {
backgroundColor: 'var( --tooltip-title-bg)',
color: 'var( --tooltip-title-color)',
border: '1px solid var(--tooltip-borderp)',
fontSize: '0.75rem',
fontWeight: '500',
boxShadow: 'var(--shadow-md)',
borderRadius: 'var(--radius-sm)',
},
},
},
Checkbox: { Checkbox: {
styles: { styles: {