diff --git a/source/rofi.c b/source/rofi.c index fc2a9abb..085ec98c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1615,7 +1615,7 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l *input = g_strdup ( state.text->text ); if ( next_pos ) { - if((state.selected+1)< state.num_lines){ + if ( ( state.selected + 1 ) < state.num_lines ) { *( next_pos ) = state.line_map[state.selected + 1]; } } diff --git a/source/textbox.c b/source/textbox.c index 6e594c8f..36dd9050 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -117,6 +117,10 @@ void textbox_font ( textbox *tb, TextBoxFontType tbft ) tb->color_fg = color->fg; break; } + if ( ( tbft & SELECTED ) == SELECTED ) { + tb->color_bg = color->hlbg; + tb->color_fg = color->hlfg; + } if ( tb->tbft != tbft ) { tb->update = TRUE; } @@ -287,13 +291,16 @@ static void texbox_update ( textbox *tb ) } // Set ARGB - Color col = tb->color_bg; - cairo_set_source_rgba ( tb->main_draw, col.red, col.green, col.blue, col.alpha ); + Color col = tb->color_bg; + double scale = 1.0; + if ( ( tb->tbft & SELECTED ) == SELECTED && ( tb->tbft & FMOD_MASK ) != HIGHLIGHT ) { + scale = 0.4; + } + cairo_set_source_rgba ( tb->main_draw, col.red, col.green, col.blue, col.alpha * scale ); cairo_paint ( tb->main_draw ); // Set ARGB col = tb->color_fg; - double scale = tb->tbft & SELECTED ? 0.5 : 1.0; cairo_set_source_rgba ( tb->main_draw, col.red, col.green, col.blue, col.alpha * scale ); cairo_move_to ( tb->main_draw, x, y ); pango_cairo_show_layout ( tb->main_draw, tb->layout );