diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-09 17:36:10 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-09 17:37:47 +0300 |
commit | 2aa3e9c67cc554dd285f37147e83d5e6f82625c3 (patch) | |
tree | 43b3dd131721adbab0536a34eccce780d326d5c8 /source/blender/editors/space_file/file_panels.c | |
parent | 828905190e12432228d88563e0dcb74054b488a9 (diff) |
UI: Add superimposed + and - icons for file number
Brings back + and - icons to the file name button, but now as
superimposed icons.
Diffstat (limited to 'source/blender/editors/space_file/file_panels.c')
-rw-r--r-- | source/blender/editors/space_file/file_panels.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 290b5385bf7..b0fed1fafd4 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -132,7 +132,7 @@ static void file_panel_execution_buttons_draw(const bContext *C, Panel *pa) uiBlock *block = uiLayoutGetBlock(pa->layout); uiBut *but; uiLayout *row; - PointerRNA params_rna_ptr; + PointerRNA params_rna_ptr, *but_extra_rna_ptr; const bool overwrite_alert = file_draw_check_exists(sfile); const bool windows_layout = @@ -176,6 +176,15 @@ static void file_panel_execution_buttons_draw(const bContext *C, Panel *pa) * immediate ui_apply_but_func but only after button deactivates */ UI_but_funcN_set(but, file_filename_enter_handle, NULL, but); + if (params->action_type == FILE_SAVE) { + but_extra_rna_ptr = UI_but_extra_operator_icon_add( + but, "FILE_OT_filenum", WM_OP_EXEC_REGION_WIN, ICON_ADD); + RNA_int_set(but_extra_rna_ptr, "increment", 1); + but_extra_rna_ptr = UI_but_extra_operator_icon_add( + but, "FILE_OT_filenum", WM_OP_EXEC_REGION_WIN, ICON_REMOVE); + RNA_int_set(but_extra_rna_ptr, "increment", -1); + } + /* check if this overrides a file and if the operator option is used */ if (overwrite_alert) { UI_but_flag_enable(but, UI_BUT_REDALERT); |