Cleanups based on feedback.

This commit is contained in:
Dave Davenport 2022-01-25 00:11:41 +01:00
parent d163a21b47
commit 92cb2b2915
3 changed files with 8 additions and 14 deletions

View File

@ -304,8 +304,8 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%type <ival> t_property_highlight_styles
%type <ival> t_property_highlight_style
%type <ival> t_property_line_style
%type <list> t_property_element_set
%type <list> t_property_element_set_optional
%type <list> t_property_element_list
%type <list> t_property_element_list_optional
%type <ival> t_property_orientation
%type <ival> t_property_cursor
%type <ival> t_name_prefix_optional
@ -577,7 +577,7 @@ t_property_element
$$ = rofi_theme_property_create ( P_COLOR );
$$->value.color = $1;
}
| T_LIST_OPEN t_property_element_set_optional T_LIST_CLOSE {
| T_LIST_OPEN t_property_element_list_optional T_LIST_CLOSE {
$$ = rofi_theme_property_create ( P_LIST );
$$->value.list = $2;
}
@ -647,24 +647,24 @@ t_color_list
/** List of elements */
t_property_element_set_optional
t_property_element_list_optional
: %empty { $$ = NULL; }
| t_property_element_set { $$ = $1; }
| t_property_element_list { $$ = $1; }
;
t_property_element_set
t_property_element_list
: t_property_element { $$ = g_list_append ( NULL, $1); }
| T_ELEMENT {
Property *p = rofi_theme_property_create ( P_STRING );
p->value.s = $1;
$$ = g_list_append ( NULL, p);
}
| t_property_element_set T_COMMA T_ELEMENT {
| t_property_element_list T_COMMA T_ELEMENT {
Property *p = rofi_theme_property_create ( P_STRING );
p->value.s = $3;
$$ = g_list_append ( $1, p);
}
| t_property_element_set T_COMMA t_property_element {
| t_property_element_list T_COMMA t_property_element {
$$ = g_list_append ( $1, $3 );
}
;

View File

@ -70,11 +70,6 @@ static gboolean distance_compare(RofiDistance d, RofiDistance e) {
d.style == e.style;
}
static gpointer rofi_g_list_strdup(gconstpointer data,
G_GNUC_UNUSED gpointer user_data) {
return g_strdup(data);
}
ThemeWidget *rofi_theme_find_or_create_name(ThemeWidget *base,
const char *name) {
for (unsigned int i = 0; i < base->num_widgets; i++) {

View File

@ -2026,7 +2026,6 @@ RofiViewState *rofi_view_create(Mode *sw, const char *input,
if (list == NULL) {
rofi_view_add_widget(state, WIDGET(state->main_window), "mainbox");
} else {
// rofi_theme_get_list(WIDGET(state->main_window), "children", "mainbox");
for (const GList *iter = list; iter != NULL; iter = g_list_next(iter)) {
rofi_view_add_widget(state, WIDGET(state->main_window),
(const char *)iter->data);