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:
-rw-r--r--source/blender/editors/include/UI_interface.h7
-rw-r--r--source/blender/editors/interface/interface_intern.h1
-rw-r--r--source/blender/editors/interface/interface_layout.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c10
4 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 8d5807660f8..6a8f4d3f02b 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -155,7 +155,7 @@ enum {
/* but->flag - general state flags. */
enum {
- /* warning, the first 5 flags are internal */
+ /* warning, the first 6 flags are internal */
UI_BUT_ICON_SUBMENU = (1 << 6),
UI_BUT_ICON_PREVIEW = (1 << 7),
@@ -201,12 +201,15 @@ enum {
UI_BUT_TEXT_RIGHT = (1 << 3),
/* Prevent the button to show any tooltip. */
UI_BUT_NO_TOOLTIP = (1 << 4),
- /* button align flag, for drawing groups together (also used in uiBlock->flag!) */
+
+ /* Button align flag, for drawing groups together.
+ * Used in 'uiBlock.flag', take care! */
UI_BUT_ALIGN_TOP = (1 << 14),
UI_BUT_ALIGN_LEFT = (1 << 15),
UI_BUT_ALIGN_RIGHT = (1 << 16),
UI_BUT_ALIGN_DOWN = (1 << 17),
UI_BUT_ALIGN = (UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT | UI_BUT_ALIGN_DOWN),
+ /* end bits shared with 'uiBlock.flag' */
/* Warning - HACK! Needed for buttons which are not TOP/LEFT aligned, but have some top/left corner stitched to some
* other TOP/LEFT-aligned button, because of 'corrective' hack in widget_roundbox_set()... */
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index cbe8fb75d61..0ad07351735 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -120,6 +120,7 @@ enum {
UI_ACTIVE = (1 << 2),
UI_HAS_ICON = (1 << 3),
UI_HIDDEN = (1 << 4),
+ UI_SELECT_DRAW = (1 << 5), /* Display selected, doesn't impact interaction. */
/* warn: rest of uiBut->flag in UI_interface.h */
};
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index f0926cf2a81..23ac1c5027d 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -846,7 +846,7 @@ static uiBut *uiItemFullO_ptr_ex(
UI_block_emboss_set(block, UI_EMBOSS);
if (flag & UI_ITEM_O_DEPRESS) {
- but->flag |= UI_SELECT;
+ but->flag |= UI_SELECT_DRAW;
}
if (layout->redalert)
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index eddff59257b..75cab383f35 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -67,13 +67,13 @@
#define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect))
#define UI_BUT_FLAGS_PUBLIC \
- (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_HIDDEN)
+ (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_HIDDEN | UI_SELECT_DRAW)
-/* Don't overlap w/ UI_BUT_FLAGS_PUBLIC buts. */
+/* Don't overlap w/ UI_BUT_FLAGS_PUBLIC bits. */
enum {
/* Show that holding the button opens a menu. */
UI_STATE_HOLD_ACTION = (1 << 6),
- UI_STATE_TEXT_INPUT = (1 << 7),
+ UI_STATE_TEXT_INPUT = (1 << 7),
};
@@ -4068,6 +4068,10 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
state = but->flag & UI_BUT_FLAGS_PUBLIC;
+ if (state & UI_SELECT_DRAW) {
+ state |= UI_SELECT;
+ }
+
if ((but->editstr) ||
(UNLIKELY(but->flag & UI_BUT_DRAG_MULTI) && ui_but_drag_multi_edit_get(but)))
{