mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Support hover icons in titlebar (#1280)
Allow both max_toggled_hover and max_hover_toggled names for icons
This commit is contained in:
parent
5d2f594626
commit
c79b8ba8a7
8 changed files with 258 additions and 30 deletions
|
|
@ -259,8 +259,8 @@ parse_xbm_builtin(const char *button, int size)
|
|||
}
|
||||
|
||||
void
|
||||
button_xbm_load(const char *button_name, struct lab_data_buffer **buffer,
|
||||
char *fallback_button, float *rgba)
|
||||
button_xbm_load(const char *button_name, const char *alt_name,
|
||||
struct lab_data_buffer **buffer, char *fallback_button, float *rgba)
|
||||
{
|
||||
struct pixmap pixmap = {0};
|
||||
if (*buffer) {
|
||||
|
|
@ -282,6 +282,18 @@ button_xbm_load(const char *button_name, struct lab_data_buffer **buffer,
|
|||
free(tokens);
|
||||
}
|
||||
}
|
||||
if (!pixmap.data && *alt_name) {
|
||||
button_filename(alt_name, filename, sizeof(filename));
|
||||
char *token_buffer = grab_file(filename);
|
||||
if (token_buffer) {
|
||||
struct token *tokens = tokenize_xbm(token_buffer);
|
||||
free(token_buffer);
|
||||
pixmap = parse_xbm_tokens(tokens);
|
||||
if (tokens) {
|
||||
free(tokens);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!pixmap.data) {
|
||||
pixmap = parse_xbm_builtin(fallback_button, 6);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue