Skip to content
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

Closeable tabs #768

Open
nahla-nee opened this issue Dec 24, 2021 · 1 comment
Open

Closeable tabs #768

nahla-nee opened this issue Dec 24, 2021 · 1 comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request

Comments

@nahla-nee
Copy link

A great feature to add to the tab widget, or as a separate widget is the ability to make closable tabs. I'm currently working on a browser for the gemini protocol and sixtyfps was on top of the priority list until I quickly ran into the problem of not being able to have tabs that worked how I wanted.

I searched the docs and as far as I can tell its not currently possible to do this with sixtyfps as it stands, nor could I find anything that allows for creating custom widgets or modifying the base widgets.

@ogoffart
Copy link
Member

ogoffart commented Jan 3, 2022

Currently, the TabWidget as it is can't close tab. But it should be possible to implement one yourself

   VerticalLayout {
      tab_bar := HorizontalLayout {  
           for tab in tab_model : Tab {  // Tab is a component you implement
                title => tab.title;
                closed => { root.tab_closed(tab.id); }
                selected => { root.current_tab = tab.id; }
           }
      }
      contents := Rectangle {
          //  something that depends on  current_tab
      }
    }

@ogoffart ogoffart added the enhancement New feature or request label Nov 29, 2022
@ogoffart ogoffart added the a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants