iced
iced copied to clipboard
The button rendering part is missing
Is there an existing issue for this?
- [X] I have searched the existing issues.
Is this issue related to iced?
- [X] My hardware is compatible and my graphics drivers are up-to-date.
What happened?
If I use Fill, part of the rendering is lost, but Fixed doesn't have this problem.
What is the expected behavior?
like the second photo
Version
crates.io release
Operating System
Linux
Do you have any log output?
No response
Replace with text and specify width as fill to render correctly
If you do not specify the button width as fill, an error will still occur. However, if you specify the button parent component width as fill, you will find that the width is sufficient, but I don’t know why it is not rendered.
If I set the height, the display will be abnormal. The following is the sample code
use iced::widget::Column;
use iced::widget::{self};
use iced::{executor, Application, Command, Element, Theme};
fn main() -> iced::Result {
App::run(iced::Settings::default())
}
#[derive(Debug, Clone)]
pub struct App {}
impl Application for App {
type Executor = executor::Default;
type Message = ();
type Theme = Theme;
type Flags = ();
fn new(_: Self::Flags) -> (Self, Command<Self::Message>) {
(Self {}, Command::none())
}
fn title(&self) -> String {
String::from("Qst")
}
fn update(&mut self, _: Self::Message) -> Command<Self::Message> {
Command::none()
}
fn view(&self) -> Element<Self::Message> {
widget::scrollable(Column::with_children(vec![widget::button(widget::text(
"Visual Studio Code+",
))
// .height(35)
.into()]))
.into()
}
}