DearPyGui
DearPyGui copied to clipboard
set_viewport_decorated(False) does not work well with primary_window
Win 10, DPG 0.8.54
set_viewport_decorated(False) does not work well with primary_window. The code below results in the screenshot below. The primary window does not cover the entire viewport.
import dearpygui.dearpygui as dpg
dpg.setup_viewport()
dpg.set_viewport_height(400)
dpg.set_viewport_width(400)
dpg.set_viewport_decorated(False)
with dpg.window(label="tutorial") as main_window:
dpg.add_button(label="Press me")
dpg.add_text('............................................................................................................................................................')
dpg.set_primary_window(main_window, True)
dpg.start_dearpygui()
Fixed in next release.
It is not fixed yet.
Will recheck this!
V 1.6.2 Fixed;
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title='Custom Title', width=400, height=400, decorated=False)
dpg.setup_dearpygui()
with dpg.window(label="tutorial") as main_window:
dpg.add_button(label="Press me")
dpg.add_text('............................................................................................................................................................')
dpg.set_primary_window(main_window, True)
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Bug should be closed !
There is still an issue with decorated=False
and primary window on Windows 10 using DPG 1.8.0
import dearpygui.dearpygui as dpg
dpg.create_context()
with dpg.window() as primary_window:
dpg.add_text("Hello World")
dpg.create_viewport(width=200, height=200, decorated=False, x_pos=500)
dpg.set_primary_window(primary_window, True)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Notice the thin gray border on the top and left edges of the viewport - which is not present on the bottom and right edges.
If you remove dpg.set_primary_window
then the borders of the window are rendered consistently.
Hey @my1e5
I can reproduce it and yes it isn't quite correct. Should be fixed in the next release.
Btw that is how it looks now:
So also verified with my own and pilots project, and it looks good to me
Not a big deal but I'd like to point out that the fix makes the if (viewport->decorated)
condition useless:
if (viewport->decorated)
{
GContext->viewport->clientHeight = cheight;
GContext->viewport->clientWidth = cwidth;
}
else
{
GContext->viewport->clientHeight = cheight;
GContext->viewport->clientWidth = cwidth;
}
Since the if
and else
branches are identical, one could just get rid of the if
statement.
That is true ! Thanks for the hint !