mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
[Themes] Fix inheritance with state set.
Update theme.c and included themes. This should allow you to set `element-text { text-color: inherit; background-color: inherit;}` to fix old themes.
This commit is contained in:
parent
0352e99dea
commit
9f777a7a7b
23 changed files with 244 additions and 73 deletions
|
@ -767,12 +767,10 @@ if ( queue == NULL ) {
|
||||||
|
|
||||||
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,PROPERTIES_LIST>. {
|
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,PROPERTIES_LIST>. {
|
||||||
yytext[yyleng-1] = '\0';
|
yytext[yyleng-1] = '\0';
|
||||||
fprintf(stderr,"prop found: |%s|\n", yytext);
|
|
||||||
return T_ERROR_PROPERTY;
|
return T_ERROR_PROPERTY;
|
||||||
}
|
}
|
||||||
<NAMESTR>. {
|
<NAMESTR>. {
|
||||||
yytext[yyleng-1] = '\0';
|
yytext[yyleng-1] = '\0';
|
||||||
fprintf(stderr,"namestr found: |%s|\n", yytext);
|
|
||||||
return T_ERROR_NAMESTRING;
|
return T_ERROR_NAMESTRING;
|
||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
218
source/theme.c
218
source/theme.c
|
@ -768,14 +768,36 @@ ThemeWidget *rofi_theme_find_widget ( const char *name, const char *state, gbool
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rofi_theme_get_position_inside ( Property *p, const widget *widget, const char *property, int def )
|
||||||
|
{
|
||||||
|
if ( p ) {
|
||||||
|
if ( p->type == P_INHERIT ) {
|
||||||
|
if ( widget->parent ) {
|
||||||
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_position_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
return p->value.i;
|
||||||
|
}
|
||||||
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
|
return def;
|
||||||
|
}
|
||||||
int rofi_theme_get_position ( const widget *widget, const char *property, int def )
|
int rofi_theme_get_position ( const widget *widget, const char *property, int def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_POSITION, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_POSITION, property, FALSE );
|
||||||
|
return rofi_theme_get_position_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
static int rofi_theme_get_integer_inside ( Property *p, const widget *widget, const char *property, int def )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_position ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_integer_inside ( p, widget, property, def );
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -784,31 +806,20 @@ int rofi_theme_get_position ( const widget *widget, const char *property, int de
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rofi_theme_get_integer ( const widget *widget, const char *property, int def )
|
int rofi_theme_get_integer ( const widget *widget, const char *property, int def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_INTEGER, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_INTEGER, property, FALSE );
|
||||||
if ( p ) {
|
return rofi_theme_get_integer_inside ( p, widget, property, def );
|
||||||
if ( p->type == P_INHERIT ) {
|
|
||||||
if ( widget->parent ) {
|
|
||||||
return rofi_theme_get_integer ( widget->parent, property, def );
|
|
||||||
}
|
|
||||||
return def;
|
|
||||||
}
|
|
||||||
return p->value.i;
|
|
||||||
}
|
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
|
||||||
return def;
|
|
||||||
}
|
}
|
||||||
RofiDistance rofi_theme_get_distance ( const widget *widget, const char *property, int def )
|
static RofiDistance rofi_theme_get_distance_inside ( Property *p, const widget *widget, const char *property, int def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
|
||||||
Property *p = rofi_theme_find_property ( wid, P_PADDING, property, FALSE );
|
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_distance ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_distance_inside ( p, widget->parent, property, def );
|
||||||
}
|
}
|
||||||
return (RofiDistance){ .base = { def, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL }, .style = ROFI_HL_SOLID };
|
return (RofiDistance){ .base = { def, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL }, .style = ROFI_HL_SOLID };
|
||||||
}
|
}
|
||||||
|
@ -822,15 +833,44 @@ RofiDistance rofi_theme_get_distance ( const widget *widget, const char *propert
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return (RofiDistance){ .base = { def, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL }, .style = ROFI_HL_SOLID };
|
return (RofiDistance){ .base = { def, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL }, .style = ROFI_HL_SOLID };
|
||||||
}
|
}
|
||||||
|
RofiDistance rofi_theme_get_distance ( const widget *widget, const char *property, int def )
|
||||||
|
{
|
||||||
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( wid, P_PADDING, property, FALSE );
|
||||||
|
return rofi_theme_get_distance_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
|
||||||
|
static int rofi_theme_get_boolean_inside ( Property *p, const widget *widget, const char *property, int def )
|
||||||
|
{
|
||||||
|
if ( p ) {
|
||||||
|
if ( p->type == P_INHERIT ) {
|
||||||
|
if ( widget->parent ) {
|
||||||
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_boolean_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
return p->value.b;
|
||||||
|
}
|
||||||
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
|
return def;
|
||||||
|
}
|
||||||
int rofi_theme_get_boolean ( const widget *widget, const char *property, int def )
|
int rofi_theme_get_boolean ( const widget *widget, const char *property, int def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_BOOLEAN, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_BOOLEAN, property, FALSE );
|
||||||
|
return rofi_theme_get_boolean_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
|
||||||
|
static RofiOrientation rofi_theme_get_orientation_inside ( Property *p, const widget *widget, const char *property, RofiOrientation def )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_boolean ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_orientation_inside ( p, widget, property, def );
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -843,26 +883,17 @@ RofiOrientation rofi_theme_get_orientation ( const widget *widget, const char *p
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_ORIENTATION, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_ORIENTATION, property, FALSE );
|
||||||
if ( p ) {
|
return rofi_theme_get_orientation_inside ( p, widget, property, def );
|
||||||
if ( p->type == P_INHERIT ) {
|
|
||||||
if ( widget->parent ) {
|
|
||||||
return rofi_theme_get_orientation ( widget->parent, property, def );
|
|
||||||
}
|
|
||||||
return def;
|
|
||||||
}
|
|
||||||
return p->value.b;
|
|
||||||
}
|
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
|
||||||
return def;
|
|
||||||
}
|
}
|
||||||
RofiCursorType rofi_theme_get_cursor_type ( const widget *widget, const char *property, RofiCursorType def )
|
|
||||||
|
static RofiCursorType rofi_theme_get_cursor_type_inside ( Property *p, const widget *widget, const char *property, RofiCursorType def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
|
||||||
Property *p = rofi_theme_find_property ( wid, P_CURSOR, property, FALSE );
|
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_cursor_type ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_cursor_type_inside ( p, widget, property, def );
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -871,15 +902,20 @@ RofiCursorType rofi_theme_get_cursor_type ( const widget *widget, const char *pr
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
RofiCursorType rofi_theme_get_cursor_type ( const widget *widget, const char *property, RofiCursorType def )
|
||||||
const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def )
|
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_STRING, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_CURSOR, property, FALSE );
|
||||||
|
return rofi_theme_get_cursor_type_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
static const char *rofi_theme_get_string_inside ( Property *p, const widget *widget, const char *property, const char *def )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_string ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_string_inside ( p, widget, property, def );
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -888,14 +924,20 @@ const char *rofi_theme_get_string ( const widget *widget, const char *property,
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
double rofi_theme_get_double ( const widget *widget, const char *property, double def )
|
const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_DOUBLE, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_STRING, property, FALSE );
|
||||||
|
return rofi_theme_get_string_inside ( p, widget, property, def );
|
||||||
|
}
|
||||||
|
static double rofi_theme_get_double_inside ( ThemeWidget *wid, Property *p, const widget *widget, const char *property, double def )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_double ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_double_inside ( parent, p, widget, property, def );
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -906,7 +948,9 @@ double rofi_theme_get_double ( const widget *widget, const char *property, doubl
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_double ( widget->parent, property, def );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_double_inside ( parent, p, widget->parent, property, def );
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -915,14 +959,20 @@ double rofi_theme_get_double ( const widget *widget, const char *property, doubl
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t *d )
|
double rofi_theme_get_double ( const widget *widget, const char *property, double def )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_COLOR, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_DOUBLE, property, FALSE );
|
||||||
|
return rofi_theme_get_double_inside ( wid, p, widget, property, def );
|
||||||
|
}
|
||||||
|
static void rofi_theme_get_color_inside ( const widget *widget, Property *p, const char *property, cairo_t *d )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
rofi_theme_get_color ( widget->parent, property, d );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
rofi_theme_get_color_inside ( widget, p, property, d );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -937,14 +987,23 @@ void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gboolean rofi_theme_get_image ( const widget *widget, const char *property, cairo_t *d )
|
|
||||||
|
void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t *d )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_IMAGE , property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_COLOR, property, FALSE );
|
||||||
|
rofi_theme_get_color_inside ( widget, p, property, d );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean rofi_theme_get_image_inside ( Property *p, const widget *widget, const char *property, cairo_t *d )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_image ( widget->parent, property, d );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_image_inside ( p, widget, property, d );
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1037,14 +1096,20 @@ gboolean rofi_theme_get_image ( const widget *widget, const char *property, cair
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
RofiPadding rofi_theme_get_padding ( const widget *widget, const char *property, RofiPadding pad )
|
gboolean rofi_theme_get_image ( const widget *widget, const char *property, cairo_t *d )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
Property *p = rofi_theme_find_property ( wid, P_PADDING, property, FALSE );
|
Property *p = rofi_theme_find_property ( wid, P_IMAGE , property, FALSE );
|
||||||
|
return rofi_theme_get_image_inside (p, widget, property, d);
|
||||||
|
}
|
||||||
|
static RofiPadding rofi_theme_get_padding_inside ( Property *p, const widget *widget, const char *property, RofiPadding pad )
|
||||||
|
{
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_padding ( widget->parent, property, pad );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_padding_inside ( p, widget, property, pad );
|
||||||
}
|
}
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
@ -1059,15 +1124,21 @@ RofiPadding rofi_theme_get_padding ( const widget *widget, const char *property,
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
RofiPadding rofi_theme_get_padding ( const widget *widget, const char *property, RofiPadding pad )
|
||||||
GList *rofi_theme_get_list ( const widget *widget, const char * property, const char *defaults )
|
{
|
||||||
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( wid, P_PADDING, property, FALSE );
|
||||||
|
return rofi_theme_get_padding_inside ( p, widget, property, pad );
|
||||||
|
}
|
||||||
|
|
||||||
|
static GList *rofi_theme_get_list_inside ( Property *p, const widget *widget, const char * property, const char *defaults )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid2 = rofi_theme_find_widget ( widget->name, widget->state, TRUE );
|
|
||||||
Property *p = rofi_theme_find_property ( wid2, P_LIST, property, TRUE );
|
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_list ( widget->parent, property, defaults );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_list_inside ( p, widget, property, defaults );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( p->type == P_LIST ) {
|
else if ( p->type == P_LIST ) {
|
||||||
|
@ -1085,15 +1156,21 @@ GList *rofi_theme_get_list ( const widget *widget, const char * property, const
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
GList *rofi_theme_get_list ( const widget *widget, const char * property, const char *defaults )
|
||||||
RofiHighlightColorStyle rofi_theme_get_highlight ( widget *widget, const char *property, RofiHighlightColorStyle th )
|
{
|
||||||
|
ThemeWidget *wid2 = rofi_theme_find_widget ( widget->name, widget->state, TRUE );
|
||||||
|
Property *p = rofi_theme_find_property ( wid2, P_LIST, property, TRUE );
|
||||||
|
return rofi_theme_get_list_inside ( p, widget, property, defaults );
|
||||||
|
}
|
||||||
|
|
||||||
|
static RofiHighlightColorStyle rofi_theme_get_highlight_inside ( Property *p, 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 );
|
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_get_highlight ( widget->parent, property, th );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_get_highlight_inside ( p, widget->parent, property, th );
|
||||||
}
|
}
|
||||||
return th;
|
return th;
|
||||||
}
|
}
|
||||||
|
@ -1102,7 +1179,12 @@ RofiHighlightColorStyle rofi_theme_get_highlight ( widget *widget, const char *p
|
||||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||||
return th;
|
return 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 );
|
||||||
|
return rofi_theme_get_highlight_inside ( p, widget, property, th );
|
||||||
|
}
|
||||||
static int get_pixels ( RofiDistanceUnit *unit, RofiOrientation ori )
|
static int get_pixels ( RofiDistanceUnit *unit, RofiOrientation ori )
|
||||||
{
|
{
|
||||||
int val = unit->distance;
|
int val = unit->distance;
|
||||||
|
@ -1394,14 +1476,14 @@ ThemeMediaType rofi_theme_parse_media_type ( const char *type )
|
||||||
return THEME_MEDIA_TYPE_INVALID;
|
return THEME_MEDIA_TYPE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean rofi_theme_has_property ( const widget *widget, const char *property )
|
static gboolean rofi_theme_has_property_inside ( Property *p, const widget *widget, const char *property )
|
||||||
{
|
{
|
||||||
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
|
||||||
Property *p = rofi_theme_find_property ( wid, P_STRING, property, FALSE );
|
|
||||||
if ( p ) {
|
if ( p ) {
|
||||||
if ( p->type == P_INHERIT ) {
|
if ( p->type == P_INHERIT ) {
|
||||||
if ( widget->parent ) {
|
if ( widget->parent ) {
|
||||||
return rofi_theme_has_property ( widget->parent, property );
|
ThemeWidget *parent= rofi_theme_find_widget ( widget->parent->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( parent, P_COLOR, property, FALSE );
|
||||||
|
return rofi_theme_has_property_inside ( p, widget, property );
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1409,3 +1491,9 @@ gboolean rofi_theme_has_property ( const widget *widget, const char *property )
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
gboolean rofi_theme_has_property ( const widget *widget, const char *property )
|
||||||
|
{
|
||||||
|
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
|
||||||
|
Property *p = rofi_theme_find_property ( wid, P_STRING, property, FALSE );
|
||||||
|
return rofi_theme_has_property_inside ( p, widget, property );
|
||||||
|
}
|
||||||
|
|
|
@ -65,7 +65,12 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
element.normal.normal {
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
element normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -60,6 +60,10 @@ listview {
|
||||||
element {
|
element {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -111,6 +111,10 @@ element {
|
||||||
color: @foreground;
|
color: @foreground;
|
||||||
font:inherit;
|
font:inherit;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element selected.normal {
|
element selected.normal {
|
||||||
background-color: @blue;
|
background-color: @blue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -67,6 +67,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -148,6 +148,10 @@ element {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
padding: 4px ;
|
padding: 4px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -63,6 +63,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -125,3 +125,7 @@ textbox-prompt-sep {
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
margin: 0 0.3em 0 0;
|
margin: 0 0.3em 0 0;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
|
|
@ -64,6 +64,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -55,6 +55,10 @@ element {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
highlight: bold ;
|
highlight: bold ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element normal.normal {
|
element normal.normal {
|
||||||
text-color: #002B36FF;
|
text-color: #002B36FF;
|
||||||
background-color: #F5F5F500;
|
background-color: #F5F5F500;
|
||||||
|
|
|
@ -63,6 +63,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -76,6 +76,10 @@ listview {
|
||||||
dynamic: false;
|
dynamic: false;
|
||||||
lines: 0;
|
lines: 0;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element selected normal {
|
element selected normal {
|
||||||
background-color: @blue;
|
background-color: @blue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
|
@ -63,6 +63,10 @@ element {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 1px ;
|
padding: 1px ;
|
||||||
}
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
element.normal.normal {
|
element.normal.normal {
|
||||||
background-color: @normal-background;
|
background-color: @normal-background;
|
||||||
text-color: @normal-foreground;
|
text-color: @normal-foreground;
|
||||||
|
|
Loading…
Reference in a new issue