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

Release 0.7 #181

Merged
merged 31 commits into from
Sep 18, 2023
Merged

Release 0.7 #181

merged 31 commits into from
Sep 18, 2023

Conversation

Adanos020
Copy link
Owner

This is the biggest update so far, introducing the long awaited undocking feature: tabs can now be dragged out into
new egui windows. Massive thanks to Vickerinox for implementing it!

This update also includes an overhaul of the documentation, aiming to not only be more readable and correct, but also
provide a guide of how to use the library.

Changed

  • Adjusted the styling of tabs to closer follow the egui default styling. (#139)
  • Double-clicking on a separator resets the size of both adjacent nodes. (#146)
  • Tabs can now only be dragged with the primary pointer button (e.g. left mouse button). (#177)

Fixed

  • Correctly draw a border around a dock area using the Style::border property. (#139)
  • Non-closable tabs now cannot be closed by clicking with the middle mouse button. (9cdef8c)
  • Dragging tabs around now works on touchscreens. (#180)

Added

  • From #139:
    • Style::main_surface_border_rounding for the rounding of the dock area border.
    • TabStyle::active for the active style of a tab.
    • TabStyle::inactive for the inactive style of a tab.
    • TabStyle::focused for the focused style of a tab.
    • TabStyle::hovered for the hovered style of a tab.
    • TabStyle::tab_body for styling the body of the tab including background color, stroke color, rounding and inner margin.
    • TabStyle::minimum_width to set the minimum width of the tab.
    • TabInteractionStyle to style the active/inactive/focused/hovered states of a tab.
  • AllowedSplits enum which lets you choose in which directions a DockArea can be split. (#145)
  • From #149:
    • DockState<Tab> containing the entire state of the tab hierarchies stored in a collection of Surfaces.
    • Surface<Tab> enum which represents an area (e.g. a window) with its own Tree<Tab>.
    • SurfaceIndex to identify a Surface stored in the DockState.
    • Split::is_tob_bottom and Split::is_left_right.
    • TabInsert which replaces current TabDestination (see breaking changes).
    • impl From<(SurfaceIndex, NodeIndex, TabInsert)> for TabDestination.
    • impl From<SurfaceIndex> for TabDestination.
    • TabDestination::is_window (see breaking changes).
    • Tree::root_node and Tree::root_node_mut.
    • Node::rect returning the Rect occupied by the node.
    • Node::tabs and Node::tabs_mut returning an optional slice of tabs if the node is a leaf.
    • WindowState representing the current state of a Surface::Window and allowing you to manipulate the window.
    • OverlayStyle (stored as Style::overlay) and OverlayFeel: they specify the look and feel of the drag-and-drop overlay.
    • OverlayType letting you choose if the overlay should be the new icon buttons or the old highlighted rectangles.
    • LeafHighlighting specifying how a currently hovered leaf should be highlighted.
    • DockArea::window_bounds setting the area which windows are constrained by.
    • DockArea::show_window_close_buttons setting determining if windows should have a close button or not.
    • DockArea::show_window_collapse_buttons setting determining if windows should have a collapse button or not.
    • TabViewer::allowed_in_windows specifying if a given tab can be shown in a window.
  • TabViewer::closable lets individual tabs be closable or not. (#150)
  • TabViewer::scroll_bars specifying if horizontal and vertical scrolling is enabled for given tab – replaces DockArea::scroll_area_in_tabs (see breaking changes). (#160)
  • Translations specifying what text will be displayed in some parts of the DockingArea, e.g. the tab context menus (defined in TabContextMenuTranslations). (#178)

Breaking changes

  • From #139:
    • Moved TabStyle::inner_margin to TabBodyStyle::inner_margin.
    • Moved TabStyle::fill_tab_bar to TabBarStyle::fill_tab_bar.
    • Moved TabStyle::outline_color to TabInteractionStyle::outline_color.
    • Moved TabStyle::rounding to TabInteractionStyle::rounding.
    • Moved TabStyle::bg_fill to TabInteractionStyle::bg_fill.
    • Moved TabStyle::text_color_unfocused to TabStyle::inactive.text_color.
    • Moved TabStyle::text_color_active_focused to TabStyle::focused.text_color.
    • Moved TabStyle::text_color_active_unfocused to TabStyle::active.text_color.
    • Renamed Style::tabs to Style::tab.
    • Removed TabStyle::text_color_focused. This style was practically never reachable.
  • From #149:
    • TabDestination now specifies if a tab will be moved to a Window, a Node, or an EmptySurface. Its original purpose is now served by TabInsert.
    • Tree::split now panics if supplied fraction is not in range 0..=1.
    • Moved Tree::move_tab to DockState::move_tab.
    • Renamed Style::border to Style::main_surface_border_stroke.
    • Moved Style::selection_color to OverlayStyle::selection_color.
    • DockArea::new now takes in a DockState instead of a Tree.
  • Removed DockArea::scroll_area_in_tabs – override TabViewer::scroll_bars instead. (#160)
  • Methods TabViewer::{context_menu,on_add,add_popup} now take in an additional SurfaceIndex parameter. (#167)

LennysLounge and others added 30 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 <adanos020@gmail.com>
* 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 <adanos020@gmail.com>
* Allow individual tabs to be closable or not

This fixes #113

* Fix clippy warning

---------

Co-authored-by: Adam Gąsior <adanos020@gmail.com>
* 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 <adanos020@gmail.com>
* 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 <adanos020@gmail.com>
…ex (#167)

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

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

* Update changelog

* Fix examples
fixes the bug addressed in #168, by always ignoring window hovers when dragging a non window tab.
* Fix for issue #174 (removed instant)

fixes issue #174 by removing the use of ``Instant`` inside the drag/drop state. since it's not allowed on wasm.

* ran cargo fmt

ran cargo fmt on last commit.

* finishing touches

fixed ``widnow_fade`` which also made use of ``Instant``
fixes the bugs discussed in the discord egui_dock channel
* First working implementation of translations

* API change

* Remove unnecessary imports of `Translations`

* Clean up

* Update changelog, rename one of the translations structs

* Add guide section about translations
* Fix hover_pos on touch screens

* Rename to last_hover_pos & replace all occurrences

* Reorder state assignment in show_inside
@Adanos020 Adanos020 merged commit f8c6e6b into main Sep 18, 2023
8 checks passed
@Adanos020 Adanos020 deleted the release-0.7 branch September 18, 2023 17:29
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

7 participants