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:
authorHans Goudey <h.goudey@me.com>2020-12-21 18:43:54 +0300
committerHans Goudey <h.goudey@me.com>2020-12-21 18:43:54 +0300
commitbe71bd8fcc0af1bb3d02f768266f29e2dad2d465 (patch)
tree62dccec4f6bf205b89b01edfeca13794fff7ea68 /source/blender/editors
parent985528c9b9890ba4ffd5a43259994abd0e781ef6 (diff)
Cleanup: Reduce indentation
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_widgets.c102
1 files changed, 52 insertions, 50 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 4d81b1edf0c..77de9a8976e 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4771,73 +4771,75 @@ void ui_draw_but(const bContext *C, struct ARegion *region, uiStyle *style, uiBu
}
}
- if (wt) {
- // rcti disablerect = *rect; /* rect gets clipped smaller for text */
+ if (wt == NULL) {
+ return;
+ }
- const int roundboxalign = widget_roundbox_set(but, rect);
+ // rcti disablerect = *rect; /* rect gets clipped smaller for text */
- /* Mask out flags re-used for local state. */
- int state = but->flag & ~UI_STATE_FLAGS_ALL;
- const int drawflag = but->drawflag;
+ const int roundboxalign = widget_roundbox_set(but, rect);
- if (state & UI_SELECT_DRAW) {
- state |= UI_SELECT;
- }
+ /* Mask out flags re-used for local state. */
+ int state = but->flag & ~UI_STATE_FLAGS_ALL;
+ const int drawflag = but->drawflag;
- if ((but->editstr) ||
- (UNLIKELY(but->flag & UI_BUT_DRAG_MULTI) && ui_but_drag_multi_edit_get(but))) {
- state |= UI_STATE_TEXT_INPUT;
- }
+ if (state & UI_SELECT_DRAW) {
+ state |= UI_SELECT;
+ }
- if (but->hold_func) {
- state |= UI_STATE_HOLD_ACTION;
- }
+ if ((but->editstr) ||
+ (UNLIKELY(but->flag & UI_BUT_DRAG_MULTI) && ui_but_drag_multi_edit_get(but))) {
+ state |= UI_STATE_TEXT_INPUT;
+ }
- if (state & UI_ACTIVE) {
- if (but->drawflag & UI_BUT_ACTIVE_LEFT) {
- state |= UI_STATE_ACTIVE_LEFT;
- }
- else if (but->drawflag & UI_BUT_ACTIVE_RIGHT) {
- state |= UI_STATE_ACTIVE_RIGHT;
- }
- }
+ if (but->hold_func) {
+ state |= UI_STATE_HOLD_ACTION;
+ }
- bool use_alpha_blend = false;
- if (but->emboss != UI_EMBOSS_PULLDOWN) {
- if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE | UI_SEARCH_FILTER_NO_MATCH)) {
- use_alpha_blend = true;
- ui_widget_color_disabled(wt, state);
- }
+ if (state & UI_ACTIVE) {
+ if (but->drawflag & UI_BUT_ACTIVE_LEFT) {
+ state |= UI_STATE_ACTIVE_LEFT;
+ }
+ else if (but->drawflag & UI_BUT_ACTIVE_RIGHT) {
+ state |= UI_STATE_ACTIVE_RIGHT;
}
+ }
- if (drawflag & UI_BUT_TEXT_RIGHT) {
- state |= UI_STATE_TEXT_BEFORE_WIDGET;
+ bool use_alpha_blend = false;
+ if (but->emboss != UI_EMBOSS_PULLDOWN) {
+ if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE | UI_SEARCH_FILTER_NO_MATCH)) {
+ use_alpha_blend = true;
+ ui_widget_color_disabled(wt, state);
}
+ }
+
+ if (drawflag & UI_BUT_TEXT_RIGHT) {
+ state |= UI_STATE_TEXT_BEFORE_WIDGET;
+ }
#ifdef USE_UI_POPOVER_ONCE
- if (but->block->flag & UI_BLOCK_POPOVER_ONCE) {
- if ((state & UI_ACTIVE) && ui_but_is_popover_once_compat(but)) {
- state |= UI_BUT_ACTIVE_DEFAULT;
- }
+ if (but->block->flag & UI_BLOCK_POPOVER_ONCE) {
+ if ((state & UI_ACTIVE) && ui_but_is_popover_once_compat(but)) {
+ state |= UI_BUT_ACTIVE_DEFAULT;
}
+ }
#endif
- wt->state(wt, state, drawflag, but->emboss);
- if (wt->custom) {
- wt->custom(but, &wt->wcol, rect, state, roundboxalign);
- }
- else if (wt->draw) {
- wt->draw(&wt->wcol, rect, state, roundboxalign);
- }
+ wt->state(wt, state, drawflag, but->emboss);
+ if (wt->custom) {
+ wt->custom(but, &wt->wcol, rect, state, roundboxalign);
+ }
+ else if (wt->draw) {
+ wt->draw(&wt->wcol, rect, state, roundboxalign);
+ }
- if (use_alpha_blend) {
- GPU_blend(GPU_BLEND_ALPHA);
- }
+ if (use_alpha_blend) {
+ GPU_blend(GPU_BLEND_ALPHA);
+ }
- wt->text(fstyle, &wt->wcol, but, rect);
- if (use_alpha_blend) {
- GPU_blend(GPU_BLEND_NONE);
- }
+ wt->text(fstyle, &wt->wcol, but, rect);
+ if (use_alpha_blend) {
+ GPU_blend(GPU_BLEND_NONE);
}
}