summaryrefslogtreecommitdiffstats
path: root/source/theme.c
diff options
context:
space:
mode:
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;
}