Skip to content

Commit

Permalink
added thumbnail button to mac os style layout and fixed its scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
visnkmr committed Mar 27, 2024
1 parent 8716944 commit 63f7f68
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filedime",
"version": "0.9.53",
"version": "0.9.54",
"private": true,
"engines": {
"node": "20.x"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "filedime"
version = "0.9.53"
version = "0.9.54"
description = "rust based file explorer."
authors = ["visnk"]
license = ""
Expand Down
23 changes: 16 additions & 7 deletions src/components/greet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ export default function Greet() {
</span>):null}
{
layout==="grid"?(
<div>
<>
<div className={`flex flex-row}`}>
{/* <div className={`${isgrid?"mb-3 mt-3":"hidden"}`}> */}

Expand Down Expand Up @@ -2073,27 +2073,36 @@ export default function Greet() {
}/>
</div>
</div>
<div className={`grid sm:grid-cols-2 lg:grid-cols-4 mt-6 overflow-${scrollorauto}}`}>
<div className={`grid sm:grid-cols-2 lg:grid-cols-4 mt-6 overflow-${scrollorauto}`}>


{
filestoshow
.slice(currentpage*perpage,((currentpage)+1)*perpage)
.map((message, index) => (
<div key={index} className="m-3 flex flex-row">
<EachFromGrid message={message} goto={goto} populatesearchlist={populatesearchlist} newtab={newtab} setfos={setfos} showthumbnail={showthumbnail} appWindow={appWindow}/>
<EachFromGrid message={message} goto={goto} populatesearchlist={populatesearchlist} newtab={newtab} setfos={setfos} showthumbnail={showthumbnail} addmark={addmark}/>
</div>

))}
</div>
</div>):null
</>):null

}

{

layout==="miller"?(
layout==="miller"?(<>
<HoverCard>
<HoverCardTrigger>
<Button variant={"outline"} onClick={()=>setst((old)=>!old)}><GalleryThumbnailsIcon className="h-4 w-4"/></Button>
</HoverCardTrigger>
<HoverCardContent className={`${setcolorpertheme}`}>
Show Thumbnails
</HoverCardContent>
</HoverCard>
<div className={`flex ms-2 overflow-scroll`}>

{pathsplitlist
// .filter(function (el) {
// return el.name.toLocaleLowerCase().includes(searchstring.toLocaleLowerCase()) || el.mount_point.toLocaleLowerCase().includes(searchstring.toLocaleLowerCase())
Expand All @@ -2102,15 +2111,15 @@ export default function Greet() {
if(eachif.pathtofol.trim().length>0){

return <div className={`flex ms-2`}>
<MillerCol eachif={eachif} populatesearchlist={populatesearchlist} goto={goto} newtab={newtab} addmark={addmark} searchstring={searchstring} sftype={sftype}/>
<MillerCol eachif={eachif} populatesearchlist={populatesearchlist} goto={goto} newtab={newtab} addmark={addmark} searchstring={searchstring} sftype={sftype} showthumbnail={showthumbnail}/>
</div>

}
return;
})}

</div>
):null
</> ):null
}

</ResizablePanel>
Expand Down
6 changes: 3 additions & 3 deletions src/components/millercol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ interface argprops{
addmark:(path: string) => void;
searchstring:String,
sftype:String,
appWindow?
showthumbnail?
}
export default function MillerCol({eachif,populatesearchlist,goto,newtab,addmark,searchstring,sftype}:argprops){
export default function MillerCol({eachif,populatesearchlist,goto,newtab,addmark,searchstring,sftype,showthumbnail}:argprops){
const filesobjinit:FileItem[]=[]
const [fileslist, setfileslist] = useState(filesobjinit);
useEffect(()=>{
Expand Down Expand Up @@ -48,7 +48,7 @@ export default function MillerCol({eachif,populatesearchlist,goto,newtab,addmark
// if(eachitem.size>0){

return <div key={index} className="m-3 flex flex-row overflow-hidden">
<EachFromGrid message={message} goto={goto} populatesearchlist={populatesearchlist} newtab={newtab} addmark={addmark}/>
<EachFromGrid message={message} goto={goto} populatesearchlist={populatesearchlist} newtab={newtab} addmark={addmark} showthumbnail={showthumbnail}/>
</div>
// }
// return;
Expand Down

0 comments on commit 63f7f68

Please sign in to comment.