hoffstadt / hoffstadt/DearPyGui

Cannot edit `mvStyleVar_DisplaySafeAreaPadding` outside of style editor

Open
#2,014 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.8.0
Operating System: Windows 10, Fedora 36 KDE

## My Issue/Question

The style editor lists `mvStyleVar_DisplaySafeAreaPadding` with defaults at (3,3) and ranges from (0,0) to (30,30). It appears to affect popups, which will try to stay this distance away from the edge of the viewport. Editing it through the style editor works as expected, but it isn't listed in docs and cannot be permanently edited.

## To Reproduce

1. Open the style editor using `dpg.show_style_editor()` and find the "Safe Area Padding" category, which only contains the `mvStyleVar_DisplaySafeAreaPadding` variable. Change the values as desired.
2. Create a popup window that touches the edge of the viewport, such as (0,0)
3. Notice that is it offset from the provided coordinates using values from `mvStyleVar_DisplaySafeAreaPadding`
4. Create a global theme, and try to change the variable using `dpg.add_theme_style()`
> AttributeError: module 'dearpygui.dearpygui' has no attribute 'mvStyleVar_DisplaySafeAreaPadding'

## Expected behavior

The style variable can be changed using `dpg.add_theme_style()`.

## Screenshots/Video

![image](https://media.discordapp.net/attachments/1057683957161926706/1057683957342285944/image.png)
![image](https://user-images.githubusercontent.com/39402973/211937132-86e4c70c-5a24-41cf-a3b4-25bb66a02616.png)

## Standalone, minimal, complete and verifiable example

```python
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

# with dpg.theme() as theme:
# with dpg.theme_component(dpg.mvAll):
# dpg.add_theme_style(dpg.mvStyleVar_DisplaySafeAreaPadding, 0, category=dpg.mvThemeCat_Core)
# dpg.bind_theme(theme)

dpg.show_style_editor()
with dpg.window(pos=(0,200), no_close=True):
dpg.add_button(label="Show popup", callback=lambda: dpg.add_window(pos=(0,0), popup=True))

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.