[Bf-blender-cvs] [8b08f487b2b] filebrowser_redesign: General minor cleanup

Julian Eisel noreply at git.blender.org
Tue Aug 27 12:50:15 CEST 2019


Commit: 8b08f487b2b8545fcdaa0eb9fbd92ff1d4bfb14f
Author: Julian Eisel
Date:   Tue Aug 27 12:48:39 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rB8b08f487b2b8545fcdaa0eb9fbd92ff1d4bfb14f

General minor cleanup

* Remove dead code
* Correct comment position
* Use enum and bitshifting for PanelType.flag
* Remove final point from UI message

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

M	source/blender/editors/space_file/file_intern.h
M	source/blender/editors/space_file/space_file.c
M	source/blender/makesdna/DNA_screen_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_ui.c

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

diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 2bce61c9144..688f5494534 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -48,10 +48,6 @@ struct ARegion *file_tool_props_region(struct ScrArea *sa);
 
 #define SMALL_SIZE_CHECK(_size) ((_size) < 64) /* Related to FileSelectParams.thumbnail_size. */
 
-#if 0
-void file_draw_filepath_buttons(const bContext *C, ARegion *ar);
-void file_draw_execute_buttons(const bContext *C, ARegion *ar);
-#endif
 void file_calc_previews(const bContext *C, ARegion *ar);
 void file_draw_list(const bContext *C, ARegion *ar);
 
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index bf885d3945b..a3203d1b8fe 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -586,34 +586,6 @@ static void file_ui_region_init(wmWindowManager *wm, ARegion *ar)
   WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap);
 }
 
-#if 0
-static void file_ui_region_draw_ex(const bContext *C, ARegion *ar, bool is_execution_buts)
-{
-  float col[3];
-  /* clear */
-  UI_GetThemeColor3fv(TH_BACK, col);
-  GPU_clear_color(col[0], col[1], col[2], 0.0);
-  GPU_clear(GPU_COLOR_BIT);
-
-  /* scrolling here is just annoying, disable it */
-  ar->v2d.cur.ymax = BLI_rctf_size_y(&ar->v2d.cur);
-  ar->v2d.cur.ymin = 0;
-
-  /* set view2d view matrix for scrolling (without scrollers) */
-  UI_view2d_view_ortho(&ar->v2d);
-
-
-  if (is_execution_buts) {
-    file_draw_execute_buttons(C, ar);
-  }
-  else {
-    file_draw_filepath_buttons(C, ar);
-  }
-
-  UI_view2d_view_restore(C);
-}
-#endif
-
 static void file_ui_region_draw(const bContext *C, ARegion *ar)
 {
   ED_region_panels(C, ar);
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index fd421cd8304..9c9437f8958 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -526,11 +526,13 @@ enum {
 
 /* #define PNL_SNAP_DIST        9.0 */
 
-/* paneltype flag */
-#define PNL_DEFAULT_CLOSED 1
-#define PNL_NO_HEADER 2
-#define PNL_LAYOUT_VERT_BAR 4
-#define PNL_HIDDEN 8
+/* PanelType.flag */
+enum {
+  PNL_DEFAULT_CLOSED = (1 << 0),
+  PNL_NO_HEADER = (1 << 1),
+  PNL_LAYOUT_VERT_BAR = (1 << 2),
+  PNL_HIDDEN = (1 << 3),
+};
 
 /* Fallback panel category (only for old scripts which need updating) */
 #define PNL_CATEGORY_FALLBACK "Misc"
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index ee896b280d2..1c2f4665edd 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -679,8 +679,8 @@ typedef struct FileSelectParams {
   short display_previous;
   /** Details toggles (file size, creation date, etc.) */
   char details_flags;
-  /** Filter when (flags & FILE_FILTER) is true. */
   char _pad2;
+  /** Filter when (flags & FILE_FILTER) is true. */
   int filter;
 
   /** Max number of levels in dirtree to show at once, 0 to disable recursion. */
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 5b50d0ced33..a835974f2c9 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -1295,7 +1295,7 @@ static void rna_def_panel(BlenderRNA *brna)
        0,
        "Hidden",
        "Do not show this panel, only register it for display at a non-default position (e.g. in a "
-       "popup)."},
+       "popup)"},
       {0, NULL, 0, NULL, NULL},
   };



More information about the Bf-blender-cvs mailing list