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

Tabs incorrect behavior (tab bar filling widget space) when combined with window menus #118

Closed
TheQuantumPhysicist opened this issue Apr 30, 2023 · 4 comments

Comments

@TheQuantumPhysicist
Copy link

This issue is based on a discussion thread. I was asked to open it.


Hello

I combined the menu example with the tabs example, but the result seems to be faulty somehow. The tabs bar fills the whole screen no matter what. I tried to change everything possible (even removing the icons altogether), but nothing helped.

Please find a minimal reproducible example in this repo: https://github.com/TheQuantumPhysicist/IcedTabsTest

build and run with cargo run. On some of my machines I needed to install libfontconfig-dev.

Thank you and have a great day.

@TheQuantumPhysicist
Copy link
Author

Can someone please confirm that this is a bug? I was told to put this in here but never got that confirmation.

@genusistimelord
Copy link
Collaborator

sorry been a bit busy. I will take a look when I get some time.

@genusistimelord
Copy link
Collaborator

genusistimelord commented May 1, 2023

seems changing the view to be

pub fn view(
        &self,
        backend_controller: &NodeBackendController,
    ) -> Element<'_, Message, iced::Renderer> {
        let c = iced::widget::column![
            iced::widget::row!(self.main_menu
                .view(backend_controller)
                .map(Message::MenuMessage)),
                iced::widget::row!(self.main_widget
                .view(backend_controller)
                .map(Message::MainWidgetMessage))
        ];

        c.into()
    }
    

fixes the issue. This might be because the Menu and other Views cant be within a column together if they are Fill or what not. Please give this a try and let me know what else might need to be looked at.

@TheQuantumPhysicist
Copy link
Author

Yep. This fixes the issue. Thank you!

My opinion: This should be disallowed at compile-time with type-safety. There should be a class of types allowed in column! and row! that only lead to correct results.

Feel free to close this issue, or keep it open to address this problem with type-safety. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants