Skip to content

Commit

Permalink
Release 0.7 (#181)
Browse files Browse the repository at this point in the history
* Expand styling options for tabs (#139)

* 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

* feat: double click on separator to reset size (#146)

* Update egui version in badge

* fix: typo

* feat: double click to reset resizing

---------

Co-authored-by: Adanos020 <adanos020@gmail.com>

* Update version number and changelog

* feat: allow disabling vertical/horizontal splits (#145)

* 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>

* Rename `SplitTypes` to `AllowedSplits`. Update changelog.

* Allow individual tabs to be closable or not (#150)

* Allow individual tabs to be closable or not

This fixes #113

* Fix clippy warning

---------

Co-authored-by: Adam Gąsior <adanos020@gmail.com>

* Remove blank space where the close button is not enabled (#153)

* Add the NodeIndex to context_menu() parameter list (#157)

* Add the NodeIndex to context_menu() parameter list

* Adapt contex_menu() in hello example

* Support for undocking and docking tabs as windows (#149)

* 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>

* pdate tab's scroll

* update tab's scroll

* update scroll mode for every tab

* update scroll mode for every tab

* update scroll mode for every tab

* Finish up rebase

* Reformat

* Enable/disable scroll bars on individual tabs. (#160)

* 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>

* Reformat

* Update changelog and contribution guide

* Make `TabViewer::{on_add,add_popup}` accept corresponding surface index (#167)

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

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

* Update changelog

* Fix examples

* Fix bug #168 (#171)

fixes the bug addressed in #168, by always ignoring window hovers when dragging a non window tab.

* Fix for issue #172 (#173)

* Minor clarifications to documentation and changelog

* Add `serde` attributes to `DockState` and all types stored in it

* Make `DockState` and types related to it debugable

* Fix for issue #174 (#176)

* 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 to small bugs (#177)

fixes the bugs discussed in the discord egui_dock channel

* Translations (#178)

* 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 (#180)

* Fix hover_pos on touch screens

* Rename to last_hover_pos & replace all occurrences

* Reorder state assignment in show_inside

* Update changelog

* New demo GIF

---------

Co-authored-by: Leonard Schüngel <schuengel.leonard@gmail.com>
Co-authored-by: zkldi <zkldi.dev@gmail.com>
Co-authored-by: Peter Kristensen <peter@ptx.dk>
Co-authored-by: 12089897411 <108512675+12089897411@users.noreply.github.com>
Co-authored-by: ToppDev <dev@topp.cc>
Co-authored-by: Vikrinox <51887867+Vickerinox@users.noreply.github.com>
Co-authored-by: 12089897411 <13019317170@163.com>
  • Loading branch information
8 people committed Sep 18, 2023
1 parent 03e5a66 commit f8c6e6b
Show file tree
Hide file tree
Showing 37 changed files with 4,605 additions and 1,406 deletions.
79 changes: 79 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,84 @@
# egui_dock changelog

## 0.7.0 - 2023-09-18

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](https://github.com/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](https://github.com/Adanos020/egui_dock/pull/139))
- Double-clicking on a separator resets the size of both adjacent nodes. ([#146](https://github.com/Adanos020/egui_dock/pull/146))
- Tabs can now only be dragged with the primary pointer button (e.g. left mouse button). ([#177](https://github.com/Adanos020/egui_dock/pull/177))

### Fixed

- Correctly draw a border around a dock area using the `Style::border` property. ([#139](https://github.com/Adanos020/egui_dock/pull/139))
- Non-closable tabs now cannot be closed by clicking with the middle mouse button. ([9cdef8c](https://github.com/Adanos020/egui_dock/pull/149/commits/9cdef8cb77e73ef7a065d1313f7fb8feae0253b4))
- Dragging tabs around now works on touchscreens. ([#180](https://github.com/Adanos020/egui_dock/pull/180))

### Added

- From [#139](https://github.com/Adanos020/egui_dock/pull/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](https://github.com/Adanos020/egui_dock/pull/145))
- From [#149](https://github.com/Adanos020/egui_dock/pull/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](https://github.com/Adanos020/egui_dock/pull/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](https://github.com/Adanos020/egui_dock/pull/160))
- `Translations` specifying what text will be displayed in some parts of the `DockingArea`, e.g. the tab context menus (defined in `TabContextMenuTranslations`). ([#178](https://github.com/Adanos020/egui_dock/pull/178))

### Breaking changes

- From [#139](https://github.com/Adanos020/egui_dock/pull/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](https://github.com/Adanos020/egui_dock/pull/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](https://github.com/Adanos020/egui_dock/pull/160))
- Methods `TabViewer::{context_menu,on_add,add_popup}` now take in an additional `SurfaceIndex` parameter. ([#167](https://github.com/Adanos020/egui_dock/pull/167))

## 0.6.3 - 2023-06-16

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Bug reports should include how to reproduce said bug, if known.
## Pull requests

1. Fork this repository.
2. In your fork create a branch for your changes – do **not** submit directly to `main`.
2. In your fork create a branch for your changes – do **not** submit directly to `main` or `release-0.x`.
3. Make your changes and open a pull request.
- If your changes are not complete but e.g. you want feedback on your idea before fully committing to it, open a draft PR.
- Otherwise, feel free to open a regular PR.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "egui_dock"
description = "Docking support for `egui` - an immediate-mode GUI library for Rust"
authors = ["lain-dono", "Adam Gąsior (Adanos020)"]
version = "0.6.3"
version = "0.7.0"
edition = "2021"
rust-version = "1.65"
license = "MIT"
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,34 @@
[![docs.rs](https://img.shields.io/docsrs/egui_dock)](https://docs.rs/egui_dock/)

Originally created by [@lain-dono](https://github.com/lain-dono), this library provides docking support for `egui`.
It lets you open and close tabs, freely move them around, insert them in selected parts of the `DockArea`, and resize them.

## How to contribute

Feel free to open new issues and pull requests.
## Contributing

Before contributing, please read [the contribution guide](CONTRIBUTING.md).

This library is a collaborative project developed with direct involvement of its users.

Please feel free to open new issues and pull requests, and participate in discussions!
A lot of our discussions take place on [`egui`'s official Discord server](https://discord.gg/JFcEma9bJq),
in the `#egui_dock` channel.

## Features

- Opening and closing tabs.
- Moving tabs between nodes and resizing.
- Dragging tabs out into new `egui` windows.
- Highly customizable look and feel.
- High degree of control over behaviour of the whole dock area and of individual tabs.
- Manipulating tabs and dock layout from code.

## Quick start

Add `egui` and `egui_dock` to your project's dependencies.

```toml
[dependencies]
egui = "0.22"
egui_dock = "0.6"
egui_dock = "0.7"
```

Then proceed by setting up `egui`, following its [quick start guide](https://github.com/emilk/egui#quick-start).
Expand Down
Loading

0 comments on commit f8c6e6b

Please sign in to comment.