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

"resizable" set to false is not disabling the maximize button in iced 0.10.0 but was working in earlier versions #2121

Closed
2 tasks done
mayankjoshii opened this issue Oct 26, 2023 · 4 comments · Fixed by #2124
Labels
bug Something isn't working

Comments

@mayankjoshii
Copy link

mayankjoshii commented Oct 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

The resizable data member of the struct iced::window::Settings struct when set to false is not disabling the minimize button in the menu bar in the latest iced 0.10.0 version.

Success Case:
It was working as expected in the older versions of iced till iced 0.9.0.

This the screen shot of progress example built with iced 0.9.0. Here the maximize button is disable when the resizable was set to false:

iced-9

Failure Case:
This the screen shot of progress example built with iced 0.10.0. Here the maximize button is still enabled even if the resizable is set to false:

iced-10

Here's the code snippet to reproduce and test the behavior:

use iced::window;
use iced::settings::Settings;
use iced::{Element, Sandbox};
use iced::widget::{column, progress_bar, slider};

pub fn main() -> iced::Result {
    Progress::run(Settings{
	     window: iced::window::Settings 
	     { 
                    resizable: false,
                    ..window::Settings::default()
             },
             ..Settings::default()
         }
    )
}

#[derive(Default)]
struct Progress {
    value: f32,
}

#[derive(Debug, Clone, Copy)]
enum Message {
    SliderChanged(f32),
}

impl Sandbox for Progress {
    type Message = Message;

    fn new() -> Self {
        Self::default()
    }

    fn title(&self) -> String {
        String::from("A simple Progressbar")
    }

    fn update(&mut self, message: Message) {
        match message {
            Message::SliderChanged(x) => self.value = x,
        }
    }

    fn view(&self) -> Element<Message> {
        column![
            progress_bar(0.0..=100.0, self.value),
            slider(0.0..=100.0, self.value, Message::SliderChanged).step(0.01)
        ]
        .padding(20)
        .into()
    }
}

Please prioritize this as this is blocking our product release.

What is the expected behavior?

The functionality should not break and maximize button should be disabled when resizable is set to false.

Version

master

Operating System

Windows

Do you have any log output?

Shared the code snippet and the screenshots above.
@mayankjoshii mayankjoshii added the bug Something isn't working label Oct 26, 2023
@mayankjoshii mayankjoshii changed the title "resizable" set to false is not disabling the maximize button in iced 0.10.0 but was working earlier versions "resizable" set to false is not disabling the maximize button in iced 0.10.0 but was working in earlier versions Oct 26, 2023
@hecrj
Copy link
Member

hecrj commented Oct 27, 2023

I have opened #2124 which should fix the issue. Can you give it a try and let me know? Thanks!

@mayankjoshii
Copy link
Author

Hi @hecrj,

yes this fix is working. I have attached the success case screenshot with iced 0.10.0

image

Can you please commit and merge this change to the iced 0.10.0 branch, as our project will be referring to that branch and downloading the code at build time using cargo?

@mayankjoshii
Copy link
Author

mayankjoshii commented Oct 30, 2023

Hi @hecrj

This fix is yet not integrated in the iced 0.10.0 version. Can we expect this fix to be added to the iced winit 0.10 version or any minor release like 0.10.1 as we are dependent on that particular version and choosing some other branch will cause retest of entire GUI application

If updating the version 0.10.0 is not possible then how can we fetch the master version at runtime as we can’t carry the iced code since master is not a major release hence will not be stable and moreover we are downloading crates at runtime.

@hecrj
Copy link
Member

hecrj commented Oct 30, 2023

@mayankjoshii I just backported the fix and released iced_winit 0.10.1. You should be able to pull the fix with cargo update.

Hope that works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants