mirror of
https://github.com/davatorium/rofi.git
synced 2025-02-24 15:56:25 -05:00
[View] Don't crash when element-textbox does not exists.
This commit is contained in:
parent
c638dc8e97
commit
3c6fc083f2
1 changed files with 26 additions and 22 deletions
|
@ -1017,6 +1017,14 @@ static void update_callback(textbox *t, icon *ico, unsigned int index,
|
|||
char *text = mode_get_display_value(state->sw, state->line_map[index],
|
||||
&fstate, &add_list, TRUE);
|
||||
(*type) |= fstate;
|
||||
|
||||
if (ico) {
|
||||
int icon_height = widget_get_desired_height(WIDGET(ico), WIDGET(ico)->w);
|
||||
cairo_surface_t *icon =
|
||||
mode_get_icon(state->sw, state->line_map[index], icon_height);
|
||||
icon_set_surface(ico, icon);
|
||||
}
|
||||
if (t) {
|
||||
// TODO needed for markup.
|
||||
textbox_font(t, *type);
|
||||
// Move into list view.
|
||||
|
@ -1027,12 +1035,6 @@ static void update_callback(textbox *t, icon *ico, unsigned int index,
|
|||
} else {
|
||||
list = pango_attr_list_new();
|
||||
}
|
||||
if (ico) {
|
||||
int icon_height = widget_get_desired_height(WIDGET(ico), WIDGET(ico)->w);
|
||||
cairo_surface_t *icon =
|
||||
mode_get_icon(state->sw, state->line_map[index], icon_height);
|
||||
icon_set_surface(ico, icon);
|
||||
}
|
||||
|
||||
if (state->tokens) {
|
||||
RofiHighlightColorStyle th = {ROFI_HL_BOLD | ROFI_HL_UNDERLINE,
|
||||
|
@ -1047,9 +1049,11 @@ static void update_callback(textbox *t, icon *ico, unsigned int index,
|
|||
}
|
||||
textbox_set_pango_attributes(t, list);
|
||||
pango_attr_list_unref(list);
|
||||
}
|
||||
g_list_free(add_list);
|
||||
g_free(text);
|
||||
} else {
|
||||
// Never called.
|
||||
int fstate = 0;
|
||||
mode_get_display_value(state->sw, state->line_map[index], &fstate, NULL,
|
||||
FALSE);
|
||||
|
|
Loading…
Add table
Reference in a new issue