Printing: export grayscale filter value to template

Export grayscale value to Grantlee template, So we must declare
print_options as QMetatype.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Gehad elrobey 2015-07-16 11:39:27 +02:00 committed by Lubomir I. Ivanov
parent d2bc70a570
commit 599920c6cf
2 changed files with 13 additions and 0 deletions

View file

@ -79,6 +79,7 @@ public:
Q_DECLARE_METATYPE(Dive)
Q_DECLARE_METATYPE(template_options)
Q_DECLARE_METATYPE(print_options)
GRANTLEE_BEGIN_LOOKUP(Dive)
if (property == "number")
@ -136,4 +137,14 @@ if (property == "font") {
}
GRANTLEE_END_LOOKUP
GRANTLEE_BEGIN_LOOKUP(print_options)
if (property == "grayscale") {
if (object.color_selected) {
return "";
} else {
return "-webkit-filter: grayscale(100%)";
}
}
GRANTLEE_END_LOOKUP
#endif