How to move a window without a title bar? #985
Replies: 1 comment
|
It still works — the drag handle just shrinks to a sliver you are probably missing. In struct nk_rect header;
header.x = win->bounds.x;
header.y = win->bounds.y;
header.w = win->bounds.w;
if (nk_panel_has_header(win->flags, title)) {
header.h = font->height + 2.0f * style->window.header.padding.y;
header.h += 2.0f * style->window.header.label_padding.y;
} else header.h = panel_padding.y;With a title bar you get the full header height to grab. Without one you fall into the That padding is your window style, via case NK_PANEL_WINDOW: return style->window.padding;so if a couple of pixels is impractical, widening it gives you a bigger handle: ctx->style.window.padding.y = 12;The tradeoff is that it also pushes your content down by the same amount, since it is genuine panel padding rather than a dedicated grab area — fine if your layout has room, annoying if it does not. If you want a proper grab zone without the padding, the usual approach is to drop |
Uh oh!
There was an error while loading. Please reload this page.
I have removed the
NK_WINDOW_TITLEandNK_WINDOW_MINIMIZABLEflags, so I don't see any title bar. Now I do have theNK_WINDOW_MOVABLEbut I am not sure how to move the window.All reactions