slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.84k stars 555 forks source link

TabWidget tabbar overflows parent's dimensions #5003

Open jdumont0201 opened 5 months ago

jdumont0201 commented 5 months ago

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
WilstonOreo commented 3 months ago

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