From 5cc6a5b3e1f4b1a5b82869910722fb71b2c08348 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sat, 9 Dec 2023 19:49:23 +0000 Subject: [PATCH] theme: partially revert c79b8ba ...so that svg and png icons only support the max_toggled_hover format. There is no need to support max_hover_toggled because there are no backward compatibility considerations as Openbox does not handle png and svg icons. --- docs/labwc-theme.5.scd | 3 ++- src/theme.c | 16 ---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/docs/labwc-theme.5.scd b/docs/labwc-theme.5.scd index 8a092c0c..b75ea116 100644 --- a/docs/labwc-theme.5.scd +++ b/docs/labwc-theme.5.scd @@ -212,7 +212,8 @@ One advantage of xbm buttons over other formats is that they change color based on the theme. Other formats use the suffices "-active" and "-inactive" to align with the respective titlebar colors. For example: "close-active.png" -For compatibility reasons, the following alternative names are supported: +For compatibility reasons, the following alternative names are supported +for xbm files: - max_hover_toggled.xbm for max_toggled_hover.xbm diff --git a/src/theme.c b/src/theme.c index 1712ee93..ed5e6a90 100644 --- a/src/theme.c +++ b/src/theme.c @@ -173,16 +173,8 @@ load_buttons(struct theme *theme) /* Try png icon first */ snprintf(filename, sizeof(filename), "%s-active.png", b->name); button_png_load(filename, b->active.buffer); - if (!*b->active.buffer && b->alt_name) { - snprintf(filename, sizeof(filename), "%s-active.png", b->alt_name); - button_png_load(filename, b->active.buffer); - } snprintf(filename, sizeof(filename), "%s-inactive.png", b->name); button_png_load(filename, b->inactive.buffer); - if (!*b->inactive.buffer && b->alt_name) { - snprintf(filename, sizeof(filename), "%s-inactive.png", b->alt_name); - button_png_load(filename, b->inactive.buffer); - } #if HAVE_RSVG /* Then try svg icon */ @@ -191,18 +183,10 @@ load_buttons(struct theme *theme) snprintf(filename, sizeof(filename), "%s-active.svg", b->name); button_svg_load(filename, b->active.buffer, size); } - if (!*b->active.buffer && b->alt_name) { - snprintf(filename, sizeof(filename), "%s-active.svg", b->alt_name); - button_svg_load(filename, b->active.buffer, size); - } if (!*b->inactive.buffer) { snprintf(filename, sizeof(filename), "%s-inactive.svg", b->name); button_svg_load(filename, b->inactive.buffer, size); } - if (!*b->active.buffer && b->alt_name) { - snprintf(filename, sizeof(filename), "%s-inactive.svg", b->alt_name); - button_svg_load(filename, b->inactive.buffer, size); - } #endif /* If there were no png/svg buttons, use xbm */ -- 2.52.0