-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adding inner window and multi window containers #4245
Conversation
Feel free to test it out. Much testing and docs required I think, but looking for feedback on the API & widgets/layout etc |
Same windows build issues as #4262 - unrelated to this code |
What is this for ? Window embedding ? |
for making some content of your app appear within a window inside the app. Like the MDI interfaces from Windows https://en.wikipedia.org/wiki/Multiple-document_interface |
@andydotxyz i am confused ,correct me if I am wrong , so it is not an actual native window , but an UI widget/container looks like a window visually ? For example , can I use this to embed a native/independent window into another ? |
It looks like a window. Nothing to do with native windows in border or content. See screenshot at the top or try out the fyne_demo in this branch. |
@andydotxyz I see , thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. This is very cool. I left a comment inline but also have some thoughts below. You don't necessarily have to address all of them but I think it might be wise to at least consider them.
- Resizing does not change the mouse cursor. Is that expected?
- I think the title would look better if it was centered in the window instead of being left-aligned (likely works better with window controls on both the left and right side).
- I feel like we need some sort of way to control the side of the buttons. It looks a bit out of place with inner windows having buttons to the left and my main window having them to the right. I also wander which of these should be the default? With Windows users being more than Mac-users I suspect that controls on the right side would be preferable? Or do we change default depending on the OS?
- The icon that is displayed in the top right is clickable but does nothing when it is clicked. Should it just be an icon and not a button?
- There seems to be less padding on the top of the window than on the other sides? See image below.
Sorry for the rambly sort of review. This really is great stuff but I think it can be made even better :)
container/innerwindow.go
Outdated
i.bg.Move(pos) | ||
i.bg.Resize(size) | ||
|
||
pad = theme.Padding() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you not setting the value to the same one here?
GLFW does not have a standard cursor for this yet sadly :( - in the future this could be addressed
Let's address this in a future release and attempt to switch them based on OS. Not sure how we juggle GTK vs KDE vs Enlightenment though!
The padding on 3 sides is the size of padding, on the top it is the window bar - adding more padding didn't look good I have addressed the other points. If you agree with the summary above we should be good. I can add a ticket to add and detect the button side so it's not forgotten. |
If you want the window to be propped open by title that's a simple custom layout - but this really needs truncation. |
Why would having it cantered in the window break truncation? As long as the custom layout handles MinSize correctly, it seems like it should work. All my other windows on my computer has truncation for the title and text in the centre. |
Because there is a different space required on the left and right it cannot simply be centered with truncate turned on. That seems quite complex and given that left align is standard on Windows 11 I'm tempted to go back to that for now rather than chase this truncation algorithm... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Approved
Checklist: