Giter Site home page Giter Site logo

Comments (9)

Strosel avatar Strosel commented on July 18, 2024

Same issue with the close button inCard
image

from iced_aw.

wangeguo avatar wangeguo commented on July 18, 2024
Before (Expected) iced_aw: 0.7.0 After (Wrong) iced_aw: 0.8.0
截屏2024-02-26 18 36 56 截屏2024-02-26 18 36 37

BootstrapIcon::ChevronExpand, BootstrapIcon::Plus and BootstrapIcon::Box

from iced_aw.

genusistimelord avatar genusistimelord commented on July 18, 2024

Same issue with the close button inCard image

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
截屏2024-02-26 18 36 56 截屏2024-02-26 18 36 37

BootstrapIcon::ChevronExpand, BootstrapIcon::Plus and BootstrapIcon::Box

this should be in its own issue but I did prompt this towards the person who last did the font updates.

from iced_aw.

Strosel avatar Strosel commented on July 18, 2024

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.

from iced_aw.

genusistimelord avatar genusistimelord commented on July 18, 2024

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.

from iced_aw.

Strosel avatar Strosel commented on July 18, 2024

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.

from iced_aw.

genusistimelord avatar genusistimelord commented on July 18, 2024

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.

from iced_aw.

genusistimelord avatar genusistimelord commented on July 18, 2024

this is now fixed due to #216

from iced_aw.

genusistimelord avatar genusistimelord commented on July 18, 2024

@Strosel If there are any other widgets that need API changes that you would like to do let me know.

from iced_aw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.