@@ -5,7 +5,9 @@ import iconRefresh from "@ktibow/iconset-ion/refresh";
55import iconExtension from "@ktibow/iconset-ion/extension-puzzle-outline" ;
66import iconDownload from "@ktibow/iconset-ion/download-outline" ;
77import iconMore from "@ktibow/iconset-ion/more" ;
8+ import iconPause from "@ktibow/iconset-ion/pause-outline" ;
89import iconClose from "@ktibow/iconset-ion/close" ;
10+ import iconFolder from "@ktibow/iconset-ion/folder-outline" ;
911import iconOpen from "@ktibow/iconset-ion/open-outline" ;
1012import {
1113 closeMenu ,
@@ -122,7 +124,7 @@ const DownloadsPopup: Component<{}> = function (cx) {
122124 < div >
123125 < div class = "title" >
124126 < span > Recent Downloads</ span >
125- < div class = "iconcontainer " >
127+ < div class = "buttoniconcontainer " >
126128 < button
127129 on :click = { ( ) => {
128130 closeMenu ( ) ;
@@ -140,7 +142,52 @@ const DownloadsPopup: Component<{}> = function (cx) {
140142 </ div >
141143 < div class = "contents" >
142144 < span > { b . filename } </ span >
143- < span class = "data" > { formatBytes ( b . size ) } </ span >
145+ { use ( b . progressbytes ) . andThen (
146+ < span class = "data" >
147+ { use ( b . progressbytes ) . map ( ( s ) => formatBytes ( s ! ) ) } /
148+ { formatBytes ( b . size ) }
149+ </ span >
150+ ) }
151+ { use ( b . progressbytes )
152+ . map ( ( b ) => ! b )
153+ . andThen ( < span class = "data" > { formatBytes ( b . size ) } </ span > ) }
154+ { use ( b . progress ) . andThen (
155+ < progress value = { use ( b . progress ) . map ( ( p ) => p || 0 ) } max = "1" >
156+ 50%
157+ </ progress >
158+ ) }
159+ </ div >
160+ < div class = "buttoniconcontainer" >
161+ { use ( b . progress )
162+ . map ( ( b ) => ! b )
163+ . andThen (
164+ < >
165+ < button >
166+ < Icon icon = { iconFolder } > </ Icon >
167+ </ button >
168+ < button >
169+ < Icon icon = { iconOpen } > </ Icon >
170+ </ button >
171+ </ >
172+ ) }
173+ { use ( b . progress ) . andThen (
174+ < >
175+ < button
176+ on :click = { ( ) => {
177+ b . pause ! ( ) ;
178+ } }
179+ >
180+ < Icon icon = { iconPause } > </ Icon >
181+ </ button >
182+ < button
183+ on :click = { ( ) => {
184+ b . cancel ! ( ) ;
185+ } }
186+ >
187+ < Icon icon = { iconClose } > </ Icon >
188+ </ button >
189+ </ >
190+ ) }
144191 </ div >
145192 </ div >
146193 ) ) }
@@ -153,7 +200,7 @@ const DownloadsPopup: Component<{}> = function (cx) {
153200 } }
154201 >
155202 < span > Full Download History</ span >
156- < div class = "iconcontainer " >
203+ < div class = "buttoniconcontainer " >
157204 < Icon icon = { iconOpen } > </ Icon >
158205 </ div >
159206 </ div >
@@ -165,6 +212,7 @@ DownloadsPopup.style = css`
165212 width : 20em ;
166213 display : flex;
167214 flex-direction : column;
215+ user-select : none;
168216 }
169217
170218 .title {
@@ -198,7 +246,7 @@ DownloadsPopup.style = css`
198246 max-height : 30em ;
199247 display : flex;
200248 flex-direction : column;
201- overflow-y : scroll ;
249+ overflow-y : auto ;
202250 overflow-x : hidden;
203251 }
204252
@@ -207,15 +255,52 @@ DownloadsPopup.style = css`
207255 display : flex;
208256 gap : 1em ;
209257 font-size : 0.9em ;
258+ position : relative;
210259 }
211260 .entry : hover {
212261 background : var (--bg20 );
213262 }
214263 .contents {
215264 display : flex;
265+ overflow : hidden;
216266 flex-direction : column;
217267 gap : 0.5em ;
218268 }
269+ .entry .buttoniconcontainer {
270+ display : none;
271+ }
272+ .entry : hover .buttoniconcontainer {
273+ display : flex;
274+ }
275+ .entry .buttoniconcontainer {
276+ position : absolute;
277+ right : 0 ;
278+ top : 0 ;
279+ padding : 1em ;
280+ background : var (--bg20 );
281+ height : 100% ;
282+ align-items : start;
283+ gap : 1em ;
284+ }
285+ .entry .buttoniconcontainer button {
286+ font-size : 1.15em ;
287+ position : relative;
288+ z-index : 1 ;
289+ display : flex;
290+ }
291+ .entry .buttoniconcontainer button : hover ::before {
292+ content : "" ;
293+ z-index : -1 ;
294+ position : absolute;
295+ width : 150% ;
296+ height : 150% ;
297+ top : 50% ;
298+ left : 50% ;
299+ transform : translate (-50% , -50% );
300+ background : var (--fg4 );
301+ border-radius : 50% ;
302+ }
303+
219304 .contents .data {
220305 color : var (--fg2 );
221306 }
@@ -230,7 +315,7 @@ DownloadsPopup.style = css`
230315 background : var (--bg20 );
231316 }
232317
233- .iconcontainer {
318+ .buttoniconcontainer {
234319 flex : 1 ;
235320 display : flex;
236321 justify-content : right;
0 commit comments