lc-soft / LCUI

C library for building user interfaces
https://lcui-dev.github.io
MIT License
4.15k stars 357 forks source link

Improve window resizing on Windows #164

Closed dossalab closed 6 years ago

dossalab commented 6 years ago

20

...Or at least make window border non-resizeable (for example, if root width & height properties set in css)

lc-soft commented 6 years ago

make window border non-resizeable

You can try to set min size and max size, like this:

root {
  min-width: 900px;
  max-width: 900px;
  min-height: 600px;
  max-height: 600px;
}
dossalab commented 6 years ago

This seems like a solution, but there are problems:

  1. Cursor still will became double-arrow at the border
  2. Window maximize button will not be disabled
  3. Clicking maximize button will move window to the random location on the screen
lc-soft commented 6 years ago

What do you think of the following solution?

  1. If min-width == max-width, then disable window width adjustment, and the height is also.
  2. If root widget has maximum size limit, then disable the window maximize button.
dossalab commented 6 years ago

Completely agree

lc-soft commented 6 years ago

For the problem in your screenshot, LCUI dose not re-render content when resizing window, I found a solution:

https://www.gamedev.net/forums/topic/651599-rendering-freezing-when-dragresize-window/

lc-soft commented 6 years ago

Done.

window-resizing

window-button-disabled