[Bf-blender-cvs] [1049b0c818e] asset-browser-grid-view: Merge branch 'master' into asset-browser-grid-view

Julian Eisel noreply at git.blender.org
Wed May 18 22:43:19 CEST 2022


Commit: 1049b0c818e85c97d709a8616fc522ea71bbf1e3
Author: Julian Eisel
Date:   Wed May 18 22:27:59 2022 +0200
Branches: asset-browser-grid-view
https://developer.blender.org/rB1049b0c818e85c97d709a8616fc522ea71bbf1e3

Merge branch 'master' into asset-browser-grid-view

===================================================================



===================================================================

diff --cc source/blender/editors/interface/interface.cc
index 55baa1b0d6b,d6719f0aa9f..ec2ae43acda
--- a/source/blender/editors/interface/interface.cc
+++ b/source/blender/editors/interface/interface.cc
@@@ -3996,10 -3990,10 +4014,14 @@@ static void ui_but_alloc_info(const eBu
        alloc_size = sizeof(uiButTreeRow);
        alloc_str = "uiButTreeRow";
        break;
+     case UI_BTYPE_HOTKEY_EVENT:
+       alloc_size = sizeof(uiButHotkeyEvent);
+       alloc_str = "uiButHotkeyEvent";
+       break;
 +    case UI_BTYPE_GRID_TILE:
 +      alloc_size = sizeof(uiButGridTile);
 +      alloc_str = "uiButGridTile";
 +      break;
      default:
        alloc_size = sizeof(uiBut);
        alloc_str = "uiBut";
diff --cc source/blender/editors/interface/interface_query.cc
index 560f30578a2,ea1fe3923e4..2bcb419cfba
--- a/source/blender/editors/interface/interface_query.cc
+++ b/source/blender/editors/interface/interface_query.cc
@@@ -58,17 -58,23 +58,28 @@@ bool ui_but_is_toggle(const uiBut *but
                UI_BTYPE_TREEROW);
  }
  
 +bool ui_but_is_view_item(const uiBut *but)
 +{
 +  return ELEM(but->type, UI_BTYPE_TREEROW, UI_BTYPE_GRID_TILE);
 +}
 +
- bool ui_but_is_interactive(const uiBut *but, const bool labeledit)
+ bool ui_but_is_interactive_ex(const uiBut *but, const bool labeledit, const bool for_tooltip)
  {
    /* NOTE: #UI_BTYPE_LABEL is included for highlights, this allows drags. */
-   if ((but->type == UI_BTYPE_LABEL) && but->dragpoin == nullptr && but->tip_func == nullptr) {
-     return false;
+   if (but->type == UI_BTYPE_LABEL) {
+     if (for_tooltip) {
+       /* It's important labels are considered interactive for the purpose of showing tooltip. */
+       if (but->dragpoin == nullptr && but->tip_func == nullptr) {
+         return false;
+       }
+     }
+     else {
+       if (but->dragpoin == nullptr) {
+         return false;
+       }
+     }
    }
+ 
    if (ELEM(but->type, UI_BTYPE_ROUNDBOX, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_LISTBOX)) {
      return false;
    }
@@@ -449,19 -462,9 +467,19 @@@ static bool ui_but_is_treerow(const uiB
    return but->type == UI_BTYPE_TREEROW;
  }
  
 +static bool ui_but_is_view_item_fn(const uiBut *but, const void *UNUSED(customdata))
 +{
 +  return ui_but_is_view_item(but);
 +}
 +
 +uiBut *ui_view_item_find_mouse_over(const ARegion *region, const int xy[2])
 +{
-   return ui_but_find_mouse_over_ex(region, xy, false, ui_but_is_view_item_fn, NULL);
++  return ui_but_find_mouse_over_ex(region, xy, false, false, ui_but_is_view_item_fn, nullptr);
 +}
 +
  uiBut *ui_tree_row_find_mouse_over(const ARegion *region, const int xy[2])
  {
-   return ui_but_find_mouse_over_ex(region, xy, false, ui_but_is_treerow, nullptr);
+   return ui_but_find_mouse_over_ex(region, xy, false, false, ui_but_is_treerow, nullptr);
  }
  
  static bool ui_but_is_active_treerow(const uiBut *but, const void *customdata)
diff --cc source/blender/editors/space_file/filelist.c
index 9cd22f866ce,cfbbc1a1b45..bc7dc452ae9
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@@ -1639,8 -1618,25 +1639,8 @@@ static void filelist_cache_preview_runf
    //  printf("%s: Start (%d)...\n", __func__, threadid);
  
    //  printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img);
 -  BLI_assert(preview->flags &
 -             (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT | FILE_TYPE_BLENDER |
 -              FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB));
 -
 -  if (preview->flags & FILE_TYPE_IMAGE) {
 -    source = THB_SOURCE_IMAGE;
 -  }
 -  else if (preview->flags &
 -           (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB)) {
 -    source = THB_SOURCE_BLEND;
 -  }
 -  else if (preview->flags & FILE_TYPE_MOVIE) {
 -    source = THB_SOURCE_MOVIE;
 -  }
 -  else if (preview->flags & FILE_TYPE_FTFONT) {
 -    source = THB_SOURCE_FONT;
 -  }
  
-   IMB_thumb_path_lock(preview->path);
+   IMB_thumb_path_lock(preview->filepath);
    /* Always generate biggest preview size for now, it's simpler and avoids having to re-generate
     * in case user switch to a bigger preview size. Do not create preview when file is offline. */
    ImBuf *imbuf = (preview->attributes & FILE_ATTR_OFFLINE) ?



More information about the Bf-blender-cvs mailing list