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

Different design: more compact windows and collapsing/closing control on each tab bar #237

Merged
merged 36 commits into from
Oct 19, 2024

Conversation

micfong-z
Copy link
Contributor

@micfong-z micfong-z commented May 13, 2024

Resolves #238. See the issue for a full discussion of this design.

Here's a list of technically missing features in this PR, but I'd like to hear some opinions before carrying on ;)

  • Proper styling (especially rounding)
    • After careful checking of the design, this should be done on the user side.
  • Dragging tabs to an empty space on the main surface (fd805c9, ccce02f)
  • Dragging tabs to a collapsed Leaf (fd805c9, ccce02f)
  • Proper CHANGELOG (370e477)
  • Update examples (6e56846)

@micfong-z
Copy link
Contributor Author

This should be feature-complete and bug-free AFAIK.

@micfong-z micfong-z marked this pull request as ready for review May 23, 2024 09:31
@Adanos020 Adanos020 changed the base branch from release-0.13 to release-0.14 July 3, 2024 18:30
@Adanos020
Copy link
Owner

Hi, sorry for the massive delay! My irl stuff has been insane in the last couple of months.

I think the features you've added are great, although I think having a button that lets you collapse a whole window (which we lost in this PR) would be really nice to have. Can we add it back?

I've fixed up a few things following the release of 0.13 and rebasing to the next release branch. Let me know if there's anything I could help you with.

Ved-s and others added 4 commits July 3, 2024 20:44
* remove Clone bound on map_tabs and filter_map_tabs

* remove Clone bound from all functions with Clone + FnMut bounds

* Update changelog

* Add missing period in changelog

---------

Co-authored-by: Adanos020 <adanos020@gmail.com>
@micfong-z
Copy link
Contributor Author

micfong-z commented Jul 4, 2024

I think having a button that lets you collapse a whole window (which we lost in this PR) would be really nice to have.

I'd be glad to add this feature, but I'm not fully certain how this should be designed. Should collapsing a whole window be:

  • a shortcut that simply collapses all leaf subnodes (i.e. the collapsed window may still have multiple tab bars), or
  • a feature that turns the window into a dedicated state that only have a single line (so really compact)?
    • if this is preferred, what should be displayed on the single line? Active node name like the original design, or just a simple count label like "3 tabs, 2 leafs", or anything better?

@micfong-z
Copy link
Contributor Author

micfong-z commented Jul 9, 2024

@Adanos020 I've implemented this feature like this:

Recording.at.2024-07-10.01.04.44.mp4

So essentially all features available in the original design is now in the right-click context menu of the relevant buttons.

I named this feature minimizing a window, to avoid frequent confusions with collapsing a node in the codebase. Let me know if there's a better way to name this ;)

@Adanos020
Copy link
Owner

@micfong-z This looks good, although it isn't immediately obvious that you can right-click on the buttons. I reckon a tooltip on each button could help with that.

@micfong-z
Copy link
Contributor Author

micfong-z commented Jul 10, 2024

@Adanos020 Done – I've also fixed cargo test. I reckon another design of activating these features by shift-clicking (or ctrl/alt/...-clicking?) the buttons might be possible, but I'm not really sure if this applies well to different keyboard layouts, or* if this is even more obscured.

*: I just checked the way how egui handles modifier keys. This shouldn't be a problem now.

@Adanos020
Copy link
Owner

That sounds good, I'd say let's come up with a few designs and let the library users choose.

One design I've been thinking of is to have separate buttons for windows, but make them look like little bookmarks behind the window (or the tab bar) that'll pull out when you hover over them. How does that sound?

@micfong-z
Copy link
Contributor Author

micfong-z commented Jul 11, 2024

That design sounds brilliant! Though I would have to dig deep enough to figure out a way to display some sort of floating panels behind windows. AFAIK, since all Areas in egui are rectangular, these floating panels may mean introducing two auxiliary windows for each window.... I'll give it a try anyways :/

Edit: could tooltip/menu implementations help?

@micfong-z
Copy link
Contributor Author

micfong-z commented Oct 14, 2024

Sorry for not being active on this PR recently due to ... irl stuff ( :( ) – but I think I've caught up a bit.

For now I have implemented the two options I've mentioned for the user to choose (modifier key method and context menu method), but I've been really struggling to get the bookmark button method done.

I have experimented with creating new Areas, tweaking Tooltips, or even creating auxiliary Windows, but all of them have issues with at least one of focusing, anchoring and layering. ChatGPT and Googling didn't help (of course), and the codebase and changelog is getting a bit messy.

I'd be happy to carry on experimenting if someone could give me some directions to work on. Nevertheless, this feature could probably be put in a separate PR instead considering its complexity.

@Adanos020 if creating a separate PR for this specific issue is okay, I'll go on finalizing/cleaning up the codebase then!


Edit: I'll layout the issues I've encountered so far.

  • Area and Window (same thing under the hood): focusing and layering issues. I couldn't figure out a way to programmatically shift the auxiliary window holding the buttons to the layer "just after the window that has been hovered on", without a change to nearly everything. Anchoring went well.
  • Tooltip: well firstly it appears above the window. Plus for some reason setting tooltip delay (ideally to 0) had no effect. Anchoring is also quite difficult in this case.

@Adanos020 Adanos020 changed the base branch from release-0.14 to release-0.15 October 14, 2024 16:45
@Adanos020
Copy link
Owner

Hey, no worries at all, I've also been dealing with lots of personal issues because of which I didn't have much time to dedicate to this project. Thanks for coming back to this PR!

If the bookmark button is too big of a pain to implement, then I'd say let's drop it for now. We can make do with the current designs.

@micfong-z
Copy link
Contributor Author

@Adanos020 Everything is good to go now (from my side), but I'll point out a few possible caveats

  • the translation examples in lib.rs are translated from an online service, so no guarantee that they would be fully correct
  • I used the term "leaf" for ... Leafs on user-side tooltips. Not sure if this would be confusing.

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.

I think this is good to go! The machine translations aren't bad, I just made some changes for consistency's sake.

Thank you for working on this :)

@Adanos020 Adanos020 merged commit cb5f470 into Adanos020:release-0.15 Oct 19, 2024
4 checks passed
@micfong-z
Copy link
Contributor Author

Thanks for merging! A side note for consistency in JP translations: the lines ending with (CN/JP full stop) are all tooltip texts, so keeping them at the end is more consistent with English/Polish translations.

However, as per Material Design Guidelines, the full stops should not follow single-sentence tooltip texts. Maybe remove all full stops in translations would be good.

@Adanos020 Adanos020 mentioned this pull request Dec 28, 2024
@Adanos020 Adanos020 added enhancement New feature or request 0.15.0 and removed enhancement New feature or request labels Dec 28, 2024
Adanos020 added a commit that referenced this pull request Dec 28, 2024
* Different design: more compact windows and collapsing/closing control on each tab bar (#237)

* Correct comment typos

* Add two buttons on tab bars

- Close all tabs: "×"
- Collapse all tabs: "▼"

* Add some utility for recursive node collapse checking

* Preliminary implementation of collapsing windows

* Handle tab collapsing layout

* Resize windows when subnodes collapsed

* Implements leaf close all button

* Update changelog

* Allow dragging to a collapsed leaf

* Fix collapsed state checking after dnd splits

* Update examples

* Update changelog

* Fix up changelog after rebase

* Fix failing test and rename `Translations::window` to `Translations::leaf`.

* Remove `Clone` bound on `map_tabs` and `filter_map_tabs` (#241)

* remove Clone bound on map_tabs and filter_map_tabs

* remove Clone bound from all functions with Clone + FnMut bounds

* Update changelog

* Add missing period in changelog

---------

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

* Update crate version and add MSRV change to changelog

* Fix heading type in changelog

* Fix tab bar scroll bar width on window surfaces

* Add close window button in context menu

* Add minimize window button

* Update CHANGELOG.md

* Fix cargo test

* Add tooltips to right-clickable tab bar buttons

* Add minimization activation with modifiers

* Add close window with modifiers

* Correct tooltip display conditions

* Upgrade to egui 0.29

* Add secondary button feature toggle

* Cleanup code

* Update examples

* Fix cursor icon logic

* Update examples

* Update changelog

* Make Japanese translations in the example more consistent with each other

---------

Co-authored-by: Adanos020 <adanos020@gmail.com>
Co-authored-by: Ved_s <vedomir.samarin.03@gmail.com>

* Egui 0.30 (#255)

* Egui 0.30

* Upgrade to egui 0.30.

* Update changelog and readme

* Update the crate version in Cargo.toml

* Fix winit compile error

* Make Clippy happy

---------

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

---------

Co-authored-by: Michael Zhang <micfong2@outlook.com>
Co-authored-by: Ved_s <vedomir.samarin.03@gmail.com>
Co-authored-by: Bryce Berger <bryce.z.berger@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants