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

one drag to resize them all #155

Draft
wants to merge 24 commits into
base: release-0.13
Choose a base branch
from

Conversation

FreddyFunk
Copy link

@FreddyFunk FreddyFunk commented Aug 12, 2023

This pull request aims to implement basic dragging support for t-intersections of two node separators. Support for cross-intersections more than two node separators, as well as separator snapping support is out of scope for this pull request.

Demo:

Screen.Recording.mov

@Adanos020
Copy link
Owner

Hey, can you write more about this here, so those that aren't on Discord can see what this is about?

@FreddyFunk
Copy link
Author

done :)

@FreddyFunk FreddyFunk marked this pull request as ready for review August 23, 2023 19:28
Copy link
Owner

@Adanos020 Adanos020 left a comment

Choose a reason for hiding this comment

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

This is looking pretty good so far.

I wouldn't merge this PR just yet since it seems a bit incomplete without making the junctions snap together when they form an intersection. Once that's implemented, I'll happily accept it!

src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
src/widgets/dock_area/mod.rs Outdated Show resolved Hide resolved
LennysLounge and others added 20 commits August 28, 2023 12:58
* Add rounding and correctly draw border

* Add TabBodyStyle

* Round the leaf size calculation

If this isn't rounded it is possible that either leaf disappears behind
the separator by one pixel. The rounding here should happen the same
way the rounding happens in `show_separator`

* Deal with stroke width correctly

The stroke of a rectangle expands beyond the original rectangle.
This will make sure that the rectangle is small enough so that when the
stroke expands beyond the rect, it is still inside the original size.

* Add different interaction version of tab style

* Move `fill_tab_bar` to tab bar settings

* Update the examples with the new styling

* Account for the scrollbar in the tab bar

* Use the correct interact style for the tab title

* Rename style structs

* Move hline style to tab style

* Add a prefered width for tabs

* Hide to tab body top border

* Set pointer hand when hovering over a tab

* Update changelog

* Remove todo

* Improve doc and apply suggestions

* Depluralise

* Change preferred width to minimum width

* Change styling a bit

* Change the default styling a bit

* Avoid overdrawing the add button line

* Update CHANGELOG.md

Adjust changelog
* Update egui version in badge

* fix: typo

* feat: double click to reset resizing

---------

Co-authored-by: Adanos020 <[email protected]>
* feat: allow disabling vertical/horizontal splits

in my use case vertical splits are useless, maybe other people
have some use for this. /shrug

* fix: rename vertical/horizontal to leftright/topbottom

* Move `allowed_splits` from `Style` to `DockArea`

* Add split directions to the style editor. Fix panic while dragging tabs with `None` split directions.

* Delete redundant module path

---------

Co-authored-by: Adam Gąsior <[email protected]>
* Allow individual tabs to be closable or not

This fixes Adanos020#113

* Fix clippy warning

---------

Co-authored-by: Adam Gąsior <[email protected]>
* Add the NodeIndex to context_menu() parameter list

* Adapt contex_menu() in hello example
* Support for undocking and docking tabs as windows

This commit adds support for undocking and docking tabs as windows. this includes a new widget shown on panels where tabs can be dropped which is inspired by other guis and originally implemented by micfong-z.

* Added Surfaces!

Restructured Tree to have the top level indexing be done via the new type Surface! Surfaces can either mean the root panel or a window. This contains broken examples and major breaking changes in api that will be addressed

* Renamings and restructure

Additions:
windows can now be resized
undocked tabs that become windows now reflect their old size

Changes:
-Renamed NodeTree back to Tree
-Renamed Tree to DockState
-Added new methods to DockState to reflect old API and fix examples
-New methods iter_nodes, root, root_mut,

* Further Renaming and window rejecting tabs

this commit creates several breaking API changes and adds the ability for tabs to reject being created as a window. This is done via ``TabViewer``. A new example has been added to showcase this feature.

* Support for undocking and docking tabs as windows

This commit adds support for undocking and docking tabs as windows. this includes a new widget shown on panels where tabs can be dropped which is inspired by other guis and originally implemented by micfong-z.

* Added Surfaces!

