Closed Strosel closed 8 months ago
Same issue with the close button inCard
Before (Expected) iced_aw: 0.7.0 | After (Wrong) iced_aw: 0.8.0 |
---|---|
BootstrapIcon::ChevronExpand
, BootstrapIcon::Plus
and BootstrapIcon::Box
Same issue with the close button in
Card
PR's are accepted for fixes and changes. Sadly I can not do everything myself.
Before (Expected) iced_aw: 0.7.0 After (Wrong) iced_aw: 0.8.0
BootstrapIcon::ChevronExpand
,BootstrapIcon::Plus
andBootstrapIcon::Box
this should be in its own issue but I did prompt this towards the person who last did the font updates.
It seems the issue is caused because the bootstrap_font is not loaded and can be solved by adding
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::from),
to your Application::new command list. I'm not well-versed enough with iced internals to know if this can be done by iced_aw to avoid this error but if anyone with more knowledge knows a way I feel like this should be done automatically somehow.
Regarding the improvements i mentioned in my original post, I might look into making a PR later this week if I have the time.
we can not preload fonts. it is up to the end user to load them via font load. I can always ask hector to see if he could add some sort of extension loader for fonts and such.
I'm currently working on enabling custom font size in the date picker but I seem to have run into somewhat of a wall and thought this would be the best place to ask for help. I'm able to set the font size but moving on to adjusting the picker size has proven more of an issue.
An exerpt of my current code looks like this (from layout
)
let text_width = |bounds: Size, content: &str, font: Font, size: Pixels| -> f32 {
<Renderer as iced::advanced::text::Renderer>::Paragraph::with_text(
iced::advanced::Text {
content,
bounds,
size,
font,
horizontal_alignment: Horizontal::Center,
vertical_alignment: Vertical::Center,
line_height: text::LineHeight::Relative(1.3),
shaping: text::Shaping::Advanced,
},
)
.min_width()
};
let size = text_width(bounds, "September", renderer.default_font(), self.font_size)
+ text_width(bounds, "9999", renderer.default_font(), self.font_size)
+ SPACING
+ 4.0
* text_width(
bounds,
&icon_to_string(BootstrapIcon::CaretLeftFill),
BOOTSTRAP_FONT,
self.font_size,
);
let size = size.max(300.0);
let limits = Limits::new(Size::ZERO, bounds)
.shrink(Padding::from(PADDING))
.width(Length::Fill)
.height(Length::Fill)
.max_width(size)
.max_height(size);
It seems my calculation of the required size is too small which causes strange behaviour for the layout. Is my text_width
implementation wrong or am I otherwise overcomplicating this solution? Any insight would be much appreciated as I have very limited knowledge of iced internals.
yeah, honestly I dont know how to help as originally that was made by the original maker of this library. It would just be trail and error for me as well. Best person to ask might be hector since he understand the custom widget system way better than I do XD.
this is now fixed due to #216
@Strosel If there are any other widgets that need API changes that you would like to do let me know.
The date picker does not expose any way to change the font, font size or cancel/confirm icons
With a non-default font and font size this is the result
It would be beneficial if the date picker widget exposed methods to change the font, font size and maybe even icons used to render the widget. Changing the size of each day in the picker as to not clip the text would also be nice if possible.