[Bf-blender-cvs] [2aa3e9c67cc] master: UI: Add superimposed + and - icons for file number
Julian Eisel
noreply at git.blender.org
Mon Sep 9 16:37:55 CEST 2019
Commit: 2aa3e9c67cc554dd285f37147e83d5e6f82625c3
Author: Julian Eisel
Date: Mon Sep 9 16:36:10 2019 +0200
Branches: master
https://developer.blender.org/rB2aa3e9c67cc554dd285f37147e83d5e6f82625c3
UI: Add superimposed + and - icons for file number
Brings back + and - icons to the file name button, but now as
superimposed icons.
===================================================================
M source/blender/editors/space_file/file_panels.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list