Restructured Tree to have the top level indexing be done via the new type Surface! Surfaces can either mean the root panel or a window. This contains broken examples and major breaking changes in api that will be addressed

* Renamings and restructure

Additions:
windows can now be resized
undocked tabs that become windows now reflect their old size

Changes:
-Renamed NodeTree back to Tree
-Renamed Tree to DockState
-Added new methods to DockState to reflect old API and fix examples
-New methods iter_nodes, root, root_mut,

* Further Renaming and window rejecting tabs

this commit creates several breaking API changes and adds the ability for tabs to reject being created as a window. This is done via ``TabViewer``. A new example has been added to showcase this feature.

* Delete abstract_tree

* Experimental changes

-bugfixes
-namechanges
[TEMPORARY]

* Small bugfixes

-removing all tabs on root surface doesn't panic
-tabs can be added to an empty surface

* Surfaces, Focus and expanding windows Bugfix

-fixed a bug where closing all tabs in a window could result in a panic
-fixed a scenario where the dockarea may attempt to remove the root surface.
-Leaf rects are now trimmed down to never expand beyond root node rects to try and prevent pixel roundings causing windows and other surfaces to infinitely expand.

* bugfixes and consistency changes

-changed set_focused_node_and_surface to be more consistent with set_focused_node
-fixed a panic condition where move_tab tries to delete the root surface

* Addition to splits

-Allowed parent nodes to be split

* Panic condition fix

Fixed a panic condition where the emptying of the root surface can cause an out of bounds error for indexing the empty node tree

* changed interactions with overlay

-tab drop overlay is now always on top of everything in the dock area,
-style has been changed to accomodate overlay properties
-when overlay is shown hovering over buttons will lock the hover data until the mouse reaches outside their influence

* Further Overlay changes

-implemented ops::BitAnd for AllowedSplits
-when trying to drop a tab on an empty surface, only the insert button will be shown

* Hold time for overlay lock

replaced lock in hoverdata with an ``Option<Instant>`` to allow for a user specified max hold time before the overlay may switch to another node if a node from another surface is above it

* faded windows first part

* Fading windows part 2

windows now fade whenever a surface that isn't theirs is being hovered

* Removed Fade Animation

removed the fading animation for windows and relevant style fields

* Hightlighting rect on hovered leaves

dragged tabs now show a highlight rect on the leaf theyre about to be dropped on
small changes have been made to examples and new methods which existed for tree but not dock state has beeen implemented for dock state

* Formatting; partial highlighting of overlay icons for better target indication

* Cleanup and fix clippy warnings

* Fix tests

* Dedicated button color fields for overlay buttons

Added ``button_color`` and ``button_border``stroke`` to overlaystyle, as well as slightly changed the documentation to be more accurate and consistent

* Fix overlay icon proportions

* Cleanup, rename `allow_in_windows` to `allowed_in_windows`, eject context menu option pt. 1

* Small clarity change to hover data

* changes to old overlay and hello example

this is one of several parts in chaning the old overlay to match the new needs of egui_docks. as well as starting to make changes to the hello example to inclulde the new overlay options.

* changes to hello example and overlay style

made changes to hello example to include more parameters from the overlay style and divided overlay style into style and feel

* refactoring HoverData

This is the first part in refactoring HoverData to fit the new ergonomics of the crate, this commit introduces DragAndDropState, which carries info which isn't relevant to HoverData or DragData, this commit doesn't change behavior in any way for egui_dock, however a future commit probably will

* Close context menu upon clicking on one of the options

* Only show the 'Eject' option for docked tabs

* Minor refactorings

* Quick fix to window fade

fixed window fade problem introduced during hoverdata refactor

* Second hotfix for new HoverData

this hotfix addresses the problems with stolen focus, as well as a bug with the drag and drop of tabs

* refining fix to nodes stealing focus

this commit fixes the problem with nodes stealing focus they aren't supposed to, as it previously didnt allow for focus to be switched while interacting with a widget that consumes clicks or drags.

* Make tab windows movable by dragging from any point in the tab body

* Minor cleanup

* Reworking Hoverdata part 2

this commit is meant to finish the rework of hoverata (with some polishing still needing to be done)

