32 Commits
Author SHA1 Message Date
Paul Hansen fada946406 Fix style editor in hello example (#104) 2023-02-11 12:24:59 +00:00
Luc (Echow) Varoqui 9e07a4b7a9 Use available_rect_before_wrap() in DockArea::show_inside (#102) 2023-02-10 15:47:59 +00:00
Emil Ernerfeldt 66d9dd5773 Update to egui 0.21.0 (#93)
* WIP: update to latest egui

* Update egui git hash

* Update examples

* Example style editor: make color pickers into popups

* Nicer style editor

* Simplify the tab painting, and make it look better

* simplify code

* Add hline_color

* Add ability to control text color of active tabs

* Document Node::Lead

* Derive clone

* Code cleanup

* Bug fix: show grab cursor preview when hovering a tab

* Add TabViewer::on_tab_button to let users listen for clicks etc

* use same resize colors as egui

* Update to egui 0.21.0

* Don't force default_fonts onto users of egui_dock

* Update changelog
2023-02-09 10:27:41 +00:00
Emil Ernerfeldt 37ebb29442 More customaizable tabs (#94)
* Example style editor: make color pickers into popups

* Simplify the tab painting, and make it look better

* simplify code

* Add hline_color

* Add ability to control text color of active tabs

* By default, connect the tab name and the tab contents

* Fix doclink

* Code cleanup

* Bug fix: show grab cursor preview when hovering a tab

* Make response mut
2023-02-04 20:06:47 +00:00
Adam Gąsior bc489166c9 Fix clippy errors in examples (#89)
- Replace `Box::new(MyApp::default)` with `Box::<MyApp>::default()`
2022-12-31 20:13:03 +00:00
An TranandAdanos020 02f549c476 Style option to change tab bar height (#62)
* Added option to change tab bar height

* Make add button consistent size

* Add `tab_bar_height` and `show_add_buttons` to Style Editor

* Resize add button click area

* Fix changelog

Co-authored-by: Adanos020 <adanos020@gmail.com>
2022-12-11 19:35:36 +00:00
5073eb4bf5 Added ability to remove tab (using logic from render) (#70)
* Added ability to remove tab (using logic from render)

* Simplify `Tree::remove_Tab`

* Updated changelog, added view menu to 'hello' example to demonstrate tabs that can be toggled with remove_tab/push_to_focused_leaf

* Documented remove_tab function, fixed clippy issues

Co-authored-by: Andrew J Westlake <awestlake87@yahoo.com>
Co-authored-by: Adanos020 <adanos020@gmail.com>
2022-11-28 10:42:02 +00:00
Emil Ernerfeldt 5f6a431841 Change separator color on hover and drag (#68)
* Change separator color on hover and drag

* Document what Style::from_egui does

* Update changelog

* Replace glob `use` statements with specific imports
2022-11-16 11:08:34 +00:00
Past9 c8a2aceab7 Implement add popups (#63)
* Implement add popups

* Fix clippy errors
2022-11-08 12:49:43 +00:00
Adam Greig 32de0e0871 Fix combining 'expand tabs' and 'show add tab button' (#65) 2022-11-08 12:24:44 +00:00
An TranandAdanos020 645c621ec0 Tab Add button (#43)
* Reset to upstream/main

* Fix alignment options

* Apply requested changes

* Add simple example

* Remove unnecessary import in example

* Formatting

Co-authored-by: Adanos020 <adanos020@gmail.com>
2022-11-02 21:35:53 +00:00
Adam Gąsior ae1907505c Deprecate dynamic_tab (#55)
* Deprecate everything in dynamic_tab.rs

* Delete the 'traits' example

* Update CHANGELOG.md
2022-10-18 20:29:51 +01:00
Jacob d53d27963a added hover shows tab name when style enabled (#56)
* added hover shows tab name when style enabled

* run cargo fmt

* Update Changelog and typo
2022-10-16 18:57:59 +01:00
Jacob 5f5a877a34 Make ScrollArea optional via Style (#49)
* Make ScrollArea optional via Style

* run cargo fmt

* removed space for scroll area when dissabled
2022-10-06 21:58:39 +01:00
Jacob 270794c766 Added basic context menus (#46)
* Added basic context menus

* Added a default close option in the context menu

* changed the example a bit

* removed useless format!

* added show_context_menu to Style and StyleBuilder, changed example and fixed typo

* Changed documentation

* minor formating changes
2022-10-04 10:04:41 +01:00
Adam Greig b12993a331 Add option to expand tabs to fill the tab bar. (#45) 2022-09-30 18:03:45 +01:00
Adanos020 69cb6a7a25 Expand 'Style Editor' in hello example 2022-09-18 18:37:45 +01:00
Adanos020 7a411b5a19 Add possibility to disable dragging tabs - Closes #39 2022-09-18 18:20:56 +01:00
Adanos020 5d6c61f85f Show content of all tabs in ScrollAreas, add adjustable inner margins. 2022-09-02 21:04:26 +01:00
Adanos020 0688793d8d Refactor the 'hello' example 2022-09-02 20:50:07 +01:00
Emil Ernerfeldt e7be2a1cce Refactor: TabViewer (#24)
* Refactor: TabViewer

* Fix examples

* buildfix

* Implement Default for all Tree:s

* Fix doclinks and main example

* Remove example from README.md

Better to just have the one in the docs, which is tested

* Update changelog

* Document `fn find_tab`

* Expand changelog
2022-09-02 07:34:14 +01:00
Guillaume Anthouard 2fb824889e Change DockArea api to look a bit more like other egui containers (#23)
* Transform `DockArea` api to look a bit more like other egui containers

* Requested changes
2022-08-29 20:03:59 +01:00
Parker TenBroeckandAdanos020 333f6dc4a2 Added the ability to close tabs (#22)
* added ability to close and insert tabs

added option to have a close tab button.
the tab binary tree will keep track of the current "focused" leaf.
adding new tabs will automatically insert them into the currently focused leaf and select them.

* made DockArea to prevent invalidation of Tree

* changed default closing behavior

made it so tabs will always close when the user presses the close button by default

* Updated Documentation and TabBuilder

* Replace Option::Some with Some and Option::None with None

* Code Updates/Fixes

replaced lines 303-308 in src/lib.rs with updated code

replaced lines 195-206 in src/style.rs with updated code

replaced lines 247-253 in src/style.rs with updated code

* fixed formatting

* Documentation / Examples / Fix

Added documentation for DockArea.

Updated CHANGELOG.md

Updated README.md

added an example for using the Tab trait directly

Clarified / updated documentation / comments

Changed it so tab.force_close is called after tab.ui

Added ui.push_id to prevent tabs from having id clashes

* resolved clippy error

* Apply requested changes

* Add `Style` to imports in code example.

Co-authored-by: Adanos020 <adanos020@gmail.com>
2022-08-26 16:18:03 +01:00
Guillaume Anthouard b7ceff999d Replace WithTitle trait with impl Into<WidgetText> (#20)
* Bump egui to 0.19

* Replace `WithTitle` trait with `impl Into<WidgetText>`
2022-08-20 21:40:03 +01:00
Adam Gąsior a1c508a281 Fix docs (#16)
* Import `WithTitle`, use `RichText` in the Usage section.

* Update README.md

* Fix `simple` example.

* Attempt fixing docs error by calling `egui::__run_test_ui`.

* Add missing variables.

* Update README.md again
2022-08-14 20:32:42 +01:00