diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-04-24 18:17:01 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-04-24 18:17:01 +0200 |
commit | 81b00705e848d6968f8462d64f2e8035b7593804 (patch) | |
tree | 523506cae7120bc80c1234c94c1f0a4e1cd66bc6 /source/theme.c | |
parent | fc727fef91eb276d8b9a1cf8ed8f5934ae209f59 (diff) |
[Theme] Add modulo to calc.i1088
Diffstat (limited to 'source/theme.c')
-rw-r--r-- | source/theme.c | 11 |
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; } |