slint icon indicating copy to clipboard operation
slint copied to clipboard

TabWidget tabbar overflows parent's dimensions

Open jdumont0201 opened this issue 10 months ago • 1 comments

Issue: If you add a TabWidget in a constrained container, its tabbar overrides the parent's width and expands past the parent's size.

Expected: The tabbar item should space evenly within the available width

Platforms: SlintPad MacOs Sonoma 14.4 + Rust 1.77.1 + Slint 1.5.1

https://github.com/slint-ui/slint/assets/32376919/e9f53460-3706-4822-891e-0a53ea21f1cd

Screenshot 2024-04-02 at 22 08 01
  Rectangle {
        width: 200px;
        height: 200px;
        TabWidget {
            padding: 0px;
            height: 100%;
            width: 100%;
            Tab {
                title: "Tab 1";
                property <color> c2: #ff0000;
                Rectangle {
                    background: c2;
                }
            }

            Tab {
                title: "Tab 2";
                Rectangle {
                    background: pink;
                }
            }

            Tab {
                title: "Tab 3";
                Rectangle {
                    background: green;
                }
            }
        }
    }
   ``` he

jdumont0201 avatar Apr 02 '24 21:04 jdumont0201

Maybe it would be good to change the size of tabs and scrolling through the tabs like in Flickable would be a good feature :)

WilstonOreo avatar May 28 '24 15:05 WilstonOreo