refactor(appearance): use image button in the appearance panel

This commit is contained in:
Ashley Wulber 2023-11-13 10:29:08 -05:00 committed by Michael Murphy
parent dc9db64592
commit 8ec10e0fc0
3 changed files with 87 additions and 129 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only
mod widgets;
pub mod widgets;
use std::{
collections::HashMap,

View file

@ -25,12 +25,12 @@ pub fn color_button(color: wallpaper::Color, selected: bool) -> Element<'static,
}
/// A sized container that's filled with a color or gradient.
pub fn color_image(
pub fn color_image<'a, M: 'a>(
color: wallpaper::Color,
width: u16,
height: u16,
border_radius: f32,
) -> Element<'static, Message> {
) -> Element<'a, M> {
container(space::Space::new(width, height))
.style(cosmic::theme::Container::custom(move |_theme| {
container::Appearance {