1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-01-27 15:25:24 -05:00

Change ThemeHighlight to RofiHighlightColorStyle

This commit is contained in:
Dave Davenport 2017-06-02 16:46:28 +02:00
parent 3e46228074
commit 1d622aa59c
6 changed files with 11 additions and 11 deletions

View file

@ -34,7 +34,7 @@
* @{
*/
/**
* @param th The ThemeHighlight
* @param th The RofiHighlightColorStyle
* @param tokens Array of regexes used for matching
* @param input The input string to find the matches on
* @param retv The Attribute list to update with matches
@ -43,7 +43,7 @@
*
* @returns the updated retv list.
*/
PangoAttrList *helper_token_match_get_pango_attr ( ThemeHighlight th, GRegex **tokens, const char *input, PangoAttrList *retv );
PangoAttrList *helper_token_match_get_pango_attr ( RofiHighlightColorStyle th, GRegex **tokens, const char *input, PangoAttrList *retv );
/**
* @param pfd Pango font description to validate.

View file

@ -159,7 +159,7 @@ typedef struct
RofiHighlightStyle style;
/** Color */
ThemeColor color;
} ThemeHighlight;
} RofiHighlightColorStyle;
typedef union {
/** integer */
@ -183,7 +183,7 @@ typedef union {
struct Property *ref;
} link;
/** Highlight Style */
ThemeHighlight highlight;
RofiHighlightColorStyle highlight;
/** List */
GList *list;
} PropertyValue;
@ -418,7 +418,7 @@ RofiPadding rofi_theme_get_padding ( const widget *widget, const char *property,
*
* @returns The highlight of this property for this widget.
*/
ThemeHighlight rofi_theme_get_highlight ( widget *widget, const char *property, ThemeHighlight th );
RofiHighlightColorStyle rofi_theme_get_highlight ( widget *widget, const char *property, RofiHighlightColorStyle th );
/**
* @param d The distance handle.

View file

@ -399,7 +399,7 @@ int find_arg_char ( const char * const key, char *val )
return FALSE;
}
PangoAttrList *helper_token_match_get_pango_attr ( ThemeHighlight th, GRegex **tokens, const char *input, PangoAttrList *retv )
PangoAttrList *helper_token_match_get_pango_attr ( RofiHighlightColorStyle th, GRegex **tokens, const char *input, PangoAttrList *retv )
{
// Do a tokenized match.
if ( tokens ) {

View file

@ -626,7 +626,7 @@ GList *rofi_theme_get_list ( const widget *widget, const char * property, const
return NULL;
}
ThemeHighlight rofi_theme_get_highlight ( widget *widget, const char *property, ThemeHighlight th )
RofiHighlightColorStyle rofi_theme_get_highlight ( widget *widget, const char *property, RofiHighlightColorStyle th )
{
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
Property *p = rofi_theme_find_property ( wid, P_HIGHLIGHT, property, FALSE );

View file

@ -911,7 +911,7 @@ static void update_callback ( textbox *t, unsigned int index, void *udata, TextB
textbox_icon ( t, icon );
if ( state->tokens && config.show_match ) {
ThemeHighlight th = { ROFI_HL_BOLD | ROFI_HL_UNDERLINE, { 0.0, 0.0, 0.0, 0.0 } };
RofiHighlightColorStyle th = { ROFI_HL_BOLD | ROFI_HL_UNDERLINE, { 0.0, 0.0, 0.0, 0.0 } };
th = rofi_theme_get_highlight ( WIDGET ( t ), "highlight", th );
helper_token_match_get_pango_attr ( th, state->tokens, textbox_get_visible_text ( t ), list );
}

View file

@ -366,7 +366,7 @@ START_TEST ( test_properties_style)
wid.name = "blaat";
wid.state = NULL;
rofi_theme_parse_string ( "* { none: none; bold: bold; underline: underline; italic: italic; st: italic strikethrough;}");
ThemeHighlight th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}};
RofiHighlightColorStyle th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}};
th = rofi_theme_get_highlight ( &wid, "none", th);
ck_assert_int_eq ( th.style , ROFI_HL_NONE );
th = rofi_theme_get_highlight ( &wid, "underline", th);
@ -386,7 +386,7 @@ START_TEST ( test_properties_style2 )
wid.state = NULL;
rofi_theme_parse_string ( "* { boldu: bold underline ; boldi: bold italic; underlinei: underline italic; italicu: italic underline;}");
ThemeHighlight th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}};
RofiHighlightColorStyle th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}};
th = rofi_theme_get_highlight ( &wid, "boldu", th);
ck_assert_int_eq ( th.style , (ROFI_HL_UNDERLINE|ROFI_HL_BOLD));
th = rofi_theme_get_highlight ( &wid, "boldi", th);
@ -403,7 +403,7 @@ START_TEST ( test_properties_style_color )
wid.name = "blaat";
wid.state = NULL;
rofi_theme_parse_string ( "* { comb: bold #123; }");
ThemeHighlight th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}};
RofiHighlightColorStyle th = { ROFI_HL_BOLD, {0.0,0.0,0.0,0.0}};
th = rofi_theme_get_highlight ( &wid, "comb", th);
ck_assert_int_eq ( th.style , (ROFI_HL_BOLD|ROFI_HL_COLOR));
ck_assert_double_eq ( th.color.red , (1/15.0));