mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
backend: add new property: BORDER_COLOR
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
aa57d3f64a
commit
ffe1b79881
4 changed files with 14 additions and 0 deletions
|
@ -342,6 +342,15 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
|
|||
ps->backend_data->ops->set_image_property(
|
||||
ps->backend_data, IMAGE_PROPERTY_CORNER_RADIUS, w->win_image,
|
||||
(double[]){w->corner_radius});
|
||||
if (w->corner_radius) {
|
||||
struct color border_color;
|
||||
ps->backend_data->ops->read_pixel(
|
||||
ps->backend_data, w->win_image, 0, w->heightb,
|
||||
&border_color);
|
||||
ps->backend_data->ops->set_image_property(
|
||||
ps->backend_data, IMAGE_PROPERTY_BORDER_COLOR,
|
||||
w->win_image, &border_color);
|
||||
}
|
||||
}
|
||||
|
||||
if (w->opacity * MAX_ALPHA < 1) {
|
||||
|
|
|
@ -58,6 +58,9 @@ enum image_properties {
|
|||
// Gives the image a rounded corner.
|
||||
// 1 double, default: 0
|
||||
IMAGE_PROPERTY_CORNER_RADIUS,
|
||||
// Border color
|
||||
// 1 struct color, default: black
|
||||
IMAGE_PROPERTY_BORDER_COLOR,
|
||||
};
|
||||
|
||||
enum image_operations {
|
||||
|
|
|
@ -451,6 +451,7 @@ bool default_set_image_property(backend_t *base attr_unused, enum image_properti
|
|||
break;
|
||||
case IMAGE_PROPERTY_CORNER_RADIUS: tex->corner_radius = dargs[0]; break;
|
||||
case IMAGE_PROPERTY_MAX_BRIGHTNESS: tex->max_brightness = dargs[0]; break;
|
||||
case IMAGE_PROPERTY_BORDER_COLOR: tex->border_color = *(struct color *)arg; break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -41,6 +41,7 @@ struct backend_image {
|
|||
// Effective size of the image
|
||||
int ewidth, eheight;
|
||||
bool color_inverted;
|
||||
struct color border_color;
|
||||
};
|
||||
|
||||
bool build_shadow(xcb_connection_t *, xcb_drawable_t, double opacity, int width,
|
||||
|
|
Loading…
Reference in a new issue