UI Code Quality: Rename UI_ACTIVE
button flag to UI_HOVER
#114113
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114113
Loading…
Reference in New Issue
No description provided.
Delete Branch "JulianEisel/blender:temp-rename-uibut-active-flag"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
(Note: This PR has been going back and forth between
UI_HOVER
andUI_HOVER_FOCUSED
a bit.)Calling this state "active" has been confusing for a long time for a number of reasons:
UI_SELECT
), both terms are vague.UI_BUT_INACTIVE
) which is totally related to this "active" state.See #112160.
Also see #112160 (comment).
UI_BUT_ACTIVE_LEFT
andUI_BUT_ACTIVE_RIGHT
should be renamed as well?From what I can tell, this flag was meant only for drawing. Does it really determine which buttons can receive keyboard events?
Edit: I guess the interpretation is that it communicates to the user which button will receive input, not that it does so in the code. Ok.
Hmm indeed, it doesn't actually affect behavior much. It is set by handling mostly when activating a button on hover. So maybe
UI_HOVER
is indeed better. There are still cases where it's set without actually hovering the button, but I think that's fine still and can be noted in a comment. I'd also still note the strong correlation with a "focus" state there, but it's indeed not triggered by the flag.UI Code Quality: Rename `UI_ACTIVE` button flag to `UI_HOVER_FOCUS`to UI Code Quality: Rename `UI_ACTIVE` button flag to `UI_HOVER`Yes but what you say quite clearly shows that this can be misinterpreted then. People might expect they can set the flag to focus a button. So now I do actually prefer
UI_HOVER
again :)Seems fine, although now
uiBut::active
is less obviously related toUI_HOVER
.We could rename this to
uiBut::hover
oruiBut::hover_data
too.@ -71,3 +71,3 @@
/** Temporarily hidden (scrolled out of the view). */
UI_SCROLLED = (1 << 1),
UI_ACTIVE = (1 << 2),
/**
This comment could be more explicit... e.g.
Also worth stating....
... this is implied with the term
ACTIVE
since Blender typically only ever has one active item, it's not so clearly the case once renamed.but->active
means more than just hover, for example when tabbing between buttons or opening a menu, we can't really say the mouse is still hovering the button. But the same is true forUI_ACTIVE
, so calling that hover is also not super clear.I think that's a good thing. Their relation can be communicated in a comment, but it's good to not confuse them too much, since the flag does not imply the
active
state, nor the other way around. Further, I think it makes sense to support multiple highlighted elements (list- and view-items do this now, the list/view item is always highlighted on hover, even if the mouse actually hovers a nested button; "extra icons" also have their own hovered state; also think of a button inside a highlight-able panel widget).It seems good to move the flag towards being a drawing flag only (managed by handling), while "active" is rather independent.
I think active makes sense, or
uiBut::focused
since this will receive input. But there's no strict binding to the hover state, as said above. So I'd findhover
too misleading.Committed this now. We can further tweak the comments, or even rename this again if we see need to.