UI: Excessive cut-off while searching in keymap preferences #95045

Closed
opened 2022-01-19 09:51:43 +01:00 by Garek · 6 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: AMD Radeon HD 7800 Series ATI Technologies Inc. 4.5.14831 Core Profile Context 21.5.2 27.20.20903.8001

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-16 23:26, hash: 34d424fd64
Broken: version: 2.50alpha1 (searchbox for input first appeared)
Worked: never

Short description of error
When searching in keymap text name of a category will be cut too much.
It does not happen with add-ons or properties editor search.

Exact steps for others to reproduce the error

  1. Open Keymap in preferences.
  2. Resize window. Notice that category name will be cut off only when it really doesn't have any spare space.
  3. Start searching for anything, for example grease pencil.
  4. Resize window. Now category name will be cut off way too easily, having spare space several times largen than it's full text.
    Excessive cutoff2022-01-19 12-55-36.mp4
**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: AMD Radeon HD 7800 Series ATI Technologies Inc. 4.5.14831 Core Profile Context 21.5.2 27.20.20903.8001 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-16 23:26, hash: `34d424fd64` Broken: version: 2.50alpha1 (searchbox for input first appeared) Worked: never **Short description of error** When searching in keymap text name of a category will be cut too much. It does not happen with add-ons or properties editor search. **Exact steps for others to reproduce the error** 1. Open Keymap in preferences. 2. Resize window. Notice that category name will be cut off only when it really doesn't have any spare space. 3. Start searching for anything, for example `grease pencil`. 4. Resize window. Now category name will be cut off way too easily, having spare space several times largen than it's full text. [Excessive cutoff2022-01-19 12-55-36.mp4](https://archive.blender.org/developer/F12811185/Excessive_cutoff2022-01-19_12-55-36.mp4)
Author

Added subscriber: @Garek

Added subscriber: @Garek

Added subscriber: @jenkm

Added subscriber: @jenkm
--- rna_keymap_ui.py
+++ rna_keymap_ui.py
@@ -340,27 +340,27 @@
         layout.context_pointer_set("keymap", km)
 
         filtered_items = [kmi for kmi in km.keymap_items if filter_func(kmi)]
 
         if filtered_items:
             col = layout.column()
 
             row = col.row()
             row.label(text=km.name, icon='DOT')
 
-            row.label()
-            row.label()
+            subrow = row.row()
+            subrow.alignment = 'RIGHT'
 
             if km.is_user_modified:
-                row.operator("preferences.keymap_restore", text="Restore")
+                subrow.operator("preferences.keymap_restore", text="Restore")
             else:
-                row.label()
+                subrow.label()
 
             for kmi in filtered_items:
                 draw_kmi(display_keymaps, kc, km, kmi, col, 1)
     return True
 
 
 def draw_hierarchy(display_keymaps, layout):
     from bl_keymap_utils import keymap_hierarchy
     for entry in keymap_hierarchy.generate():
         draw_entry(display_keymaps, entry, layout)
``` --- rna_keymap_ui.py +++ rna_keymap_ui.py @@ -340,27 +340,27 @@ layout.context_pointer_set("keymap", km) filtered_items = [kmi for kmi in km.keymap_items if filter_func(kmi)] if filtered_items: col = layout.column() row = col.row() row.label(text=km.name, icon='DOT') - row.label() - row.label() + subrow = row.row() + subrow.alignment = 'RIGHT' if km.is_user_modified: - row.operator("preferences.keymap_restore", text="Restore") + subrow.operator("preferences.keymap_restore", text="Restore") else: - row.label() + subrow.label() for kmi in filtered_items: draw_kmi(display_keymaps, kc, km, kmi, col, 1) return True def draw_hierarchy(display_keymaps, layout): from bl_keymap_utils import keymap_hierarchy for entry in keymap_hierarchy.generate(): draw_entry(display_keymaps, entry, layout) ```
Author

@jenkm I tried to modify this file according to your suggestion but it gives me no keymap interface.
image.png
This might be because I didn't build Blender and just directly edited this file with MSVC and Blender text editor but I assumed that with python you don't necessary need to compile Blender.

@jenkm I tried to modify this file according to your suggestion but it gives me no keymap interface. ![image.png](https://archive.blender.org/developer/F12811653/image.png) This might be because I didn't build Blender and just directly edited this file with MSVC and Blender text editor but I assumed that with python you don't necessary need to compile Blender.
Author

@jenkm actually there was problem when I copy-paste it. When I did it properly it worked and issue is gone, thanks, sorry for the noise. All that is left is making it through review...

@jenkm actually there was problem when I copy-paste it. When I did it properly it worked and issue is gone, thanks, sorry for the noise. All that is left is making it through review...

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:22:18 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-11-29 22:36:21 +01:00
Sign in to join this conversation.
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#95045
No description provided.