"Menu Shadow Width" theme setting influences tooltip size #42221

Closed
opened 2014-10-14 18:05:26 +02:00 by Hadrien Brissaud · 11 comments

System Information
Win7x64 GTX660M

Blender Version
Broken: 2.72 release

Short description of error
When "Menu Shadow Width" is set to maximum (24), tooltip is shrinked to the point where it truncates content. Conversely, at 0 it creates a big margin around the tooltip.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

**System Information** Win7x64 GTX660M **Blender Version** Broken: 2.72 release **Short description of error** When "Menu Shadow Width" is set to maximum (24), tooltip is shrinked to the point where it truncates content. Conversely, at 0 it creates a big margin around the tooltip. **Exact steps for others to reproduce the error** Based on a (as simple as possible) attached .blend file with minimum amount of steps

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @hadrien

Added subscriber: @hadrien

Added subscriber: @JonathanWilliamson

Added subscriber: @JonathanWilliamson

I've confirmed this in 11e7679.

Menu Shadow Width: 0:
Screen_Shot_2014-10-14_at_1.47.01_PM.png
Menu Shadow Width: 12 (default):
Screen_Shot_2014-10-14_at_1.47.05_PM.png
Menu Shadow Width: 24:
Screen_Shot_2014-10-14_at_1.47.10_PM.png

I've confirmed this in 11e7679. **Menu Shadow Width: 0**: ![Screen_Shot_2014-10-14_at_1.47.01_PM.png](https://archive.blender.org/developer/F116700/Screen_Shot_2014-10-14_at_1.47.01_PM.png) **Menu Shadow Width: 12** (default): ![Screen_Shot_2014-10-14_at_1.47.05_PM.png](https://archive.blender.org/developer/F116698/Screen_Shot_2014-10-14_at_1.47.05_PM.png) **Menu Shadow Width: 24**: ![Screen_Shot_2014-10-14_at_1.47.10_PM.png](https://archive.blender.org/developer/F116699/Screen_Shot_2014-10-14_at_1.47.10_PM.png)
Julian Eisel self-assigned this 2014-10-14 22:59:07 +02:00

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel

@JulianEisel, I've been digging into this a bit. It's a similar issue as #41548. It also causes problems with the Search Menu and seemingly any other pop-up menus/UIs. I believe this is due to each of them using the UI_ThemeMenuShadowWidth to define partially define the width and padding of the pop.

Are you aware of any reason why these would be using UI_ThemeMenuShadowWidth?

Lines 669-683 of interface_regions.c

	/* widget rect, in region coords */
	{
		int width = UI_ThemeMenuShadowWidth();
		
		data->bbox.xmin = width;
		data->bbox.xmax = BLI_rcti_size_x(&rect_i) - width;
		data->bbox.ymin = width;
		data->bbox.ymax = BLI_rcti_size_y(&rect_i);
		
		/* region bigger for shadow */
		ar->winrct.xmin = rect_i.xmin - width;
		ar->winrct.xmax = rect_i.xmax + width;
		ar->winrct.ymin = rect_i.ymin - width;
		ar->winrct.ymax = rect_i.ymax + width;
	}

Seems to me that the shadow width and padding width should be separately defined?

@JulianEisel, I've been digging into this a bit. It's a similar issue as #41548. It also causes problems with the Search Menu and seemingly any other pop-up menus/UIs. I believe this is due to each of them using the **UI_ThemeMenuShadowWidth** to define partially define the width and padding of the pop. Are you aware of any reason why these would be using UI_ThemeMenuShadowWidth? **Lines 669-683 of *interface_regions.c*** ``` /* widget rect, in region coords */ { int width = UI_ThemeMenuShadowWidth(); data->bbox.xmin = width; data->bbox.xmax = BLI_rcti_size_x(&rect_i) - width; data->bbox.ymin = width; data->bbox.ymax = BLI_rcti_size_y(&rect_i); /* region bigger for shadow */ ar->winrct.xmin = rect_i.xmin - width; ar->winrct.xmax = rect_i.xmax + width; ar->winrct.ymin = rect_i.ymin - width; ar->winrct.ymax = rect_i.ymax + width; } ``` Seems to me that the shadow width and padding width should be separately defined?
Member

We (@JonathanWilliamson and myself) talked a bit about this on IRC, but I should share it here, too, so...

The problem we have with the tooltip code is that it is a real mess. There are multiple rectangles to determine the sizes of text, background, padding, shadows, ... The biggest issue is that they depend on each other, quite weirdly, making it hard to do working changes. With the tooltip design update, I did some months ago, this only got worse, but since this was a much needed update, it was worth ignoring the added mess.
However, we could just try to fix this bug only (what would probably make the code worse again), or try to fix the complete system beneath it. I would much prefer the later one, as this would make further changes much, much easier.

I'd like to spend a bit of time on this tooltip code refactor and as I'm quite busy with other projects and the bug itself isn't that high priority (IMHO), I'll postpone it for a really few weeks.

Thanks a lot for the report @hadrien!

We (@JonathanWilliamson and myself) talked a bit about this on IRC, but I should share it here, too, so... The problem we have with the tooltip code is that it is a real mess. There are multiple rectangles to determine the sizes of text, background, padding, shadows, ... The biggest issue is that they depend on each other, quite weirdly, making it hard to do working changes. With the tooltip design update, I did some months ago, this only got worse, but since this was a much needed update, it was worth ignoring the added mess. However, we could just try to fix this bug only (what would probably make the code worse again), or try to fix the complete system beneath it. I would much prefer the later one, as this would make further changes much, much easier. I'd like to spend a bit of time on this tooltip code refactor and as I'm quite busy with other projects and the bug itself isn't that high priority (IMHO), I'll postpone it for a really few weeks. Thanks a lot for the report @hadrien!

I agree with you @JulianEisel, the latter method of refactoring the tooltip draw code is a better route. This is a low priority bug in my opinion that most people will never even encounter. Seems to me it's worth doing it right rather than just applying another bandage.

I agree with you @JulianEisel, the latter method of refactoring the tooltip draw code is a better route. This is a low priority bug in my opinion that most people will never even encounter. Seems to me it's worth doing it right rather than just applying another bandage.

This issue was referenced by da31052b45

This issue was referenced by da31052b45b2d39582d175ff8f301c32c2a4ed1f

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit da31052b45.

Closed by commit da31052b45.
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
5 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#42221
No description provided.