summaryrefslogtreecommitdiffstats
path: root/source/theme.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-04-24 18:17:01 +0200
committerDave Davenport <qball@gmpclient.org>2020-04-24 18:17:01 +0200
commit81b00705e848d6968f8462d64f2e8035b7593804 (patch)
tree523506cae7120bc80c1234c94c1f0a4e1cd66bc6 /source/theme.c
parentfc727fef91eb276d8b9a1cf8ed8f5934ae209f59 (diff)
[Theme] Add modulo to calc.i1088
Diffstat (limited to 'source/theme.c')
-rw-r--r--source/theme.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/theme.c b/source/theme.c
index 1a7fe863..85bf7c86 100644
--- a/source/theme.c
+++ b/source/theme.c
@@ -290,6 +290,8 @@ static void rofi_theme_print_distance_unit ( RofiDistanceUnit *unit )
fputs ( " / ", stdout );
} else if ( unit->modtype == ROFI_DISTANCE_MODIFIER_MULTIPLY) {
fputs ( " * ", stdout );
+ } else if ( unit->modtype == ROFI_DISTANCE_MODIFIER_MODULO) {
+ fputs ( " % ", stdout );
}
if ( unit->right )
rofi_theme_print_distance_unit ( unit->right );
@@ -966,6 +968,15 @@ static int distance_unit_get_pixel ( RofiDistanceUnit *unit, RofiOrientation ori
}
return a;
}
+ case ROFI_DISTANCE_MODIFIER_MODULO:
+ {
+ int a = distance_unit_get_pixel ( unit->left, ori);
+ int b = distance_unit_get_pixel ( unit->right, ori);
+ if ( b != 0 ) {
+ return a%b;
+ }
+ return 0;
+ }
default:
break;
}