-
Notifications
You must be signed in to change notification settings - Fork 76
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
Panels - nodes that are not movable, holding only one tab at a time #164
base: release-0.15
Are you sure you want to change the base?
Panels - nodes that are not movable, holding only one tab at a time #164
Conversation
* 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
…he tabs, I now want to expand the functionality to I can only show the labels on specific tabs
…bel on a node, Also ensured that if a node that was going to be set to hide the label it would only accept one Tab, as it doesn't make much sense to have multiple tabs if you can't switch between them
… created with split_single
… that do not support labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that we need all the split_*_single
and leaf_with_single
methods. They don't do anything special and have the exact same effect as just passing a Vec
with a single tab in it to a split_*
method.
Having more than one way to achieve the same effect makes the API more confusing to use and therefore I'd get rid of these functions.
I need to think more about the show_label_bar
stuff as something doesn't seem right there, it's probably just the naming.
Looking through the changes so far I think it would be better if the implementation relied on a new kind of node (perhaps something like Ideally any sort of functionality you wish to have (such as restricting a node to only one tab) should be reinforced by the Im also not fond of the idea of being able to disable all nodes from having their tab bars disabled via However it's decided that this implementation should move forward i would highly recommend considdering how future features may come into play, eg. by generalising |
hey @Adanos020 I can remove the show_label_bar option, don't need it for my use case, just put it in initially to help me follow the code and agree with the comments from @Vickerinox that when turned on it's really just reproducing the native egui functionality. i'm currently using the leaf_with_single calls to set the additional hide_label prop on the node - which is then used in the show_inside method to prevent showing the label bar on the node. happy to explore the other option @Vickerinox of creating a different node type, like Node::Single let me know if you'd be interested in me moving forward with this other approach? |
Once we switch to the enum InsertTabs<Tab> {
Panel(Tab),
Leaf(Vec<Tab>),
} which could be passed to the |
ok, I'll see what I can do - i'll hopefully get an opportunity to have a look at it over the next couple of weeks. |
Changing this to a draft as the implementation needs redesigning and probably won't make it to 0.7. |
ed990ed
to
c2066c5
Compare
I'd like to use the doc control for side bars and bottom bars on my app, to allow users to drag and drop the tabs between these sections.
I have a middle Node that i'm creating that I'd prefer if users couldn't drag it or drop other tabs from other nodes into this tab.
i've added a function to DockArea that allow me to set that no tab labels should be shown - this isn't particularly useful in my use case, as it really prevents the ability to see more than one tab in any node - or drag any of them anywhere.
I've made a couple of changes to enable this functionality,
i've added a prop on Node::Leaf hide_label that allow one to set if they what that node to hide the labels - if there are no labels showing it prevents the ability to drag the tab in the node, and i've also used the same setting to prevent dropping other tabs into the node.
to enble this on a node, i've create the additional functions split_left_single... which only accepts a single tab and creates the Node:Leaf with hide_label set to true.