UI: Implement a Clear Recent Files List Operator #116494

Merged
Harley Acheson merged 4 commits from Brainzman/blender:clear-recent-files into main 2024-01-03 21:26:24 +01:00
Contributor

Right now, it's not possible for the user to clear the recent files list without manually editing the config/recent-files.txt file. This PR adds a simple operator to do so, placing its button at the bottom of the list, similar to the macOS system apps recent file menu. Also, to prevent the user from accidentally erasing his recent files list, this operator asks for confirmation.

ClearRecentFilesScreenshot.png

Right now, it's not possible for the user to clear the recent files list without manually editing the `config/recent-files.txt` file. This PR adds a simple operator to do so, placing its button at the bottom of the list, similar to the macOS system apps recent file menu. Also, to prevent the user from accidentally erasing his recent files list, this operator asks for confirmation. ![ClearRecentFilesScreenshot.png](/attachments/915c106f-8c3b-4e0b-8cf2-9d19fac54484) <video src="/attachments/3073b973-08ab-42ea-b91f-2ab3985e2c98" title="ClearRecentFilesDemo.mp4" controls></video>
Iliya Katushenock added this to the User Interface project 2023-12-23 17:39:47 +01:00
Jonas Holzman requested review from Harley Acheson 2023-12-23 17:42:04 +01:00
First-time contributor

sounds useful
can the popup confirmation be a normal dialog that appears in the middle of the window?
that thing that appear on mouse cursor is very dangerous. just accidentally click twice and its over. it should really be eradicated from blender imo

sounds useful can the popup confirmation be a normal dialog that appears in the middle of the window? that thing that appear on mouse cursor is very dangerous. just accidentally click twice and its over. it should really be eradicated from blender imo
Author
Contributor

can the popup confirmation be a normal dialog that appears in the middle of the window?
that thing that appear on mouse cursor is very dangerous. just accidentally click twice and its over. it should really be eradicated from blender imo

Yeah I agree that this kind of quick popup style confirmation can be quite dangerous in some cases, but right now it's the standard way of asking for confirmation for these sorts of menu buttons (See File > Defaults > Load Factory Settings for example). I can't really state on whether or not these should be replaced, it might be worth opening a Design Issue about it to discuss this more in depth with UI Module members.

> can the popup confirmation be a normal dialog that appears in the middle of the window? > that thing that appear on mouse cursor is very dangerous. just accidentally click twice and its over. it should really be eradicated from blender imo Yeah I agree that this kind of quick popup style confirmation can be quite dangerous in some cases, but right now it's the standard way of asking for confirmation for these sorts of menu buttons (See `File > Defaults > Load Factory Settings` for example). I can't really state on whether or not these should be replaced, it might be worth opening a Design Issue about it to discuss this more in depth with UI Module members.
First-time contributor

I can't really state on whether or not these should be replaced

it will. see #104670
i just dont know why it hasnt yet

> I can't really state on whether or not these should be replaced it will. see #104670 i just dont know why it hasnt yet
Member

it will. see #104670
i just dont know why it hasnt yet

We approve of the general idea and it just needs some code review. We'll get that in. Then an operator confirmation, like in this PR, can get a fancy dialog in just a few lines of code.

> it will. see #104670 > i just dont know why it hasnt yet We approve of the general idea and it just needs some code review. We'll get that in. Then an operator confirmation, like in this PR, can get a fancy dialog in just a few lines of code.
Member

Did you try this with ICON_X or ICON_TRASH? It might balance it out and add more contrast?

image

Did you try this with ICON_X or ICON_TRASH? It might balance it out and add more contrast? ![image](/attachments/7989a75d-9b9d-49d2-8c78-b1312743ef59)
101 KiB
Jonas Holzman force-pushed clear-recent-files from 8a78ef0abe to 8473de1a3a 2023-12-28 01:52:05 +01:00 Compare
Author
Contributor

This does improve readability indeed! I originally didn't think about adding an icon at all, following the precedent of operators in topbar submenus usually not having one, but with the operator being right below the list of blend files icons, this does help better differentiate it from the list, as well as improving horizontal balance.

I ended up going with ICON_TRASH as I felt like it conveyed the intent of completely erasing the list better, let me know what you think.

RecentFilesIcon.png

This does improve readability indeed! I originally didn't think about adding an icon at all, following the precedent of operators in topbar submenus usually not having one, but with the operator being right below the list of blend files icons, this does help better differentiate it from the list, as well as improving horizontal balance. I ended up going with `ICON_TRASH` as I felt like it conveyed the intent of completely erasing the list better, let me know what you think. ![RecentFilesIcon.png](/attachments/5fdb7b96-b62e-499e-ae6b-cb3a253ffde4)
Member

@Brainzman - let me know what you think

That does look nice! We'll talk about this PR in our next UI Module meeting on January 2nd.

> @Brainzman - let me know what you think That does look nice! We'll talk about this PR in our next UI Module meeting on January 2nd.
Harley Acheson approved these changes 2024-01-03 20:51:15 +01:00
Harley Acheson left a comment
Member

works great!

works great!
Harley Acheson added 2 commits 2024-01-03 20:53:37 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
3d2641aa00
Clear Recent Files -> Clear Recent Files List
Member

@blender-bot build

@blender-bot build
Harley Acheson merged commit a1bcba0598 into main 2024-01-03 21:26:24 +01:00
Sign in to join this conversation.
No reviewers
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#116494
No description provided.