diff options
-rw-r--r-- | release/datafiles/userdef/userdef_default_theme.c | 185 | ||||
-rw-r--r-- | release/scripts/presets/interface_theme/Blender_Light.xml | 29 | ||||
-rw-r--r-- | source/blender/editors/animation/time_scrub_ui.c | 1 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 24 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 87 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 71 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 27 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_batch_presets.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_defaults.h | 18 |
13 files changed, 284 insertions, 184 deletions
diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index 6753dc8563e..dba541c85b9 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -62,11 +62,11 @@ const bTheme U_theme_default = { .roundness = 0.2f, }, .wcol_radio = { - .outline = RGBA(0x373737ff), - .inner = RGBA(0x595959ff), - .inner_sel = RGBA(0x5680c2e6), - .item = RGBA(0xffffffff), - .text = RGBA(0xe6e6e6ff), + .outline = RGBA(0x2c2c2cff), + .inner = RGBA(0x2c2c2cff), + .inner_sel = RGBA(0x476da3ff), + .item = RGBA(0x2c2c2cff), + .text = RGBA(0xccccccff), .text_sel = RGBA(0xffffffff), .shadetop = 5, .shadedown = -5, @@ -74,9 +74,9 @@ const bTheme U_theme_default = { }, .wcol_option = { .outline = RGBA(0x373737ff), - .inner = RGBA(0x666666ff), - .inner_sel = RGBA(0x5680c2e6), - .item = RGBA(0xffffffff), + .inner = RGBA(0x1f1f1fff), + .inner_sel = RGBA(0x71a8ffe6), + .item = RGBA(0x1f1f1fff), .text = RGBA(0xe6e6e6ff), .text_sel = RGBA(0xffffffff), .shadedown = -15, @@ -84,8 +84,8 @@ const bTheme U_theme_default = { }, .wcol_toggle = { .outline = RGBA(0x373737ff), - .inner = RGBA(0x595959ff), - .inner_sel = RGBA(0x5680c2e6), + .inner = RGBA(0x2c2c2cff), + .inner_sel = RGBA(0x476da3ff), .item = RGBA(0x191919ff), .text = RGBA(0xe6e6e6ff), .text_sel = RGBA(0xffffffff), @@ -93,8 +93,8 @@ const bTheme U_theme_default = { }, .wcol_num = { .outline = RGBA(0x444444ff), - .inner = RGBA(0x595959ff), - .inner_sel = RGBA(0x505050ff), + .inner = RGBA(0x4f4f4fff), + .inner_sel = RGBA(0x1f1f1fff), .item = RGBA(0x191919ff), .text = RGBA(0xe6e6e6ff), .text_sel = RGBA(0xffffffff), @@ -102,9 +102,9 @@ const bTheme U_theme_default = { }, .wcol_numslider = { .outline = RGBA(0x444444ff), - .inner = RGBA(0x595959ff), + .inner = RGBA(0x2c2c2cff), .inner_sel = RGBA(0x505050ff), - .item = RGBA(0x5680c2e6), + .item = RGBA(0x5680c2ff), .text = RGBA(0xe6e6e6ff), .text_sel = RGBA(0xffffffff), .shaded = 1, @@ -112,9 +112,9 @@ const bTheme U_theme_default = { .roundness = 0.2f, }, .wcol_tab = { - .outline = RGBA(0x202020ff), - .inner = RGBA(0x2b2b2bff), - .inner_sel = RGBA(0x424242ff), + .outline = RGBA(0x1a1a1aff), + .inner = RGBA(0x1a1a1aff), + .inner_sel = RGBA(0x2e2e2eff), .item = RGBA(0x2d2d2dff), .text = RGBA(0x989898ff), .text_sel = RGBA(0xffffffff), @@ -123,7 +123,7 @@ const bTheme U_theme_default = { .wcol_menu = { .outline = RGBA(0x444444ff), .inner = RGBA(0x2c2c2cff), - .inner_sel = RGBA(0x696e76ff), + .inner_sel = RGBA(0x476da3ff), .item = RGBA(0xd9d9d9ff), .text = RGBA(0xd9d9d9ff), .text_sel = RGBA(0xffffffff), @@ -133,8 +133,8 @@ const bTheme U_theme_default = { }, .wcol_pulldown = { .outline = RGBA(0x4d4d4dff), - .inner = RGBA(0x2e2e2ecc), - .inner_sel = RGBA(0x5680c2e6), + .inner = RGBA(0x00000033), + .inner_sel = RGBA(0x476da3ff), .item = RGBA(0x727272ff), .text = RGBA(0xd9d9d9ff), .text_sel = RGBA(0xffffffff), @@ -144,7 +144,7 @@ const bTheme U_theme_default = { }, .wcol_menu_back = { .outline = RGBA(0x19191aff), - .inner = RGBA(0x1f1f1fef), + .inner = RGBA(0x1a1a1aff), .inner_sel = RGBA(0x585858ff), .item = RGBA(0x727272ff), .text = RGBA(0xa5a5a5ff), @@ -154,7 +154,8 @@ const bTheme U_theme_default = { .roundness = 0.2f, }, .wcol_menu_item = { - .inner_sel = RGBA(0x5680c2e6), + .outline = RGBA(0x37373700), + .inner_sel = RGBA(0x476da3ff), .item = RGBA(0xffffff8f), .text = RGBA(0xe6e6e6ff), .text_sel = RGBA(0xffffffff), @@ -173,7 +174,7 @@ const bTheme U_theme_default = { .roundness = 0.2f, }, .wcol_box = { - .outline = RGBA(0x444444ff), + .outline = RGBA(0x262626ff), .inner = RGBA(0x00000033), .inner_sel = RGBA(0x696e76ff), .item = RGBA(0x191919ff), @@ -237,7 +238,7 @@ const bTheme U_theme_default = { .widget_emboss = RGBA(0x00000026), .menu_shadow_fac = 0.3f, .menu_shadow_width = 4, - .editor_outline = RGBA(0x1f1f1fff), + .editor_outline = RGBA(0x1a1a1aff), .transparent_checker_primary = RGBA(0x333333ff), .transparent_checker_secondary = RGBA(0x262626ff), .transparent_checker_size = 8, @@ -262,11 +263,11 @@ const bTheme U_theme_default = { .icon_folder = RGBA(0xe3c16eff), }, .space_properties = { - .back = RGBA(0x42424200), + .back = RGBA(0x2e2e2e00), .title = RGBA(0xd4d4d4ff), .text = RGBA(0xe6e6e6ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x424242ff), + .header = RGBA(0x2e2e2eff), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), @@ -277,24 +278,24 @@ const bTheme U_theme_default = { .button_title = RGBA(0xffffffff), .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), - .navigation_bar = RGBA(0x232323ff), + .navigation_bar = RGBA(0x1a1a1aff), .panelcolors = { - .header = RGBA(0x424242ff), + .header = RGBA(0x383838ff), .back = RGBA(0x383838ff), - .sub_back = RGBA(0x00000024), + .sub_back = RGBA(0x0000003e), }, + .active = RGBA(0x5680c2ff), .vertex_size = 3, .outline_width = 1, .facedot_size = 4, .match = RGBA(0x5680c2ff), - .active = RGBA(0x5680c2ff), }, .space_view3d = { - .back = RGBA(0x393939ff), + .back = RGBA(0x2c2c2cff), .title = RGBA(0xeeeeeeff), .text = RGBA(0xe6e6e6ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x42424200), + .header = RGBA(0x2e2e2e00), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), @@ -306,8 +307,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242e6), - .back = RGBA(0x333333f0), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .grid = RGBA(0x6666664d), @@ -398,8 +399,8 @@ const bTheme U_theme_default = { .button_text_hi = RGBA(0xffffffff), .execution_buts = RGBA(0x444444ff), .panelcolors = { - .header = RGBA(0x4b4b4bff), - .back = RGBA(0x404040ff), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .hilite = RGBA(0x4f76b3ff), @@ -429,8 +430,8 @@ const bTheme U_theme_default = { .list_text = RGBA(0xb8b8b8ff), .list_text_hi = RGBA(0xffaf29ff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .shade1 = RGBA(0x96969600), @@ -480,8 +481,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .vertex_size = 3, @@ -523,8 +524,8 @@ const bTheme U_theme_default = { .list_text = RGBA(0xb8b8b8ff), .list_text_hi = RGBA(0xffaf29ff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .shade1 = RGBA(0xc0c0c000), @@ -583,8 +584,8 @@ const bTheme U_theme_default = { .list_text = RGBA(0xb8b8b8ff), .list_text_hi = RGBA(0xffaf29ff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .shade1 = RGBA(0x96969600), @@ -633,8 +634,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .shade1 = RGBA(0xa0a0a000), @@ -663,16 +664,16 @@ const bTheme U_theme_default = { .selected_strip = RGBA(0xff8f0dff), .gp_vertex_size = 3, .gp_vertex_select = RGBA(0xff8500ff), + .row_alternate = RGBA(0xffffff0d), .anim_preview_range = RGBA(0xa14d0066), .metadatatext = RGBA(0xffffffff), - .row_alternate = RGBA(0xffffff0d), }, .space_image = { - .back = RGBA(0x44444400), + .back = RGBA(0x2e2e2e00), .title = RGBA(0xeeeeeeff), .text = RGBA(0xe6e6e6ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x424242ff), + .header = RGBA(0x2e2e2eff), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), @@ -684,8 +685,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .grid = RGBA(0x505050ff), @@ -738,8 +739,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x42424200), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .shade2 = RGBA(0x5680c2e6), @@ -759,11 +760,11 @@ const bTheme U_theme_default = { .line_numbers = RGBA(0xd0d0d0ff), }, .space_outliner = { - .back = RGBA(0x28282800), + .back = RGBA(0x25252500), .title = RGBA(0xffffffff), .text = RGBA(0xc3c3c3ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x454545ff), + .header = RGBA(0x282828ff), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), @@ -775,34 +776,34 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, - .active = RGBA(0x3b5689ff), + .active = RGBA(0x4d341fff), .vertex_size = 3, .outline_width = 1, .facedot_size = 4, - .match = RGBA(0x337f334c), - .selected_highlight = RGBA(0x223a5bff), + .match = RGBA(0x1466144c), + .selected_highlight = RGBA(0x4d433eff), .selected_object = RGBA(0xe96a00ff), .active_object = RGBA(0xffaf29ff), .edited_object = RGBA(0x00806266), - .row_alternate = RGBA(0xffffff07), + .row_alternate = RGBA(0xffffff05), }, .space_node = { .back = RGBA(0x23232300), .title = RGBA(0xeeeeeeff), .text = RGBA(0xe6e6e6ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x424242ff), + .header = RGBA(0x2e2e2eff), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), .tab_inactive = RGBA(0x2b2b2bff), .tab_back = RGBA(0x232323ff), .tab_outline = RGBA(0x232323ff), - .button = RGBA(0x42424200), + .button = RGBA(0x232323ff), .button_title = RGBA(0xffffffff), .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), @@ -811,8 +812,8 @@ const bTheme U_theme_default = { .list_text = RGBA(0xccccccff), .list_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .shade2 = RGBA(0x7f707064), @@ -851,11 +852,11 @@ const bTheme U_theme_default = { .gp_vertex_select = RGBA(0xff8500ff), }, .space_preferences = { - .back = RGBA(0x42424200), - .title = RGBA(0xeeeeeeff), + .back = RGBA(0x2e2e2e00), + .title = RGBA(0xd4d4d4ff), .text = RGBA(0xe6e6e6ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x424242ff), + .header = RGBA(0x2e2e2eff), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), @@ -866,11 +867,11 @@ const bTheme U_theme_default = { .button_title = RGBA(0xffffffff), .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), - .navigation_bar = RGBA(0x4b4b4bff), - .execution_buts = RGBA(0x4b4b4bff), + .navigation_bar = RGBA(0x383838ff), + .execution_buts = RGBA(0x383838ff), .panelcolors = { - .header = RGBA(0x42424200), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .vertex_size = 3, @@ -894,8 +895,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .console_output = RGBA(0x71a8ffff), @@ -928,8 +929,8 @@ const bTheme U_theme_default = { .list_text = RGBA(0x000000ff), .list_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .grid = RGBA(0x424242ff), @@ -961,11 +962,11 @@ const bTheme U_theme_default = { .metadatatext = RGBA(0xffffffff), }, .space_topbar = { - .back = RGBA(0x42424200), + .back = RGBA(0x1a1a1a00), .title = RGBA(0xffffffff), .text = RGBA(0xe6e6e6ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x232323ff), + .header = RGBA(0x1a1a1aff), .header_text = RGBA(0xeeeeeeff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), @@ -977,8 +978,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .vertex_size = 3, @@ -987,12 +988,12 @@ const bTheme U_theme_default = { .gp_vertex_size = 3, }, .space_statusbar = { - .back = RGBA(0x2e2e2e00), + .back = RGBA(0x1a1a1a00), .title = RGBA(0xffffffff), .text = RGBA(0x838383ff), .text_hi = RGBA(0xffffffff), - .header = RGBA(0x303030ff), - .header_text = RGBA(0xaaaaaaff), + .header = RGBA(0x1a1a1aff), + .header_text = RGBA(0x696969ff), .header_text_hi = RGBA(0xffffffff), .tab_active = RGBA(0x4b4b4bff), .tab_inactive = RGBA(0x2b2b2bff), @@ -1001,8 +1002,8 @@ const bTheme U_theme_default = { .button = RGBA(0x353535ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, .vertex_size = 3, @@ -1026,11 +1027,16 @@ const bTheme U_theme_default = { .button_title = RGBA(0xffffffff), .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), + .list = RGBA(0x424242ff), + .list_title = RGBA(0xc3c3c3ff), + .list_text = RGBA(0xc3c3c3ff), + .list_text_hi = RGBA(0x00ffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x383838ff), + .back = RGBA(0x383838ff), .sub_back = RGBA(0x0000003e), }, + .hilite = RGBA(0x80808080), .active = RGBA(0x3b5689ff), .vertex_size = 3, .outline_width = 1, @@ -1041,11 +1047,6 @@ const bTheme U_theme_default = { .active_object = RGBA(0xffaf29ff), .edited_object = RGBA(0x00806266), .row_alternate = RGBA(0xffffff07), - .list = RGBA(0x424242ff), - .list_title = RGBA(0xc3c3c3ff), - .list_text = RGBA(0xc3c3c3ff), - .list_text_hi = RGBA(0xffffff), - .hilite = RGBA(0x80808080), }, .tarm = { { diff --git a/release/scripts/presets/interface_theme/Blender_Light.xml b/release/scripts/presets/interface_theme/Blender_Light.xml index 132295316eb..0104f8d667e 100644 --- a/release/scripts/presets/interface_theme/Blender_Light.xml +++ b/release/scripts/presets/interface_theme/Blender_Light.xml @@ -77,10 +77,10 @@ </wcol_toolbar_item> <wcol_radio> <ThemeWidgetColors - outline="#434343" + outline="#3b3b3b" inner="#3b3b3bff" inner_sel="#5680c2e6" - item="#ffffffff" + item="#3b3b3bff" text="#d9d9d9" text_sel="#ffffff" show_shaded="FALSE" @@ -257,7 +257,7 @@ </wcol_tooltip> <wcol_menu_item> <ThemeWidgetColors - outline="#000000" + outline="#a6a6a6" inner="#00000000" inner_sel="#5680c2e6" item="#ffffff8f" @@ -879,7 +879,7 @@ > <panelcolors> <ThemePanelColors - header="#b3b3b300" + header="#a3a3a3cc" back="#a3a3a3cc" sub_back="#00000024" > @@ -1054,17 +1054,17 @@ <ThemeInfo info_selected="#6080ff" info_selected_text="#000000" - info_error="#FF0038ff" + info_error="#ff0038ff" info_error_text="#000000" - info_warning="#FFE900ff" + info_warning="#ffe900ff" info_warning_text="#000000" - info_info="#0068B3ff" + info_info="#0068b3ff" info_info_text="#000000" - info_debug="#B30095ff" + info_debug="#b30095ff" info_debug_text="#000000" - info_property="#44B300ff" + info_property="#44b300ff" info_property_text="#000000" - info_operator="#44B300ff" + info_operator="#44b300ff" info_operator_text="#000000" > <space> @@ -1350,6 +1350,15 @@ </panelcolors> </ThemeSpaceGeneric> </space> + <space_list> + <ThemeSpaceListGeneric + list="#424242" + list_title="#c3c3c3" + list_text="#c3c3c3" + list_text_hi="#00ffff" + > + </ThemeSpaceListGeneric> + </space_list> </ThemeSpreadsheet> </spreadsheet> <bone_color_sets> diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c index b0eb014c5d9..71502d2c9fa 100644 --- a/source/blender/editors/animation/time_scrub_ui.c +++ b/source/blender/editors/animation/time_scrub_ui.c @@ -101,6 +101,7 @@ static void draw_current_frame(const Scene *scene, float text_width = UI_fontstyle_string_width(fstyle, frame_str); float box_width = MAX2(text_width + 8 * UI_DPI_FAC, 24 * UI_DPI_FAC); float box_padding = 3 * UI_DPI_FAC; + float outline = 1 * UI_DPI_FAC; float bg_color[4]; UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index f642895f64e..2d5380031e8 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -241,7 +241,7 @@ enum { #define UI_DEFAULT_TEXT_POINTS 11 /* Larger size used for title text. */ -#define UI_DEFAULT_TITLE_POINTS 12 +#define UI_DEFAULT_TITLE_POINTS 11 #define UI_PANEL_WIDTH 340 #define UI_COMPACT_PANEL_WIDTH 160 @@ -252,6 +252,7 @@ enum { #define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f) #define UI_PANEL_BOX_STYLE_MARGIN (U.widget_unit * 0.2f) +#define UI_PANEL_LABEL_OFFSET (U.widget_unit * 2.0f) /* but->drawflag - these flags should only affect how the button is drawn. */ /* NOTE: currently, these flags *are not passed* to the widget's state() or draw() functions diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 39ad88c3368..ce31e99cd08 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2015,7 +2015,7 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *region, uiBlock *bloc /* uses local copy of style, to scale things down, and allow widgets to change stuff */ void UI_block_draw(const bContext *C, uiBlock *block) { - uiStyle style = *UI_style_get_dpi(); /* XXX pass on as arg */ + const uiStyle *style = UI_style_get_dpi(); /* XXX pass on as arg */ /* get menu region or area region */ ARegion *region = CTX_wm_menu(C); @@ -2031,10 +2031,10 @@ void UI_block_draw(const bContext *C, uiBlock *block) GPU_blend(GPU_BLEND_ALPHA); /* scale fonts */ - ui_fontscale(&style.paneltitle.points, block->aspect); - ui_fontscale(&style.grouplabel.points, block->aspect); - ui_fontscale(&style.widgetlabel.points, block->aspect); - ui_fontscale(&style.widget.points, block->aspect); + ui_fontscale(&style->paneltitle.points, block->aspect); + ui_fontscale(&style->grouplabel.points, block->aspect); + ui_fontscale(&style->widgetlabel.points, block->aspect); + ui_fontscale(&style->widget.points, block->aspect); /* scale block min/max to rect */ rcti rect; @@ -2052,10 +2052,10 @@ void UI_block_draw(const bContext *C, uiBlock *block) ui_draw_pie_center(block); } else if (block->flag & UI_BLOCK_POPOVER) { - ui_draw_popover_back(region, &style, block, &rect); + ui_draw_popover_back(region, style, block, &rect); } else if (block->flag & UI_BLOCK_LOOP) { - ui_draw_menu_back(&style, block, &rect); + ui_draw_menu_back(style, block, &rect); } else if (block->panel) { bool show_background = region->alignment != RGN_ALIGN_FLOAT; @@ -2070,8 +2070,14 @@ void UI_block_draw(const bContext *C, uiBlock *block) show_background = region->overlap != 0; } } + + if (block->panel->type->parent != NULL) { + rect.xmin += style->panelouter; + } + + rect.xmin += style->panelouter; } - ui_draw_aligned_panel(&style, + ui_draw_aligned_panel(style, block, &rect, UI_panel_category_is_visible(region), @@ -2091,7 +2097,7 @@ void UI_block_draw(const bContext *C, uiBlock *block) /* XXX: figure out why invalid coordinates happen when closing render window */ /* and material preview is redrawn in main window (temp fix for bug T23848) */ if (rect.xmin < rect.xmax && rect.ymin < rect.ymax) { - ui_draw_but(C, region, &style, but, &rect); + ui_draw_but(C, region, style, but, &rect); } } } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8b45d9faae6..93f4dda3c79 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -116,7 +116,8 @@ extern const char ui_radial_dir_to_numpad[8]; extern const short ui_radial_dir_to_angle[8]; /* internal panel drawing defines */ -#define PNL_HEADER (UI_UNIT_Y * 1.2) /* 24 default */ +#define PNL_HEADER (UI_UNIT_Y * 1.25) /* 24 default */ +#define PNL_CNR_RAD (UI_UNIT_Y * 0.25f) /* bit button defines */ /* Bit operations */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index a64797af24f..66e9e54ef84 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1075,13 +1075,14 @@ void UI_panels_draw(const bContext *C, ARegion *region) void UI_panel_label_offset(const uiBlock *block, int *r_x, int *r_y) { Panel *panel = block->panel; + const uiStyle *style = UI_style_get(); const bool is_subpanel = (panel->type && panel->type->parent); - *r_x = UI_UNIT_X * 1.0f; + *r_x = UI_UNIT_X * 1.0f + style->panelouter + U.pixelsize; *r_y = UI_UNIT_Y * 1.5f; if (is_subpanel) { - *r_x += (0.7f * UI_UNIT_X); + *r_x += style->panelouter; } } @@ -1119,15 +1120,15 @@ static void panel_draw_highlight_border(const Panel *panel, } float radius; + UI_draw_roundbox_corner_set(UI_CNR_ALL); + if (draw_box_style) { /* Use the theme for box widgets. */ const uiWidgetColors *box_wcol = &UI_GetTheme()->tui.wcol_box; - UI_draw_roundbox_corner_set(UI_CNR_ALL); radius = box_wcol->roundness * U.widget_unit; } else { - UI_draw_roundbox_corner_set(UI_CNR_NONE); - radius = 0.0f; + radius = PNL_CNR_RAD; } float color[4]; @@ -1160,15 +1161,17 @@ static void panel_draw_aligned_widgets(const uiStyle *style, /* Offset triangle and text to the right for subpanels. */ const rcti widget_rect = { - .xmin = header_rect->xmin + (is_subpanel ? scaled_unit * 0.7f : 0), + .xmin = header_rect->xmin, .xmax = header_rect->xmax, .ymin = header_rect->ymin, .ymax = header_rect->ymax, }; uchar title_color[4]; + uchar collapse_icon_color[4]; panel_title_color_get(panel, show_background, region_search_filter_active, title_color); - title_color[3] = 255; + copy_v4_uchar(collapse_icon_color, *title_color); + collapse_icon_color[3] = 100; /* Draw collapse icon. */ { @@ -1180,16 +1183,22 @@ static void panel_draw_aligned_widgets(const uiStyle *style, }; BLI_rctf_scale(&collapse_rect, 0.25f); - float triangle_color[4]; - rgba_uchar_to_float(triangle_color, title_color); - - ui_draw_anti_tria_rect(&collapse_rect, UI_panel_is_closed(panel) ? 'h' : 'v', triangle_color); + GPU_blend(GPU_BLEND_ALPHA); + UI_icon_draw_ex(collapse_rect.xmin - 5.0f, + collapse_rect.ymin - 6.0f / aspect, + UI_panel_is_closed(panel) ? ICON_RIGHTARROW : ICON_DOWNARROW_HLT, + aspect * U.inv_dpi_fac, + 0.5f, + 0.0f, + collapse_icon_color, + false); + GPU_blend(GPU_BLEND_NONE); } /* Draw text label. */ if (panel->drawname[0] != '\0') { const rcti title_rect = { - .xmin = widget_rect.xmin + (panel->labelofs / aspect) + scaled_unit * 1.1f, + .xmin = widget_rect.xmin + (panel->labelofs / aspect), .xmax = widget_rect.xmax, .ymin = widget_rect.ymin - 2.0f / aspect, .ymax = widget_rect.ymax, @@ -1224,12 +1233,12 @@ static void panel_draw_aligned_widgets(const uiStyle *style, /* The magic numbers here center the widget vertically and offset it to the left. * Currently this depends on the height of the header, although it could be independent. */ GPU_matrix_translate_2f(widget_rect.xmax - scaled_unit * 1.15, - widget_rect.ymin + (header_height - drag_widget_size) * 0.5f); + 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); @@ -1246,11 +1255,6 @@ static void panel_draw_aligned_backdrop(const Panel *panel, const bool draw_box_style = panel->type->flag & PANEL_TYPE_DRAW_BOX; const bool is_subpanel = panel->type->parent != NULL; const bool is_open = !UI_panel_is_closed(panel); - - if (is_subpanel && !is_open) { - return; - } - const uint pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -1317,20 +1321,53 @@ static void panel_draw_aligned_backdrop(const Panel *panel, } } else { + /* Regular (non box style) panels. */ + const float margin_y = 2.5f; + float panel_backcolor[4]; + float panel_headercolor[4]; + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_blend(GPU_BLEND_ALPHA); /* Panel backdrop. */ if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) { - immUniformThemeColor(is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK); - immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); + UI_draw_roundbox_corner_set(is_open ? UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT : UI_CNR_ALL); + UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor); + + /* Change the width a little bit to line up with the sides. */ + UI_draw_roundbox_4fv( + &(const rctf){ + .xmin = rect->xmin, + .xmax = rect->xmax, + .ymin = rect->ymin, + .ymax = rect->ymax, + }, + true, + PNL_CNR_RAD, + panel_backcolor); } /* Panel header backdrops for non sub-panels. */ - if (!is_subpanel) { - immUniformThemeColor(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER); - immRectf(pos, rect->xmin, header_rect->ymin, rect->xmax, header_rect->ymax); + if (is_subpanel) { + UI_GetThemeColor4fv(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_SUB_BACK, + panel_headercolor); } + else { + UI_GetThemeColor4fv(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER, + panel_headercolor); + } + + UI_draw_roundbox_corner_set(is_open ? UI_CNR_TOP_RIGHT | UI_CNR_TOP_LEFT : UI_CNR_ALL); + UI_draw_roundbox_4fv( + &(const rctf){ + .xmin = rect->xmin, + .xmax = rect->xmax, + .ymin = header_rect->ymin, + .ymax = header_rect->ymax - margin_y, + }, + true, + PNL_CNR_RAD, + panel_headercolor); GPU_blend(GPU_BLEND_NONE); immUnbindProgram(); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 6b1ff92a855..99713106d76 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -113,12 +113,12 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id style->widget.shadowcolor = 0.0f; style->columnspace = 8; - style->templatespace = 5; - style->boxspace = 5; + style->templatespace = 4; + style->boxspace = 4; style->buttonspacex = 8; style->buttonspacey = 2; style->panelspace = 8; - style->panelouter = 4; + style->panelouter = 8; return style; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 466deedf3bb..b8fc2696cde 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1478,23 +1478,23 @@ static void widget_draw_submenu_tria(const uiBut *but, const uiWidgetColors *wcol) { const float aspect = but->block->aspect * U.inv_dpi_fac; - const int tria_height = (int)(ICON_DEFAULT_HEIGHT / aspect); - const int tria_width = (int)(ICON_DEFAULT_WIDTH / aspect) - 2 * U.pixelsize; - const int xs = rect->xmax - tria_width; - const int ys = (rect->ymin + rect->ymax - tria_height) / 2.0f; + const int icon_height = (int)(ICON_DEFAULT_HEIGHT / aspect); + const int icon_width = (int)(ICON_DEFAULT_WIDTH / aspect) * U.pixelsize; + const int xs = rect->xmax - icon_width; + const int ys = (rect->ymin + rect->ymax - icon_height) / 2.0f; float col[4]; rgba_uchar_to_float(col, wcol->text); col[3] *= 0.8f; - rctf tria_rect; - BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height); - BLI_rctf_scale(&tria_rect, 0.4f); + rctf icon_rect; + BLI_rctf_init(&icon_rect, xs, xs + icon_width, ys, ys + icon_height); + BLI_rctf_scale(&icon_rect, 0.4f); GPU_blend(GPU_BLEND_ALPHA); UI_widgetbase_draw_cache_flush(); + UI_icon_draw_ex(xs, ys, ICON_RIGHTARROW, aspect * U.inv_dpi_fac, 0.5f, 0.0f, wcol->text, false); GPU_blend(GPU_BLEND_NONE); - ui_draw_anti_tria_rect(&tria_rect, 'h', col); } static void ui_text_clip_give_prev_off(uiBut *but, const char *str) @@ -2588,6 +2588,7 @@ static void widget_state(uiWidgetType *wt, int state, int drawflag, eUIEmbossTyp if (state & UI_BUT_ACTIVE_DEFAULT) { copy_v4_v4_uchar(wt->wcol.inner, wt->wcol.inner_sel); copy_v4_v4_uchar(wt->wcol.text, wt->wcol.text_sel); + color_mul_hsl_v3(wt->wcol.outline, 1.0f, 1.0f, 0.9f); } if (color_blend != NULL) { color_blend_v3_v3(wt->wcol.inner, color_blend, wcol_state->blend); @@ -3315,19 +3316,12 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect) static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol) { const int y = rect->ymin + BLI_rcti_size_y(rect) / 2 - 1; - const uchar col[4] = { - wcol->text[0], - wcol->text[1], - wcol->text[2], - 30, - }; - + const uchar col[3] = {wcol->outline[0], wcol->outline[1], wcol->outline[2]}; const uint pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - GPU_blend(GPU_BLEND_ALPHA); - immUniformColor4ubv(col); + immUniformColor3ubv(col); GPU_line_width(1.0f); immBegin(GPU_PRIM_LINES, 2); @@ -3335,8 +3329,6 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol) immVertex2f(pos, rect->xmax, y); immEnd(); - GPU_blend(GPU_BLEND_NONE); - immUnbindProgram(); } @@ -3772,7 +3764,7 @@ static void widget_numslider( uchar outline[3]; copy_v3_v3_uchar(outline, wcol->outline); copy_v3_v3_uchar(wcol->outline, wcol->item); - copy_v3_v3_uchar(wcol->inner, wcol->item); + copy_v4_v4_uchar(wcol->inner, wcol->item); if (!(state & UI_SELECT)) { SWAP(short, wcol->shadetop, wcol->shadedown); @@ -3832,6 +3824,9 @@ static void widget_numslider( factor_discard = factor; } + rect->xmin += 0.2f * U.widget_unit; + rect->xmax -= 0.2f * U.widget_unit; + round_box_edges(&wtb1, roundboxalign_slider, &rect1, ofs); wtb1.draw_outline = false; widgetbase_set_uniform_discard_factor(&wtb1, factor_discard); @@ -4049,9 +4044,14 @@ static void widget_menu_itembut(uiWidgetColors *wcol, uiWidgetBase wtb; widget_init(&wtb); - /* not rounded, no outline */ + /* Padding on the sides. */ + rect->xmin += 0.2f * U.widget_unit; + rect->xmax -= 0.2f * U.widget_unit; + + /* No outline. */ wtb.draw_outline = false; - round_box_edges(&wtb, 0, rect, 0.0f); + const float rad = wcol->roundness * BLI_rcti_size_y(rect); + round_box_edges(&wtb, UI_CNR_ALL, rect, rad); widgetbase_draw(&wtb, wcol); } @@ -4172,10 +4172,32 @@ static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), { uiWidgetBase wtb; widget_init(&wtb); - const float rad = wcol->roundness * U.widget_unit; - round_box_edges(&wtb, roundboxalign, rect, rad); + const float padding = 0.05f; + float color[4]; + rgba_uchar_to_float(color, wcol->item); + + /* Draw the background for the entire widget first. */ + UI_draw_roundbox_corner_set(roundboxalign); + UI_draw_roundbox_4fv( + &(const rctf){ + .xmin = rect->xmin, + .xmax = rect->xmax, + .ymin = rect->ymin, + .ymax = rect->ymax, + }, + true, + rad, + color); + + /* Draw the pill inside, with a small margin to separate each radio choice. */ + rect->xmin += padding * U.widget_unit; + rect->xmax -= padding * U.widget_unit; + rect->ymin += padding * U.widget_unit; + rect->ymax -= padding * U.widget_unit; + round_box_edges(&wtb, UI_CNR_ALL, rect, rad); + wtb.draw_emboss = false; widgetbase_draw(&wtb, wcol); } @@ -4199,6 +4221,7 @@ static void widget_box( const float rad = wcol->roundness * U.widget_unit; round_box_edges(&wtb, roundboxalign, rect, rad); + wtb.draw_emboss = false; widgetbase_draw(&wtb, wcol); copy_v3_v3_uchar(wcol->inner, old_col); diff --git a/source/blender/editors/interface/view2d_draw.c b/source/blender/editors/interface/view2d_draw.c index fd4dba30c1c..3d564c7f120 100644 --- a/source/blender/editors/interface/view2d_draw.c +++ b/source/blender/editors/interface/view2d_draw.c @@ -394,9 +394,6 @@ static void draw_vertical_scale_indicators(const ARegion *region, const int font_id = BLF_default(); UI_FontThemeColor(font_id, colorid); - BLF_enable(font_id, BLF_ROTATION); - BLF_rotation(font_id, M_PI_2); - BLF_batch_draw_begin(); const float xpos = rect->xmax - 2.0f * UI_DPI_FAC; @@ -416,7 +413,6 @@ static void draw_vertical_scale_indicators(const ARegion *region, } BLF_batch_draw_end(); - BLF_disable(font_id, BLF_ROTATION); GPU_matrix_pop_projection(); } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 833c9accf95..f0d5866aa7f 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2669,7 +2669,7 @@ static void ed_panel_draw(const bContext *C, bool open; panel = UI_panel_begin(region, lb, block, pt, panel, &open); - + const bool is_subpanel = (panel->type && panel->type->parent != NULL); const bool search_filter_active = search_filter != NULL && search_filter[0] != '\0'; /* bad fixed values */ @@ -2724,17 +2724,23 @@ static void ed_panel_draw(const bContext *C, UI_block_apply_search_filter(block, search_filter); UI_block_layout_resolve(block, &xco, &yco); - panel->labelofs = xco - labelx; panel->layout = NULL; } - else { - panel->labelofs = 0; - } + + panel->labelofs = UI_PANEL_LABEL_OFFSET; UI_panel_header_buttons_end(panel); if (open || search_filter_active) { short panelContext; + /* Extra offset and panel width adjustment to accomodate sides margin (style->panelouter). */ + const int wofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? style->panelouter : 0; + int xofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? 0 : style->panelouter; + + if (is_subpanel) { + xofs += style->panelouter; + } + /* panel context can either be toolbar region or normal panels region */ if (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) { panelContext = UI_LAYOUT_VERT_BAR; @@ -2750,9 +2756,9 @@ static void ed_panel_draw(const bContext *C, block, UI_LAYOUT_VERTICAL, panelContext, - (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : style->panelspace, + (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : style->panelspace + xofs, 0, - (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : w - 2 * style->panelspace, + (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : (w - 2 * style->panelspace + wofs - xofs), em, 0, style); @@ -2782,7 +2788,7 @@ static void ed_panel_draw(const bContext *C, &panel->children, child_pt, child_panel, - w, + w - style->panelouter, em, unique_panel_str, search_filter); @@ -2892,12 +2898,13 @@ void ED_region_panels_layout_ex(const bContext *C, ScrArea *area = CTX_wm_area(C); View2D *v2d = ®ion->v2d; + const uiStyle *style = UI_style_get_dpi(); bool use_category_tabs = (category_override == NULL) && region_uses_category_tabs(area, region); /* offset panels for small vertical tab area */ const char *category = NULL; const int category_tabs_width = UI_PANEL_CATEGORY_MARGIN_WIDTH; - int margin_x = 0; + int margin_x = style->panelouter; const bool region_layout_based = region->flag & RGN_FLAG_DYNAMIC_SIZE; bool update_tot_size = true; @@ -2912,7 +2919,7 @@ void ED_region_panels_layout_ex(const bContext *C, category = region_panels_collect_categories(region, panel_types_stack, &use_category_tabs); } if (use_category_tabs) { - margin_x = category_tabs_width; + margin_x = category_tabs_width + style->panelouter; } const int w = BLI_rctf_size_x(&v2d->cur) - margin_x; 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)); diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h index 11299ae9717..fb179e012fd 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h @@ -352,5 +352,23 @@ .mat_nr = -1, \ } +#define _DNA_DEFAULT_DashGpencilModifierData \ + { \ + .dash_offset = 0, \ + .segments = NULL, \ + .segments_len = 1, \ + .segment_active_index = 0, \ + } + +#define _DNA_DEFAULT_DashGpencilModifierSegment \ + { \ + .name = "", \ + .dash = 2, \ + .gap = 1, \ + .radius = 1.0f, \ + .opacity = 1.0f, \ + .mat_nr = -1, \ + } + /* clang-format off */ |