DearPyGui
DearPyGui copied to clipboard
Support High DPI
Is your feature request related to a problem? Please describe. Currently HiDPI mode on Pop!_OS results in a super tiny display for DPG windows.
Describe the solution you'd like Scale appropriately to HiDPI displays
Describe alternatives you've considered Add an additional config option perhaps that the script sets HiDPI mode itself.
Additional context

Wow. That's tiny. We will get on this! Thanks for the report!
Just stumbled upon the same problem on Arch Linux. A simple patch
DearPyGui/src/platform/Linux/mvLinuxViewport.cpp
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
────────────────────┐
namespace Marvel { │
────────────────────┘
132
// Setup style
ImGui::StyleColorsDark();
auto& style = ImGui::GetStyle();
style.ScaleAllSizes(2.0);
mvApp::SetDefaultTheme();
// Setup Platform/Renderer bindings
works locally if you are not redistributing. @davidskeck
Note for fonts to scale you need to add a custom font:
import dearpygui.dearpygui as dpg
from dearpygui.demo import show_demo
with dpg.font_registry():
# add font (set as default for entire app)
dpg.add_font("/usr/share/fonts/adobe-source-han-sans/SourceHanSansCN-Regular.otf", CURRENT_DPI * 13, default_font=True)
show_demo()
dpg.start_dearpygui()
For this to be cross-platform we need to detect the current DPI in the Viewport C++ files.
include the icon texture(like the text font,radio etc.) in the hidpi resolution, when i scale 2x(windows 10),they look blur.
Any fix? Having the same issue on a framework laptop with a hidpi (3:2 aspect ratio).
I still don't have a solution and see the same problem on the latest release. I'm not sure how @ProfFan made that change and rebuilt... any tips on how to get that to work? Thank you!
OK I just went through the trouble of rebuilding DearPyGUI by following the steps in the CI to test the fix @ProfFan came up with, but appears it no longer works. Some impact occurs, but the only thing I can notice are my windows are slightly misplaced, rather than neatly arranged, but remain the same (tiny) size as before.
This is the change I tried:
--- a/src/mvViewport_linux.cpp
+++ b/src/mvViewport_linux.cpp
@@ -221,6 +221,8 @@ mvShowViewport(mvViewport& viewport, bool minimized, bool maximized)
// Setup style
ImGui::StyleColorsDark();
+ auto& style = ImGui::GetStyle();
+ style.ScaleAllSizes(2.0);
SetDefaultTheme();
// Setup Platform/Renderer bindings