-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Allow setting windows size based on monitor size #3065
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
Conversation
I think you could use fn(Size) -> Size in the added variant to avoid the Arc, since Position::SpecificWith also just uses a function pointer (which is Send, Sync and Copy)
I think you could use
fn(Size) -> Sizein the added variant to avoid the Arc, sincePosition::SpecificWithalso just uses a function pointer (which isSend,SyncandCopy)
I did in the original PR, but for the tester I need to support closures, since I need to make the window wider than it would otherwise be:
Lines 67 to 72 in 0a34496
Lines 56 to 67 in a9ac8ba
The only other solution I could think of, would be to ignore the variable window size when the tester is used.
Maybe you have a better idea?
Hmm
You could add an extra field to the variant which contains extra size, but that could make it a bit confusing to use, or just plain ugly.
a9ac8ba to
6279590
Compare
Hmm
You could add an extra field to the variant which contains extra size, but that could make it a bit confusing to use, or just plain ugly.
The current API isn't really all user friendly either.
I added a helper function, but the enum variant is still there and requires a manual Arc.
It's not obvious you should use the helper.
@pml68 What do you think about creating a wrapper struct to hide the enum variants?
Then I'd just expose helper functions and nothing else.
That way I wouldn't expose any weird enum variants.
pub struct Size( pub(crate) SizeVariant)
Not sure these enum in struct types fir with the iced style.
@pml68 What do you think about creating a wrapper struct to hide the enum variants? Then I'd just expose helper functions and nothing else. That way I wouldn't expose any weird enum variants.
pub struct Size( pub(crate) SizeVariant)
Hmm not sure honestly. I can't really think of a better way, but I wonder what Héctor would think about the proposed solutions (user has to Arc / hidden enum / some other solution to the test recorder-size adding problem)
This just adds the
FromScreensizeoption to the window settings size.I used the positioning option as a base.
I use this for my drowdown terminal, so the window size is automatically set.