pop-os / libcosmic

WIP library for COSMIC applications
https://pop-os.github.io/libcosmic/cosmic/
Mozilla Public License 2.0
431 stars 42 forks source link

Allow further customization of widgets #24

Open edfloreshz opened 1 year ago

edfloreshz commented 1 year ago

This issue intends to report blockers encountered while trying to style libcosmic widgets.

edfloreshz commented 1 year ago

Checkbox

Problem

There's no support for partial check-mark status, we can either mark it as checked or not:

image

Having partially checked boxes is not possible yet:

image

Solution

Allow checkboxes to be grouped and linked to a parent checkbox, when at least one of the children is not checked, the parent checkbox will be in a partial state and will use the partial check icon.

image

edfloreshz commented 1 year ago

Radio Button

Problem

The API doesn't currently allow setting the dot size, it is not possible either to set the border to appear only when the radio button is in focus.

Solution

Add a new property to the Appearance struct and update the widget accordingly.

pub struct Appearance {
    pub background: Background,
    pub dot_color: Color,
    pub dot_size: f32,
    pub border_width: f32,
    pub border_color: Color,
    pub text_color: Option<Color>,
}
edfloreshz commented 1 year ago

Focus

Problem

Not all elements support the focused state.

image image image image image

Solution

Allow widgets to have a different style when the focused state is triggered.