-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: add attributes for drag region #6362
base: dev
Are you sure you want to change the base?
feat: add attributes for drag region #6362
Conversation
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.
Could you give some examples on how these might interact with each other? specifically the new ones.
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
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.
one more question does data-tauri-drag-region-container
require data-tauri-drag-region
to be also set or do they work independently? I think they should be independent from each other and if they are both present data-tauri-drag-region
would take the precedence and disable all other attributes (i.e. use the old behavior)
I think we should target this to v2 so it also has some time to be tested by everyone while it's unstable. |
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information
It's useful for set a element that has many children draggable.
eg.
A floating window need to be draggable when drag on any where, and can toggle maximize on double click on title.
Use to need set data-tauri-drag-region everywhere, and need to manually implement it for region that doesn't need maximize.
This PR let developer could achieve this just by set body attributes to
data-tauri-drag-region-container
and title container todata-tauri-drag-region-container
data-tauri-drag-region-titlebar
.Description:
data-tauri-drag-region
: mark this element as "drag region"data-tauri-drag-region-container
: children are also considered drag regionsdata-tauri-drag-region-titlebar
: the "drag region" maximizes window on double click (default when onlydata-tauri-drag-region
is used)data-tauri-drag-region-exclude
: this element doesn't triggerdrag
Example: