diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 729498c0c8d..ffed0378d41 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -293,8 +293,13 @@ class USERPREF_PT_interface_editors(InterfacePanel, CenterAlignMixIn, Panel): col = layout.column() col.prop(system, "use_region_overlap") + + col = layout.column(heading="Show", align=True) col.prop(view, "show_area_handle") + col.prop(view, "show_number_arrows", text="Numeric Input Arrows") col.prop(view, "show_navigate_ui") + + col = layout.column() col.prop(view, "border_width") col.prop(view, "color_picker_type") col.row().prop(view, "header_align") diff --git a/source/blender/blenloader/intern/versioning_userdef.cc b/source/blender/blenloader/intern/versioning_userdef.cc index 4b39bcb7153..ba4ead9e4cb 100644 --- a/source/blender/blenloader/intern/versioning_userdef.cc +++ b/source/blender/blenloader/intern/versioning_userdef.cc @@ -1147,7 +1147,7 @@ void blo_do_versions_userdef(UserDef *userdef) if (!USER_VERSION_ATLEAST(280, 44)) { userdef->uiflag &= ~USER_NO_MULTITOUCH_GESTURES; - userdef->uiflag2 &= ~USER_UIFLAG2_UNUSED_0; + userdef->uiflag2 &= ~USER_ALWAYS_SHOW_NUMBER_ARROWS; userdef->gp_settings &= ~GP_PAINT_UNUSED_0; } diff --git a/source/blender/editors/interface/interface_widgets.cc b/source/blender/editors/interface/interface_widgets.cc index 3185b4a7143..665e3a9f3f8 100644 --- a/source/blender/editors/interface/interface_widgets.cc +++ b/source/blender/editors/interface/interface_widgets.cc @@ -3604,7 +3604,9 @@ static void widget_numbut_draw(const uiBut *but, } /* decoration */ - if ((state->but_flag & UI_HOVER) && !state->is_text_input) { + if (((state->but_flag & UI_HOVER) || (U.uiflag2 & USER_ALWAYS_SHOW_NUMBER_ARROWS)) && + !state->is_text_input) + { uiWidgetColors wcol_zone; uiWidgetBase wtb_zone; rcti rect_zone; @@ -3617,6 +3619,9 @@ static void widget_numbut_draw(const uiBut *but, wcol_zone = *wcol; copy_v3_v3_uchar(wcol_zone.item, wcol->text); + if (!(state->but_flag & UI_HOVER)) { + wcol_zone.item[3] = 180; + } if (state->but_drawflag & UI_BUT_HOVER_LEFT) { widget_active_color(&wcol_zone); } @@ -3637,6 +3642,9 @@ static void widget_numbut_draw(const uiBut *but, wcol_zone = *wcol; copy_v3_v3_uchar(wcol_zone.item, wcol->text); + if (!(state->but_flag & UI_HOVER)) { + wcol_zone.item[3] = 180; + } if (state->but_drawflag & UI_BUT_HOVER_RIGHT) { widget_active_color(&wcol_zone); } @@ -3656,7 +3664,9 @@ static void widget_numbut_draw(const uiBut *but, wcol_zone = *wcol; copy_v3_v3_uchar(wcol_zone.item, wcol->text); - if (!(state->but_drawflag & (UI_BUT_HOVER_LEFT | UI_BUT_HOVER_RIGHT))) { + if ((state->but_flag & UI_HOVER) && + !(state->but_drawflag & (UI_BUT_HOVER_LEFT | UI_BUT_HOVER_RIGHT))) + { widget_active_color(&wcol_zone); } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index bc07eb113cf..7bc18c437b2 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -808,7 +808,7 @@ typedef enum eUserpref_UI_Flag { * \note don't add new flags here, use 'uiflag' which has flags free. */ typedef enum eUserpref_UI_Flag2 { - USER_UIFLAG2_UNUSED_0 = (1 << 0), /* cleared */ + USER_ALWAYS_SHOW_NUMBER_ARROWS = (1 << 0), /* cleared */ USER_REGION_OVERLAP = (1 << 1), USER_UIFLAG2_UNUSED_2 = (1 << 2), USER_UIFLAG2_UNUSED_3 = (1 << 3), /* dirty */ diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index 3042c475f07..70d2316b990 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -4944,6 +4944,14 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Corner Handles", "Show visible area maintenance corner handles"); RNA_def_property_update(prop, 0, "rna_userdef_gpu_update"); + prop = RNA_def_property(srna, "show_number_arrows", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, nullptr, "uiflag2", USER_ALWAYS_SHOW_NUMBER_ARROWS); + RNA_def_property_ui_text( + prop, + "Show Numeric Input Arrows", + "Display arrows in numeric input fields for increasing or decreasing values"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DRAWVIEWINFO); RNA_def_property_ui_text(prop,