also includes a couple of refactors in order to declutter the dock_area module

* Polishing overlay

fixed certain edgecases and polished the overlay

* Changes to overlay

changed the way dropping a tab in its original node behaves

* update to Highlighted areas overlay

changes how the highlighted areas overlay behaves on same node drags to be consistent with the icon based overlay

* Window bounds, finished hello example

Changed hello example to reflect the entirety of ``OverlayStyle``
added the option to put a bound on where windows can reside, being restricted to the screen rect by default.
-moved selection_color
-added a from_egui method for OverlayStyle

* correction of documentation

corrects part of documentation for dock area

* Correct typos in examples/hello.rs

* Make clippy happy and clean up comments&documentation.

* Fix rustfmt errors

* Fix doc errors

* improved documentation

this commit updates some of the documentation to include examples and further details about certain methods, and will be one of many to come in very high likelyhood

* Consistency changes, improved documentation

-More examples in documentation
-Clarifications in documentaion
-Removed ``root_..`` methods
-renamed "root surface" to "main surface"

* removed unneccesary links

removed unneccesary bool links

* Improve documentation in lib.rs

* Make `Node::split` panic if `fraction` isn't in range 0..=1

* Reformat

* Write more about surfaces and trees

* Fix doc test

* Clarifications in the docs

* Add a section about `style`

* Polishing `style`

* Documentation grooming

* Make clippy happy

* Fix cargo doc errors

* Update changelog

* added buttons to windows (+setting) restructured dock area

this commit restructures the contents of `DockArea` so that mod.rs isn't a 1000+ line behemoth. As well as adding collapse and close buttons to window surfaces.

* updated changelog, hello example, and window behavior

this commit fixes the behaviour where windows are collapsed by default, as well as updates the changlog to include the "show window heads" setting and a checkbox in the hello example to showcase the feature

* updated behaviour to windows

- added seperate settings for close and collapse buttons on windows.
- shows title of selected node when collapsed

* fixed oversights

slight code restructure to windows as well as an oversight where the wrong fields was used

* Update readme

* final touches

final touches on windows

* Disable closing non-closeable tabs with middle click

* Update changelog

* changed sizes on window titles

changed window titles to appear with the same style as tab titles

* Fix clippy errors

* Fix docs

---------

Co-authored-by: Adanos020 <[email protected]>
* Update mod.rs

* update tab's scroll

* update tab's scroll

* fix cargo fmt

* update scroll mode for every tab

* update scroll mode for every tab

* update scroll mode for every tab

---------

Co-authored-by: Adam Gąsior <[email protected]>
…ex (Adanos020#167)

* Make `TabViewer::{on_add,add_popup}` accept corresponding surface index

* Fix `TabViewer::context_menu` while I'm at it

* Update changelog

* Fix examples
@Adanos020 Adanos020 changed the base branch from main to release-0.7 August 28, 2023 13:49
@Adanos020 Adanos020 marked this pull request as draft September 18, 2023 16:08
@Adanos020 Adanos020 changed the base branch from release-0.7 to release-0.8 September 18, 2023 17:28
@Adanos020 Adanos020 changed the base branch from release-0.8 to release-0.9 September 28, 2023 19:36
@Adanos020 Adanos020 deleted the branch Adanos020:release-0.13 November 23, 2023 20:09
@Adanos020 Adanos020 closed this Nov 23, 2023
@Adanos020 Adanos020 reopened this Nov 25, 2023
@Adanos020 Adanos020 changed the base branch from release-0.9 to release-0.10 November 25, 2023 21:59
@Adanos020 Adanos020 changed the base branch from release-0.10 to release-0.11 February 1, 2024 14:42
@Adanos020 Adanos020 changed the base branch from release-0.11 to release-0.12 February 6, 2024 19:44
@Adanos020 Adanos020 deleted the branch Adanos020:release-0.13 April 5, 2024 20:51
@Adanos020 Adanos020 closed this Apr 5, 2024
@Adanos020 Adanos020 reopened this Apr 5, 2024
@Adanos020 Adanos020 changed the base branch from release-0.12 to release-0.13 April 5, 2024 20:56
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.

None yet

8 participants