FlexLayout icon indicating copy to clipboard operation
FlexLayout copied to clipboard

[Improvement] Ability to specify size for a tab

Open keycad opened this issue 6 years ago • 3 comments

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

keycad avatar Feb 15 '19 10:02 keycad

Hi, thanks for the suggestion,

I will look to add this to the next update

nealus avatar Mar 08 '19 17:03 nealus

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. :-)

avgrad avatar May 09 '19 14:05 avgrad

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:

  1. 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)
  1. 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!

Matt95 avatar Mar 03 '23 17:03 Matt95