UI: Improved Operator to Delete Custom Themes #118775
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#118775
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:RemoveCustomTheme"
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?
Changes to python operators that add and remove custom themes. Removal
gets poll function, separate name and description, and confirmation.
In Preferences / Theme you are able to add and remove custom themes by clicking on the "+" and "-" buttons.
However both of these buttons run the same operator, with the removal using a specific property. But this means that hovering over either "Add" or "Remove" show the exact tooltip text and description. This is hovering over the removal button:
But problems go a bit deeper with these. You can always add a new theme, but you can only remove custom themes, not any of the built-in ones. And the removal button gives no indication of when it works, it just gives an error when it doesn't. And removing a custom theme is a very destructive operation, yet does not give a confirmation.
This PR changes the "Add" operator slightly to give a more specific tooltip:
A new operator is made for removal. Not only does it get its own name and description, but a poll function too. So it will be disabled if the current item is not a custom theme, and the tooltip will inform you on why it is disabled:
When it is used to remove a custom theme, it will show a confirmation:
@ -573,0 +577,4 @@
preset_menu = "USERPREF_MT_interface_theme_presets"
preset_subdir = "interface_theme"
remove_active: BoolProperty(
remove_active
is unused?No, this is overriding AddPresetBase's remove_active from false to true.
In the long term AddPresetBase needs to be split so that every preset removal can get confirmation popup (without customized scripts fo each)
But thats a breaking change so for now this is fine
6d8fcf9661
to1ad66729c8