Skip to content
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

Add basic window control #670

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

melix99
Copy link
Contributor

@melix99 melix99 commented Oct 14, 2024

This is the first merge-able part of #606.

It allows to implement custom CSDs via window management signals and a new WindowHandle widget which is useful to implement a custom titlebar.

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the additional signals; less sure about the new widget

masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
masonry/src/widget/window_handle.rs Outdated Show resolved Hide resolved
@melix99
Copy link
Contributor Author

melix99 commented Oct 18, 2024

Well, I guess I should've included more information on how the WindowHandle is supposed to work, so that it's clearer what my intentions are with this PR.

The WindowHandle is a widget area that allows you to move the window by dragging with your mouse. It's also a single-child container, so you are expected to put the content of the titlebar in there (title label, buttons, menus, etc.) . It's important to know that it's not supposed to be a titlebar by itself, you are still supposed to implement your own titlebar widget that wraps the WindowHandle. This way this widget is completely flexible on the titlebar design you want to implement.

@melix99 melix99 force-pushed the window-control branch 2 times, most recently from 00b7aac to bb4d08f Compare October 21, 2024 14:21
@DJMcNab
Copy link
Member

DJMcNab commented Oct 24, 2024

I still feel that WindowHandle as in this PR is poorly motivated; it seems hard to use correctly (given how anemic our other layout control is, and how little thought has been put into event bubbling; see #masonry > Missing event set_handled calls). Additionally, it's not used at all in this repository; I'd want to at least see an example.

My suggested next step here is to make this PR only the changes required to allow creating this WindowHandle externally (i.e. the changes except for the new widget), which we can easily land. I'd then like to see WindowHandle added in a more complete form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants