orbtk
orbtk copied to clipboard
It is possible to open a window with maximized size?
The title tells the story... I want to open a window as maximized.
@ChayimFriedman2 not yet but I could implement it as next. I let you know when it's done.
I think a new method called fullscreen() should be added to the Window builder. It would call a piece of code that acquires the current display resolution and would set a window position to (0.0, 0.0), size to (resolution_x, resolution_y) and resizeable to false.
Application::new()
.window(|ctx| {
Window::new()
.title("OrbTk - Fullscreen example")
.fullscreen(yes)
.resizeable(false)
.build(ctx)
})
.run();
@kivimango That what I've thought too. Too notes, though:
.fullscreen(yes)????? You probably meant.fullscreen(true)...- I think
fullscreen()is an ambiguous, because it also means fullscreen window (i.e. without borders etc.). Better name ismaximized(), or even better, something likestate(requestedState: WindowState)whereWindowStateis an enumenum WindowState { Normal, Maximized, Minimized }.
@ChayimFriedman2 thank you for your input. It will be included in the 0.3.1-alpha4 relase.
Hi, i think this feature could be implemented more easily when the new glutin backend arrives since it already have on WindowBuilder struct the function pub fn with_fullscreen(self, monitor: Option<Fullscreen>) -> WindowBuilder that can be used to set fullscreen exclusive window or borderless window. (https://docs.rs/glutin/0.24.1/glutin/window/struct.WindowBuilder.html#method.with_fullscreen)
1. `.fullscreen(yes)`????? You probably meant `.fullscreen(true)`...
Exactly.
2. I think `fullscreen()` is an ambiguous, because it also means fullscreen window (i.e. without borders etc.). Better name is `maximized()`, or even better, something like `state(requestedState: WindowState)` where `WindowState` is an enum `enum WindowState { Normal, Maximized, Minimized }`.
You are right.
Will take it on my agenda