[Bf-blender-cvs] [e686fb095b5] temp-vse-grid-lines: Display only major ticks, update theme, so appearence is identical to previous version

Richard Antalik noreply at git.blender.org
Wed Jul 14 20:29:36 CEST 2021


Commit: e686fb095b521a38df94875f71cadc5aa4f26c2b
Author: Richard Antalik
Date:   Wed Jul 14 16:32:30 2021 +0200
Branches: temp-vse-grid-lines
https://developer.blender.org/rBe686fb095b521a38df94875f71cadc5aa4f26c2b

Display only major ticks, update theme, so appearence is identical to previous version

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

M	release/datafiles/userdef/userdef_default_theme.c
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/include/UI_view2d.h
M	source/blender/editors/interface/view2d_draw.c
M	source/blender/editors/space_action/space_action.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_nla/space_nla.c
M	source/blender/editors/space_sequencer/sequencer_draw.c

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

diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 441a92127ea..cd79ee05f67 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -638,7 +638,7 @@ const bTheme U_theme_default = {
       .sub_back = RGBA(0x0000003e),
     },
     .shade1 = RGBA(0xa0a0a000),
-    .grid = RGBA(0x404040ff),
+    .grid = RGBA(0x363636ff),
     .vertex_select = RGBA(0xff8500ff),
     .bone_pose = RGBA(0x50c8ff50),
     .cframe = RGBA(0x5680c2ff),
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 42b27f57e2c..743d12d9456 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -297,6 +297,8 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
    */
   {
     /* Keep this block, even when empty. */
+    copy_v4_uchar(btheme->space_sequencer.grid, 54);
+    btheme->space_sequencer.grid[3] = 255;
   }
 
 #undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index 7726fc4eca8..4ee7df89487 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -148,11 +148,14 @@ void UI_view2d_multi_grid_draw(
 
 void UI_view2d_draw_lines_y__values(const struct View2D *v2d);
 void UI_view2d_draw_lines_x__values(const struct View2D *v2d);
-void UI_view2d_draw_lines_x__discrete_values(const struct View2D *v2d);
-void UI_view2d_draw_lines_x__discrete_time(const struct View2D *v2d, const struct Scene *scene);
+void UI_view2d_draw_lines_x__discrete_values(const struct View2D *v2d, bool display_minor_lines);
+void UI_view2d_draw_lines_x__discrete_time(const struct View2D *v2d,
+                                           const struct Scene *scene,
+                                           bool display_minor_lines);
 void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const struct View2D *v2d,
                                                         const struct Scene *scene,
-                                                        bool display_seconds);
+                                                        bool display_seconds,
+                                                        bool display_minor_lines);
 void UI_view2d_draw_lines_x__frames_or_seconds(const struct View2D *v2d,
                                                const struct Scene *scene,
                                                bool display_seconds);
diff --git a/source/blender/editors/interface/view2d_draw.c b/source/blender/editors/interface/view2d_draw.c
index f7ef8c06389..51294fe246f 100644
--- a/source/blender/editors/interface/view2d_draw.c
+++ b/source/blender/editors/interface/view2d_draw.c
@@ -460,10 +460,11 @@ float UI_view2d_grid_resolution_y__values(const struct View2D *v2d)
 /* Line Drawing API
  **************************************************/
 
-void UI_view2d_draw_lines_x__discrete_values(const View2D *v2d)
+void UI_view2d_draw_lines_x__discrete_values(const View2D *v2d, bool display_minor_lines)
 {
   const uint major_line_distance = view2d_major_step_x__discrete(v2d);
-  view2d_draw_lines(v2d, major_line_distance, major_line_distance > 1, 'v');
+  view2d_draw_lines(
+      v2d, major_line_distance, display_minor_lines && (major_line_distance > 1), 'v');
 }
 
 void UI_view2d_draw_lines_x__values(const View2D *v2d)
@@ -478,21 +479,25 @@ void UI_view2d_draw_lines_y__values(const View2D *v2d)
   view2d_draw_lines(v2d, major_line_distance, true, 'h');
 }
 
