Skip to content

Commit

Permalink
theme: compensate the hover corner radius with padding
Browse files Browse the repository at this point in the history
When padding.width is set, the corner radius of the rectangle
hover effect can be smaller since there is more space available.
  • Loading branch information
jp7677 authored and johanmalm committed Sep 11, 2024
1 parent 9395348 commit 21e9263
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/theme.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ create_hover_fallback(struct theme *theme, const char *icon_name,
float overlay_color[4] = { 0.15f, 0.15f, 0.15f, 0.3f};
int radius = MIN(width, height) / 2;
enum corner corner = corner_from_icon_name(icon_name);
int corner_radius = MAX(rc.corner_radius - theme->padding_width, 0);

switch (theme->window_button_hover_bg_shape) {
case LAB_CIRCLE:
Expand All @@ -182,7 +183,7 @@ create_hover_fallback(struct theme *theme, const char *icon_name,
} else {
struct rounded_corner_ctx rounded_ctx = {
.box = &(struct wlr_box){.width = width, .height = height},
.radius = rc.corner_radius,
.radius = corner_radius,
.line_width = theme->border_width,
.fill_color = overlay_color,
.border_color = overlay_color,
Expand Down

0 comments on commit 21e9263

Please sign in to comment.