FlexLayout
FlexLayout copied to clipboard
[Improvement] Ability to specify size for a tab
Hi,
I've been using your library in a new web app these days, and it's great, thank you!
Anyway, I think it would be useful if the provided api allowed to specify a default size for a given tab, when adding it to the layout. Think for example in a graph tab, or a file explorer tab, that below a minimum size make no sense, and above it they just don't look nice.
In the same way, it would also be useful to set a minimum size. Some of those tabs can't be correctly shown if their size is below a given number.
Thanks in advance
Hi, thanks for the suggestion,
I will look to add this to the next update
Hi! I like the layout Component very much!
Being able to set both minimum and maximum size for a tab would be nice, to lock its size.
I wanted to create something like a Status-Bar at the bottom of the screen, but I couldn't find a way to restrict risizing with the Splitter right above it. So it would be nice if something like minHeight
, maxHeight
, minWidth
and maxWidth
allowed the tabset with the StatusBar component to be fixed in size.
What i tried:
My Clobal Configuration:
global: {
tabEnableRename: false,
tabSetEnableMaximize: false,
enableEdgeDock: false,
tabEnableClose: false
},
The Tabset I used for this at the bottom of the screen:
{
type: "tabset",
children: [
{
type: "tab",
name: "statusbar",
component: "StatusBar"
}
],
height: 30,
enableTabStrip: false,
enableDivide: false,
enableDrop: false,
enableDrag: false
}
Maybe I am just missing something. :-)
Hi, secoding this request, since tabs can be freely moved by the user between tabsets then it would be helpful to to be able to set the tab minimum size.
I will likely need to do this for my use case so will raise a PR if I do manage it.
A few design questions spring to mind:
- If a user trys to drag or otherwise add a tab to a tabset that is smaller than its minimum size - what happens?
- Prevent add/drop?
- Resize tabset if there is avalible space? - (this seems hard and potentialy messy)
- Can there be an option to specify in px or relative units (%) for screen scaling - probably a seperate item to make relative sizes as px sizes are used throughout at the moment as far as I can tell.
Thanks for all the work on the library its great!