-void UI_view2d_draw_lines_x__discrete_time(const View2D *v2d, const Scene *scene)
+void UI_view2d_draw_lines_x__discrete_time(const View2D *v2d,
+                                           const Scene *scene,
+                                           bool display_minor_lines)
 {
   const float major_line_distance = view2d_major_step_x__time(v2d, scene);
-  view2d_draw_lines(v2d, major_line_distance, major_line_distance > 1, 'v');
+  view2d_draw_lines(
+      v2d, major_line_distance, display_minor_lines && (major_line_distance > 1), 'v');
 }
 
 void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const View2D *v2d,
                                                         const Scene *scene,
-                                                        bool display_seconds)
+                                                        bool display_seconds,
+                                                        bool display_minor_lines)
 {
   if (display_seconds) {
-    UI_view2d_draw_lines_x__discrete_time(v2d, scene);
+    UI_view2d_draw_lines_x__discrete_time(v2d, scene, display_minor_lines);
   }
   else {
-    UI_view2d_draw_lines_x__discrete_values(v2d);
+    UI_view2d_draw_lines_x__discrete_values(v2d, display_minor_lines);
   }
 }
 
@@ -501,7 +506,7 @@ void UI_view2d_draw_lines_x__frames_or_seconds(const View2D *v2d,
                                                bool display_seconds)
 {
   if (display_seconds) {
-    UI_view2d_draw_lines_x__discrete_time(v2d, scene);
+    UI_view2d_draw_lines_x__discrete_time(v2d, scene, true);
   }
   else {
     UI_view2d_draw_lines_x__values(v2d);
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 28482faf6e3..5e5143723a6 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -196,7 +196,8 @@ static void action_main_region_draw(const bContext *C, ARegion *region)
   UI_view2d_view_ortho(v2d);
 
   /* time grid */
-  UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, saction->flag & SACTION_DRAWTIME);
+  UI_view2d_draw_lines_x__discrete_frames_or_seconds(
+      v2d, scene, saction->flag & SACTION_DRAWTIME, true);
 
   ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW);
 
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 326c221a2e3..aef3385f2dc 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1112,7 +1112,7 @@ static void dopesheet_region_draw(const bContext *C, ARegion *region)
   UI_view2d_view_ortho(v2d);
 
   /* time grid */
-  UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, sc->flag & SC_SHOW_SECONDS);
+  UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, sc->flag & SC_SHOW_SECONDS, true);
 
   /* data... */
   clip_draw_dopesheet_main(sc, region, scene);
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 011cd7e2651..987d06cfe5c 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -239,7 +239,7 @@ static void nla_main_region_draw(const bContext *C, ARegion *region)
   UI_view2d_view_ortho(v2d);
 
   /* time grid */
-  UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, snla->flag & SNLA_DRAWTIME);
+  UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, snla->flag & SNLA_DRAWTIME, true);
 
   ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW);
 
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 6a4b115a9bc..a2f79f7087d 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1978,7 +1978,7 @@ static void draw_seq_backdrop(View2D *v2d)
   /* Lines separating the horizontal bands. */
   i = max_ii(1, ((int)v2d->cur.ymin) - 1);
   int line_len = (int)v2d->cur.ymax - i + 1;
-  immUniformThemeColor(TH_GRID);
+  immUniformThemeColorShade(TH_GRID, 10);
   immBegin(GPU_PRIM_LINES, line_len * 2);
   while (line_len--) {
     immVertex2f(pos, v2d->cur.xmax, i);
@@ -2418,7 +2418,7 @@ void draw_timeline_seq(const bContext *C, ARegion *region)
   draw_seq_backdrop(v2d);
   if ((sseq->flag & SEQ_SHOW_STRIP_OVERLAY) && (sseq->flag & SEQ_SHOW_GRID)) {
     UI_view2d_draw_lines_x__discrete_frames_or_seconds(
-        v2d, scene, (sseq->flag & SEQ_DRAWFRAMES) == 0);
+        v2d, scene, (sseq->flag & SEQ_DRAWFRAMES) == 0, false);
   }
 
   /* Only draw backdrop in timeline view. */



More information about the Bf-blender-cvs mailing list