feat: add attributes for drag region #6362
Open
+139
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: