From 599920c6cfd87a213634097045e29f592390438b Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Thu, 16 Jul 2015 11:39:27 +0200 Subject: 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 Signed-off-by: Lubomir I. Ivanov --- templatelayout.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'templatelayout.h') diff --git a/templatelayout.h b/templatelayout.h index 85a4699da..e37e9e868 100644 --- a/templatelayout.h +++ b/templatelayout.h @@ -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 -- cgit v1.2.3-70-g09d2