Surrealism-All / SurrealismUI

A third-party UI library using Slint, I think it will give you an extraordinary experience
https://surrealism-all.github.io/SurrealismUI.github.io/
MIT License
197 stars 19 forks source link

SMenu、SHeader在界面最大化的时候,高、宽没有跟随界面变化 #20

Closed grzeng-go closed 8 months ago

syf20020816 commented 8 months ago

请注意,这并不是issue 请仔细阅读Slint对原生Window内置组件的描述: The Window geometry will be restricted by its layout constraints: Setting the width will result in a fixed width, and the window manager will respect the min-width and max-width so the window can’t be resized bigger or smaller. The initial width can be controlled with the preferred-width property. The same applies to the Windows height. 意思是Window受到布局约束,它的宽度由min-width和max-width进行限定,因此它无法被重置大小,它的初始化由preferred-width控制,它的高也一样

syf20020816 commented 8 months ago

若你想要获取Window最大化后的大小可以使用API: pub fn size(&self)->PhysicalSize 或尝试使用重绘: pub fn request_redraw(&self)