rodrigocfd / winsafe

Windows API and GUI in safe, idiomatic Rust.
https://crates.io/crates/winsafe
MIT License
518 stars 30 forks source link

resizable_layout not work as expect #114

Closed MDZZDYXCMDZZDYXC closed 10 months ago

MDZZDYXCMDZZDYXC commented 10 months ago

When I set the windows effect to "Don't show window contents when dragged", the variable layout didn't work as expected ![Uploading bug.gif…]()

MDZZDYXCMDZZDYXC commented 10 months ago

bug

MDZZDYXCMDZZDYXC commented 10 months ago

dataview.zip

rodrigocfd commented 10 months ago

Try this:

fn main() {
    let window = gui::WindowMain::new_dlg(108, Some(128), None);

    use gui::{Horz as H, Vert as V};
    let dsd = gui::Edit::new_dlg(&window, 1000, (H::Resize, V::Repos));
    let btn = gui::Button::new_dlg(&window, 1002, (H::None, V::Repos));
    let tab = gui::ListView::new_dlg(&window, 1003, (H::Resize, V::Resize),
        Some(winsafe::HMENU::CreatePopupMenu().unwrap()));

    window.run_main(None);
}

There is a label which is not being handled (ID is 65535). In order to adjust it to the layout, you'll have to give it an ID and manage it through a Label.

MDZZDYXCMDZZDYXC commented 10 months ago

Thanks for your response, but I think you misunderstood me, which is why I included the gif.

This is my personal computer habit, I will turn off a lot of windows rendering effects to save performance.

When I uncheck the options in the red box, the adaptive doesn't work. 233 The code has been modified as you want, but it still doesn't work in this case. I'm showing you this gif below. exp11

rodrigocfd commented 10 months ago

I'll try to reproduce this here. Is this a system option? Where do I find it?

MDZZDYXCMDZZDYXC commented 10 months ago

Perhaps you can search "adjust the appearance and performance of Windows" in Settings. But I found the path of the program as follows: "C:\Windows\System32\SystemPropertiesPerformance.exe" image

rodrigocfd commented 10 months ago

There was a very specific case where the LayoutArranger didn't fire on the 1st WM_SIZE call. Since hide contents while dragging only fires 1 event, the controls didn't resize at the first move.

Let me know if this fixes your problem.

MDZZDYXCMDZZDYXC commented 10 months ago

Thanks,it's works pretty well!