[Bf-blender-cvs] [a22a8cdeeba] property-search-ui-v2: Merge branch 'master' into property-search-ui-v2

Hans Goudey noreply at git.blender.org
Thu Aug 20 17:56:16 CEST 2020


Commit: a22a8cdeebaadd1f82042de7e5b94e46eb183aa0
Author: Hans Goudey
Date:   Thu Aug 20 10:57:15 2020 -0400
Branches: property-search-ui-v2
https://developer.blender.org/rBa22a8cdeebaadd1f82042de7e5b94e46eb183aa0

Merge branch 'master' into property-search-ui-v2

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



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

diff --cc source/blender/editors/include/ED_screen.h
index e1be593f2cc,dd7ca5c65a4..0e66bf500a2
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@@ -80,15 -80,8 +80,11 @@@ void ED_region_tag_redraw_no_rebuild(st
  void ED_region_tag_refresh_ui(struct ARegion *region);
  void ED_region_tag_redraw_editor_overlays(struct ARegion *region);
  
 +void ED_region_search_filter_update(const struct bContext *C, struct ARegion *region);
 +char *ED_area_search_filter_get(const struct bContext *C);
 +
  void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region);
- void ED_region_panels_ex(const struct bContext *C,
-                          struct ARegion *region,
-                          const char *contexts[],
-                          int contextnr,
-                          const bool vertical);
+ void ED_region_panels_ex(const struct bContext *C, struct ARegion *region, const char *contexts[]);
  void ED_region_panels(const struct bContext *C, struct ARegion *region);
  void ED_region_panels_layout_ex(const struct bContext *C,
                                  struct ARegion *region,
diff --cc source/blender/editors/interface/interface_layout.c
index b6cc39a521f,ad76466b67c..62606fa2b95
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@@ -5771,9 -5458,7 +5742,9 @@@ void UI_block_layout_resolve(uiBlock *b
  
    block->curlayout = NULL;
  
 +  const bool search_disabled = block_search(block);
 +
-   for (root = block->layouts.first; root; root = root->next) {
+   LISTBASE_FOREACH (uiLayoutRoot *, root, &block->layouts) {
      ui_layout_add_padding_button(root);
  
      /* NULL in advance so we don't interfere when adding button */
diff --cc source/blender/editors/interface/interface_panel.c
index 937fc7c3db6,4982a27316c..174b66f00f3
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@@ -1084,13 -958,11 +1018,12 @@@ void ui_draw_aligned_panel(uiStyle *sty
      float y = headrect.ymax;
  
      immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-     GPU_blend(true);
+     GPU_blend(GPU_BLEND_ALPHA);
  
      /* draw with background color */
 -    immUniformThemeColor(TH_PANEL_HEADER);
 +    immUniformThemeColor(UI_panel_matches_search_filter(panel) ? TH_SEARCH_MATCH :
 +                                                                 TH_PANEL_HEADER);
-     immRectf(pos, minx, headrect.ymin, maxx, y);
+     immRectf(pos, minx, headrect.ymin, rect->xmax, y);
  
      immBegin(GPU_PRIM_LINES, 4);
  
@@@ -1114,9 -986,9 +1047,9 @@@
  #endif
    {
      uchar col_title[4];
 -    panel_title_color_get(show_background, col_title);
 +    panel_title_color_get(panel, show_background, false, region_search_filter_active, col_title);
  
-     GPU_blend(true);
+     GPU_blend(GPU_BLEND_ALPHA);
      UI_icon_draw_ex(headrect.xmax - ((PNL_ICON * 2.2f) / block->aspect),
                      headrect.ymin + (5.0f / block->aspect),
                      (panel->flag & PNL_PIN) ? ICON_PINNED : ICON_UNPINNED,
@@@ -1133,33 -1005,30 +1066,31 @@@
    if (is_subpanel) {
      titlerect.xmin += (0.7f * UI_UNIT_X) / block->aspect + 0.001f;
    }
-   if (is_closed_x == false) {
-     ui_draw_aligned_panel_header(
-         style, block, &titlerect, 'h', show_background, region_search_filter_active);
 -  ui_draw_aligned_panel_header(style, block, &titlerect, 'h', show_background);
++  ui_draw_aligned_panel_header(
++      style, block, &titlerect, 'h', show_background, region_search_filter_active);
  
-     if (show_drag) {
-       /* itemrect smaller */
-       const float scale = 0.7;
-       itemrect.xmax = headrect.xmax - (0.2f * UI_UNIT_X);
-       itemrect.xmin = itemrect.xmax - BLI_rcti_size_y(&headrect);
-       itemrect.ymin = headrect.ymin;
-       itemrect.ymax = headrect.ymax;
-       BLI_rctf_scale(&itemrect, scale);
+   if (show_drag) {
+     /* itemrect smaller */
+     const float scale = 0.7;
+     itemrect.xmax = headrect.xmax - (0.2f * UI_UNIT_X);
+     itemrect.xmin = itemrect.xmax - BLI_rcti_size_y(&headrect);
+     itemrect.ymin = headrect.ymin;
+     itemrect.ymax = headrect.ymax;
+     BLI_rctf_scale(&itemrect, scale);
  
-       GPU_matrix_push();
-       GPU_matrix_translate_2f(itemrect.xmin, itemrect.ymin);
+     GPU_matrix_push();
+     GPU_matrix_translate_2f(itemrect.xmin, itemrect.ymin);
  
-       const int col_tint = 84;
-       float col_high[4], col_dark[4];
-       UI_GetThemeColorShade4fv(TH_PANEL_HEADER, col_tint, col_high);
-       UI_GetThemeColorShade4fv(TH_PANEL_BACK, -col_tint, col_dark);
+     const int col_tint = 84;
+     float col_high[4], col_dark[4];
+     UI_GetThemeColorShade4fv(TH_PANEL_HEADER, col_tint, col_high);
+     UI_GetThemeColorShade4fv(TH_PANEL_BACK, -col_tint, col_dark);
  
-       GPUBatch *batch = GPU_batch_preset_panel_drag_widget(
-           U.pixelsize, col_high, col_dark, BLI_rcti_size_y(&headrect) * scale);
-       GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_FLAT_COLOR);
-       GPU_batch_draw(batch);
-       GPU_matrix_pop();
-     }
+     GPUBatch *batch = GPU_batch_preset_panel_drag_widget(
+         U.pixelsize, col_high, col_dark, BLI_rcti_size_y(&headrect) * scale);
+     GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_FLAT_COLOR);
+     GPU_batch_draw(batch);
+     GPU_matrix_pop();
    }
  
    /* Draw panel backdrop. */
@@@ -1197,10 -1056,10 +1118,10 @@@
      }
  
      immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-     GPU_blend(true);
+     GPU_blend(GPU_BLEND_ALPHA);
  
--    /* Draw panel backdrop if it wasn't already been drawn by the single opaque round box earlier.
--     * Note: Sub-panels blend with panels, so they can't be opaque. */
++    /* Draw panel backdrop if it wasn't already been drawn by the single opaque round box
++     * earlier. Note: Sub-panels blend with panels, so they can't be opaque. */
      if (show_background && !(draw_box_style && !is_subpanel)) {
        /* Draw the bottom sub-panels. */
        if (draw_box_style) {
@@@ -1605,8 -1389,8 +1451,8 @@@ static void ui_do_animate(bContext *C, 
  
      panel_activate_state(C, panel, PANEL_STATE_EXIT);
      if (is_drag_drop) {
--      /* Note: doing this in #panel_activate_state would require removing const for context in many
--       * other places. */
++      /* Note: doing this in #panel_activate_state would require removing const for context in
++       * many other places. */
        reorder_instanced_panel_list(C, region, panel);
      }
      return;
@@@ -1868,8 -1623,8 +1687,9 @@@ static void ui_panel_drag_collapse(bCon
  
  /**
   * Panel drag-collapse (modal handler)
-- * Clicking and dragging over panels toggles their collapse state based on the panel that was first
-- * dragged over. If it was open all affected panels incl the initial one are closed and vice versa.
++ * Clicking and dragging over panels toggles their collapse state based on the panel that was
++ * first dragged over. If it was open all affected panels incl the initial one are closed and
++ * vice versa.
   */
  static int ui_panel_drag_collapse_handler(bContext *C, const wmEvent *event, void *userdata)
  {
diff --cc source/blender/editors/screen/area.c
index 06c7e290795,27a641dc6d8..10a44b58dc9
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@@ -2602,9 -2575,7 +2595,8 @@@ static void ed_panel_draw(const bContex
                            Panel *panel,
                            int w,
                            int em,
-                           bool vertical,
 -                          char *unique_panel_str)
 +                          char *unique_panel_str,
 +                          bool search_only)
  {
    const uiStyle *style = UI_style_get_dpi();
  
@@@ -2617,10 -2588,9 +2609,10 @@@
      strncat(block_name, unique_panel_str, LIST_PANEL_UNIQUE_STR_LEN);
    }
    uiBlock *block = UI_block_begin(C, region, block_name, UI_EMBOSS);
 +  UI_block_set_search_only(block, search_only);
  
    bool open;
-   panel = UI_panel_begin(area, region, lb, block, pt, panel, &open);
+   panel = UI_panel_begin(region, lb, block, pt, panel, &open);
  
    /* bad fixed values */
    int xco, yco, h = 0;
@@@ -2725,17 -2692,7 +2717,8 @@@
        Panel *child_panel = UI_panel_find_by_type(&panel->children, child_pt);
  
        if (child_pt->draw && (!child_pt->poll || child_pt->poll(C, child_pt))) {
-         ed_panel_draw(C,
-                       area,
-                       region,
-                       &panel->children,
-                       child_pt,
-                       child_panel,
-                       w,
-                       em,
-                       vertical,
-                       unique_panel_str,
-                       !open);
 -        ed_panel_draw(C, region, &panel->children, child_pt, child_panel, w, em, unique_panel_str);
++        ed_panel_draw(
++            C, region, &panel->children, child_pt, child_panel, w, em, unique_panel_str, !open);
        }
      }
    }
@@@ -2894,9 -2830,7 +2856,8 @@@ void ED_region_panels_layout_ex(const b
                    panel,
                    (pt->flag & PNL_DRAW_BOX) ? w_box_panel : w,
                    em,
-                   vertical,
 -                  NULL);
 +                  NULL,
 +                  false);
    }
  
    /* Draw "polyinstantaited" panels that don't have a 1 to 1 correspondence with their types. */
@@@ -2930,9 -2863,7 +2890,8 @@@
                      panel,
                      (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w,
                      em,
-                     vertical,
 -                    unique_panel_str);
 +                    unique_panel_str,
 +                    false);
      }
    }
  
diff --cc source/blender/editors/space_buttons/space_buttons.c
index 3f7e4030f73,d7cf2e4d544..6bfcea0818e
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@@ -295,82 -292,9 +295,80 @@@ static void buttons_main_region_layout_
        break;
    }
  
-   const bool vertical = true;
-   ED_region_panels_layout_ex

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list