Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-08-07 16:16:26 +0300
committerJulian Eisel <julian@blender.org>2020-08-07 16:17:52 +0300
commit076a93b855e89fd915779da5991132bc956aa0f4 (patch)
treefc644fb87df0cefe4b2b18741e87c64d4c58b403 /source/blender/editors/interface/interface_intern.h
parent9f475db6c984c4333ebca3ba1749831ca1bff04e (diff)
UI Code Quality: Use derived struct for progessbar buttons
For the main rationale behind this design, see 03b122e2a18df. Further, this removes users of `uiBut.a1`, which is a very ugly design choice (hard to reason about). Part of T74432.
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r--source/blender/editors/interface/interface_intern.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 9840444c0e0..41110883729 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -177,7 +177,6 @@ struct uiBut {
* - UI_BTYPE_LABEL: Use `(a1 == 1.0f)` to use a2 as a blending factor (imaginative!).
* - UI_BTYPE_SCROLL: Use as scroll size.
* - UI_BTYPE_SEARCH_MENU: Use as number or rows.
- * - UI_BTYPE_PROGRESS_BAR: Use to store progress (0..1).
*/
float a1;
@@ -322,6 +321,13 @@ typedef struct uiButDecorator {
int rnaindex;
} uiButDecorator;
+typedef struct uiButProgressbar {
+ uiBut but;
+
+ /* 0..1 range */
+ float progress;
+} uiButProgressbar;
+
/**
* Additional, superimposed icon for a button, invoking an operator.
*/