Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make own title bar, without using the operating systems #616

Closed
altineller opened this issue Feb 28, 2024 · 3 comments
Closed

How to make own title bar, without using the operating systems #616

altineller opened this issue Feb 28, 2024 · 3 comments

Comments

@altineller
Copy link

Hello,

I would like to make a title bar such as:

Screenshot from 2024-02-28 18-26-39

The title bar is avoidable with glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); but then one would need to handle dragging and the minimize/maximize/close buttons on their own.

My question is: The menu bar being a nk_rect at top of the window created with:

nk_begin(ctx, "Menubar", nk_rect(0, 0, display_width, 40), 0);
nk_menubar_begin(ctx);

It has flags 0, so it is not moveable, and it contains the menubar_begin.

How can I make it that so when the user clicks and drags, the rectangle part will move the outer window, such as an operating system generated title bar would?

Best Regards,
C.

@RobLoach
Copy link
Contributor

RobLoach commented Mar 1, 2024

While I haven't used it before, I heard that can be done with slice

@Axle-Ozz-i-sofT
Copy link

Axle-Ozz-i-sofT commented Mar 4, 2024

Hi altineller
If you are meaning the main rendering window with title bar and borders hidden...
I am looking into this too (as well as transparency for the window canvas) on Allegro and SDL2.
One option I am thinking about is to capture capture MOUSE_DOWN x.y over the NK title bar bounds (header) and use the x.y up, down. left, right to move the rendering window (Allegro) by the same amount obtained from the title bar.
For this I would have to send the modified +/-x,+/-y to al_set_window_position(x, y); in Allegro during the drag.

There may be an easier way to do it but I can't see it in Alegro5 at the moment.

Best regards
Axle

@RobLoach
Copy link
Contributor

Depends on your platform. In SDL, I believe you can use SDL_NOFRAME, but I haven't tried it before. This is likely out of scope for the Nuklear renderers themselves though. More a renderer/platform thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants