[gnome-calendar] css-code: added harcoded styles of widgets



commit a704b244b93bbeb3715ae65640b1dec11f741dbf
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu Jan 22 13:46:54 2015 -0500

    css-code: added harcoded styles of widgets

 src/Makefile.am |    1 +
 src/css-code.h  |  151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index a9f8bfc..3400e11 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,6 +23,7 @@ gnome_calendar_SOURCES =                                  \
     e-cal-data-model.h                                    \
     e-cal-data-model.c                                    \
     main.c                                                \
+    css-code.h                                            \
     gcal-application.h                                    \
     gcal-application.c                                    \
     gcal-window.h                                         \
diff --git a/src/css-code.h b/src/css-code.h
new file mode 100644
index 0000000..ebd0f74
--- /dev/null
+++ b/src/css-code.h
@@ -0,0 +1,151 @@
+/* css-code.h
+ *
+ * Copyright (C) 2015 Erick Pérez Castellanos <erick red gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CSS_CODE_H
+#define CSS_CODE_H
+
+#define CSS_TEMPLATE "GcalEventWidget.color-%d {"\
+                     "  background-color: %s;"\
+                     "}"
+
+#define CSS_TEMPLATE_EDGE_BOTH "GcalEventWidget.color-%d.slanted:dir(ltr) {"\
+                               "  background-color: transparent;"\
+                               "  padding: 0 2em;"\
+                               "  border-radius: 0;"\
+                               "  background-image: linear-gradient(-80deg, %s,"\
+                               "                                    %s 40%%,"\
+                               "                                    alpha(%s, 0) 45%%,"\
+                               "                                    alpha(%s, 0) 60%%,"\
+                               "                                    %s 65%%,"\
+                               "                                    %s 75%%,"\
+                               "                                    alpha(%s, 0) 80%%),"\
+                               "                    linear-gradient(100deg, %s,"\
+                               "                                    %s 40%%,"\
+                               "                                    alpha(%s, 0) 45%%,"\
+                               "                                    alpha(%s, 0) 60%%,"\
+                               "                                    %s 65%%,"\
+                               "                                    %s 75%%,"\
+                               "                                    alpha(%s, 0) 80%%),"\
+                               "                    linear-gradient(to top, %s);"\
+                               "  background-size: 2em, 2em, 100%% 100%%;"\
+                               "  background-repeat: no-repeat;"\
+                               "  background-clip: border-box, border-box, content-box;"\
+                               "  background-position: top left, top right;"\
+                               "}"
+
+#define CSS_TEMPLATE_EDGE_BOTH_RTL "GcalEventWidget.color-%d.slanted:dir(rtl) {"\
+                                   "  background-color: transparent;"\
+                                   "  padding: 0 2em;"\
+                                   "  border-radius: 0;"\
+                                   "  background-image: linear-gradient(-100deg, %s,"\
+                                   "                                    %s 40%%,"\
+                                   "                                    alpha(%s, 0) 45%%,"\
+                                   "                                    alpha(%s, 0) 60%%,"\
+                                   "                                    %s 65%%,"\
+                                   "                                    %s 75%%,"\
+                                   "                                    alpha(%s, 0) 80%%),"\
+                                   "                    linear-gradient(80deg, %s,"\
+                                   "                                    %s 40%%,"\
+                                   "                                    alpha(%s, 0) 45%%,"\
+                                   "                                    alpha(%s, 0) 60%%,"\
+                                   "                                    %s 65%%,"\
+                                   "                                    %s 75%%,"\
+                                   "                                    alpha(%s, 0) 80%%),"\
+                                   "                    linear-gradient(to top, %s);"\
+                                   "  background-size: 2em, 2em, 100%% 100%%;"\
+                                   "  background-repeat: no-repeat;"\
+                                   "  background-clip: border-box, border-box, content-box;"\
+                                   "  background-position: top left, top right;"\
+                                   "}"
+
+#define CSS_TEMPLATE_EDGE "GcalEventWidget.color-%d.slanted-end:dir(ltr) {"\
+                          "  background-color: transparent;"\
+                          "  padding-right: 2em;"\
+                          "  border-top-right-radius: 0;"\
+                          "  border-bottom-right-radius: 0;"\
+                          "  background-image: linear-gradient(100deg, %s,"\
+                          "                                    %s 40%%,"\
+                          "                                    alpha(%s, 0) 45%%,"\
+                          "                                    alpha(%s, 0) 60%%,"\
+                          "                                    %s 65%%,"\
+                          "                                    %s 75%%,"\
+                          "                                    alpha(%s, 0) 80%%),"\
+                          "                    linear-gradient(to top, %s);"\
+                          "  background-size: 2em, 100%% 100%%;"\
+                          "  background-repeat: no-repeat;"\
+                          "  background-position: top right, -2em;"\
+                          "}"
+
+#define CSS_TEMPLATE_EDGE_START "GcalEventWidget.color-%d.slanted-start:dir(ltr) {"\
+                                "  background-color: transparent;"\
+                                "  padding-left: 2em;"\
+                                "  border-top-left-radius: 0;"\
+                                "  border-bottom-left-radius: 0;"\
+                                "  background-image: linear-gradient(-80deg, %s,"\
+                                "                                    %s 40%%,"\
+                                "                                    alpha(%s, 0) 45%%,"\
+                                "                                    alpha(%s, 0) 60%%,"\
+                                "                                    %s 65%%,"\
+                                "                                    %s 75%%,"\
+                                "                                    alpha(%s, 0) 80%%),"\
+                                "                    linear-gradient(to top, %s);"\
+                                "  background-size: 2em, 100%% 100%%;"\
+                                "  background-repeat: no-repeat;"\
+                                "  background-position: top left, 2em;"\
+                                "}"
+
+#define CSS_TEMPLATE_EDGE_RTL "GcalEventWidget.color-%d.slanted-end:dir(rtl) {"\
+                              "  background-color: transparent;"\
+                              "  padding-left: 2em;"\
+                              "  border-top-left-radius: 0;"\
+                              "  border-bottom-left-radius: 0;"\
+                              "  background-image: linear-gradient(-100deg, %s,"\
+                              "                                    %s 40%%,"\
+                              "                                    alpha(%s, 0) 45%%,"\
+                              "                                    alpha(%s, 0) 60%%,"\
+                              "                                    %s 65%%,"\
+                              "                                    %s 75%%,"\
+                              "                                    alpha(%s, 0) 80%%),"\
+                              "                    linear-gradient(to top, %s);"\
+                              "  background-size: 2em, 100%% 100%%;"\
+                              "  background-repeat: no-repeat;"\
+                              "  background-position: top left, 2em;"\
+                              "}"
+
+#define CSS_TEMPLATE_EDGE_START_RTL "GcalEventWidget.color-%d.slanted-start:dir(rtl) {"\
+                                    "  background-color: transparent;"\
+                                    "  padding-right: 2em;"\
+                                    "  border-top-right-radius: 0;"\
+                                    "  border-bottom-right-radius: 0;"\
+                                    "  background-image: linear-gradient(80deg, %s,"\
+                                    "                                    %s 40%%,"\
+                                    "                                    alpha(%s, 0) 45%%,"\
+                                    "                                    alpha(%s, 0) 60%%,"\
+                                    "                                    %s 65%%,"\
+                                    "                                    %s 75%%,"\
+                                    "                                    alpha(%s, 0) 80%%),"\
+                                    "                    linear-gradient(to top, %s);"\
+                                    "  background-size: 2em, 100%% 100%%;"\
+                                    "  background-repeat: no-repeat;"\
+                                    "  background-position: top right, -2em;"\
+                                    "}"
+
+
+
+#endif /* CSS_CODE_H */
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]