...
|
...
|
@@ -31,6 +31,7 @@
|
31
|
31
|
* 20250320 Fix add-dirdata button appearance.
|
32
|
32
|
* Dirdata colors. Select dirdata.
|
33
|
33
|
* 20250329 Background loading of thumbnails.
|
|
34
|
+ * 20250330 Refine background loading.
|
34
|
35
|
*
|
35
|
36
|
* Author: Dario Rodriguez dario@darionomono.com
|
36
|
37
|
* (c) Dario Rodriguez 2025
|
...
|
...
|
@@ -291,7 +292,7 @@ void im_body_free(body_t *body);
|
291
|
292
|
int im_body_add(body_t *body,char *dir);
|
292
|
293
|
|
293
|
294
|
int im_body_mouse(body_t *body, Vector2 mousepos, Vector2 wheel, int lmbpressed, int lmbreleased, int lmbdown, int *click_avail);
|
294
|
|
-int im_body_draw(body_t *body, Vector2 mousepos, int lmbdown, int rmbdown, int windowwidth, int windowheight, int *needs_nextredraw);
|
|
295
|
+int im_body_draw(body_t *body, Vector2 mousepos, int lmbdown, int rmbdown, int windowwidth, int windowheight, int *needs_nextredraw, int scrollspeed);
|
295
|
296
|
|
296
|
297
|
int listing_get(listing_t *listing, char *pathprefix, char *path, int flag_sort);
|
297
|
298
|
void listing_freedata(listing_t *listing);
|
...
|
...
|
@@ -421,7 +422,7 @@ fprintf(stderr,"SELECTED: \"%s\"->\"%s\"\n",sel_menu,sel_submenu);
|
421
|
422
|
/* draw screen contents */
|
422
|
423
|
BeginDrawing();
|
423
|
424
|
ClearBackground(RAYWHITE);
|
424
|
|
- im_body_draw(im->body,mousepos,lmbdown,rmbdown,im->w,im->h,&needs_nextredraw);
|
|
425
|
+ im_body_draw(im->body,mousepos,lmbdown,rmbdown,im->w,im->h,&needs_nextredraw,scrollspeed);
|
425
|
426
|
im_menubar_draw(im->menubar,im->w,im->h,&needs_nextredraw);
|
426
|
427
|
#if 0
|
427
|
428
|
{
|
...
|
...
|
@@ -976,7 +977,7 @@ im_body_mouse(body_t *body, Vector2 mousepos, Vector2 wheel, int lmbpressed, int
|
976
|
977
|
}
|
977
|
978
|
|
978
|
979
|
int
|
979
|
|
-im_body_draw(body_t *body, Vector2 mousepos, int lmbdown, int rmbdown, int windowwidth, int windowheight, int *needs_nextredraw)
|
|
980
|
+im_body_draw(body_t *body, Vector2 mousepos, int lmbdown, int rmbdown, int windowwidth, int windowheight, int *needs_nextredraw, int scrollspeed)
|
980
|
981
|
{
|
981
|
982
|
int i,k,margin,righty;
|
982
|
983
|
int lastx,lasty;
|
...
|
...
|
@@ -1142,7 +1143,7 @@ DrawRectangle(UNROLLXYWH(body->backxywh),((Color){ 0,255,0,255 })); /* hit zone
|
1142
|
1143
|
}
|
1143
|
1144
|
/* show image */
|
1144
|
1145
|
has_imagedrawn=0;
|
1145
|
|
- if(is_imagefilename(elem->name+1)) {
|
|
1146
|
+ if(is_imagefilename(elem->name+1) && !(thumb->screenxywh.y>(body->xywh.y+body->xywh.h) || (thumb->screenxywh.y+thumb->screenxywh.h)<body->xywh.y)) {
|
1146
|
1147
|
if(thumb->has_texture==0 && thumb->has_failedload==0) {
|
1147
|
1148
|
bgload_t *bgload;
|
1148
|
1149
|
char fullpath[2048];
|
...
|
...
|
@@ -1189,7 +1190,7 @@ fprintf(stderr,"elem:\"%s\" sidelen:%i old:%ix%i new:%ix%i\n",elem->name+1,sidel
|
1189
|
1190
|
DrawTexture(*te,thumb->screenxywh.x,thumb->screenxywh.y,WHITE);
|
1190
|
1191
|
has_imagedrawn=1;
|
1191
|
1192
|
lastx=xywh->x+xywh->w,lasty=xywh->y+xywh->h+yoff;
|
1192
|
|
- if(is_leftside && rmbdown==0 && is_imutil_insidexywh(mousepos,&(thumb->screenxywh),margin)) {
|
|
1193
|
+ if(is_leftside && rmbdown==0 && is_imutil_insidexywh(mousepos,&(thumb->screenxywh),margin) && scrollspeed==0) {
|
1193
|
1194
|
/* draw image in rightside */
|
1194
|
1195
|
char fullpath[2048];
|
1195
|
1196
|
int maxw,maxh;
|
...
|
...
|
@@ -1291,8 +1292,9 @@ fprintf(stderr,"elem:\"%s\" sidelen:%i old:%ix%i new:%ix%i\n",elem->name+1,sidel
|
1291
|
1292
|
DrawRectangle(0,windowheight-1-margin*2-font->height,m2.x+margin*2,font->height+margin*2,((Color){0,0,0,96}));
|
1292
|
1293
|
DrawTextEx(font->font,statustooltip,(Vector2){margin,windowheight-1-margin-font->height},font->height,0,(Color){ 255,255,255,128 });
|
1293
|
1294
|
}
|
1294
|
|
- /* free not used bg load items */
|
1295
|
|
- bg_freeunmarked(body->bg);
|
|
1295
|
+ /* free not used bg load items (only if idle, as it takes time) */
|
|
1296
|
+ if(scrollspeed==0 && *needs_nextredraw==0)
|
|
1297
|
+ bg_freeunmarked(body->bg);
|
1296
|
1298
|
return(0);
|
1297
|
1299
|
}
|
1298
|
1300
|
|