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

Allow defining background color on Container #112

Closed
Alphare opened this issue Dec 6, 2019 · 3 comments · Fixed by #146
Closed

Allow defining background color on Container #112

Alphare opened this issue Dec 6, 2019 · 3 comments · Fixed by #146
Labels
feature New feature or request
Milestone

Comments

@Alphare
Copy link

Alphare commented Dec 6, 2019

Right now I think it's only possible to set the background color on a button.
It makes sense to be able to add background colors (and any other style for that matter) on anything that makes sense.

@hecrj
Copy link
Member

hecrj commented Dec 7, 2019

Styling overall is missing. It's something that we still have to figure out and decide on a solution.

We have a Zulip thread where we shared some ideas. I will start exploring this soon.

@hecrj hecrj added the feature New feature or request label Dec 7, 2019
@hecrj hecrj added this to the 0.1.0 milestone Dec 7, 2019
@norman784
Copy link

IMHO the base widget (that seems to be the Container widget) need to implement all the common properties between widgets, border (color, width, rounder corders), shadow, background, width, height, padding, etc so you don't need to reimplement it in each one or in a few, also one big advantage I find in this approach is that you can do a lot of things with even images (because they inherits from Container? I didn't checked in deep how and if there is a inheritance there or what's the rust way to do it).

My problem using similar UI libraries in the past was that one (iOS) was build this way, while the other (android) wasn't so in order to achieve simple things that you could with some widgets you need to reimplement the i.e. Image widget, etc.

Also you need to expose all the internals so we can freely create custom widgets, there are some methods, properties that has pub(crate) so it makes hard to create custom ones.

Last note, I'm impressed by the achievements on this library, is amazing how easy it seems to use, even I can understand (or that's what I think) how the widgets were implemented, while in the past I struggle to understand some crates out there.

Cheers

@gabrieldechichi
Copy link

Is this actually closed? At this time the Background enum only supports Color. On core/src/background.rs

use crate::Color;

/// The background of some element.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Background {
    /// A solid color
    Color(Color),
    // TODO: Add gradient and image variants
}

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

Successfully merging a pull request may close this issue.

4 participants