[Bf-blender-cvs] [83b342fd914] temp-ui-tweaks: UI: Less prominent drag widget on panels

Pablo Vazquez noreply at git.blender.org
Fri Sep 3 20:06:53 CEST 2021


Commit: 83b342fd9142be875f82bfdd85d249fa84e51dff
Author: Pablo Vazquez
Date:   Fri Sep 3 20:02:50 2021 +0200
Branches: temp-ui-tweaks
https://developer.blender.org/rB83b342fd9142be875f82bfdd85d249fa84e51dff

UI: Less prominent drag widget on panels

* Use 2 rows of 3 boxes per row, instead of 4.
* Slightly smaller
* Dimmer

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

M	source/blender/editors/interface/interface_panel.c
M	source/blender/gpu/intern/gpu_batch_presets.c

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

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index ac97cb4cc74..33f9581156c 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1233,10 +1233,10 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
     GPU_matrix_translate_2f(widget_rect.xmax - scaled_unit * 1.15,
                             widget_rect.ymin + (header_height - drag_widget_size) * 0.33f);
 
-    const int col_tint = 84;
+    const int col_tint = 40;
     float color_high[4], color_dark[4];
     UI_GetThemeColorShade4fv(TH_PANEL_HEADER, col_tint, color_high);
-    UI_GetThemeColorShade4fv(TH_PANEL_BACK, -col_tint, color_dark);
+    UI_GetThemeColorShade4fv(TH_PANEL_HEADER, (-col_tint / 2), color_dark);
 
     GPUBatch *batch = GPU_batch_preset_panel_drag_widget(
         U.pixelsize, color_high, color_dark, drag_widget_size);
diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c
index 6a1645a71d8..d810734b193 100644
--- a/source/blender/gpu/intern/gpu_batch_presets.c
+++ b/source/blender/gpu/intern/gpu_batch_presets.c
@@ -266,7 +266,7 @@ static GPUBatch *gpu_batch_preset_panel_drag_widget(float pixelsize,
                                                     const float width)
 {
   GPUVertBuf *vbo = GPU_vertbuf_create_with_format(preset_2d_format());
-  const uint vbo_len = 4 * 2 * (6 * 2);
+  const uint vbo_len = 3 * 2 * (6 * 2);
   GPU_vertbuf_data_alloc(vbo, vbo_len);
 
   GPUVertBufRaw pos_step, col_step;
@@ -274,16 +274,16 @@ static GPUBatch *gpu_batch_preset_panel_drag_widget(float pixelsize,
   GPU_vertbuf_attr_get_raw_data(vbo, g_presets_2d.attr_id.col, &col_step);
 
   const int px = (int)pixelsize;
-  const int px_zoom = max_ii(round_fl_to_int(width / 22.0f), 1);
+  const int px_zoom = max_ii(round_fl_to_int(width / 24.0f), 1);
 
   const int box_margin = max_ii(round_fl_to_int((float)(px_zoom * 2.0f)), px);
-  const int box_size = max_ii(round_fl_to_int((width / 8.0f) - px), px);
+  const int box_size = max_ii(round_fl_to_int((width / 6.0f) - px), px);
 
-  const int y_ofs = max_ii(round_fl_to_int(width / 2.5f), px);
+  const int y_ofs = max_ii(round_fl_to_int(width / 3.0f), px);
   const int x_ofs = y_ofs;
   int i_x, i_y;
 
-  for (i_x = 0; i_x < 4; i_x++) {
+  for (i_x = 0; i_x < 3; i_x++) {
     for (i_y = 0; i_y < 2; i_y++) {
       const int x_co = (x_ofs) + (i_x * (box_size + box_margin));
       const int y_co = (y_ofs) + (i_y * (box_size + box_margin));



More information about the Bf-blender-cvs mailing list