52dc8c63e8fd0508a9a5c03de374fa2ab1730ae5
[scorecard] / src / score-common.h
1 /*
2  * Copyright (C) 2009 Sakari Poussa
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, version 2.
7  */
8 #ifndef SCORE_COMMON_H
9 #define SCORE_COMMON_H
10
11 #include <QColor>
12
13 static QString settingsGroup("Settings");
14 static QString settingsHcp("hcp");
15 static QString settingsHomeClub("home-club");
16 static QString settingsDefaultCourses("default-courses");
17
18 #ifndef WANT_DEBUG
19 #define TRACE
20 #else
21 #include <QDebug>
22 #define TRACE qDebug()<<QString("[%1] %2(): %3").arg(__FILE__).arg(__func__).arg(__LINE__);
23 #endif
24
25 static int fontSize = 20;
26
27 class AppSettings {
28 public:
29     QVariant hcp;
30     QVariant homeClub;
31     QVariant defaultCourses;
32 };
33
34 class ScoreColor
35 {
36  public:
37     static QColor holeBg()      { return Qt::white;                }
38     static QColor holeFg()      { return Qt::yellow;               }
39     static QColor birdie()      { return Qt::yellow;               }
40     static QColor par()         { return Qt::green;                }
41     static QColor bogey()       { return Qt::cyan;                 }
42     static QColor doubleBogey() { return Qt::red;                  }
43     static QColor bad()         { return Qt::red;                  }
44     static QColor subTotal()    { return Qt::white;                }
45     static QColor total()       { return Qt::white;                }
46 }; 
47
48 static QString statStyleSheet("QTableView {color : white;}");
49 static QString defaultStyleSheet("QTableView {"
50                                  "background-color: white;"
51                                  "color : gray;"
52                                  "border: solid green;"
53                                  "}"
54                                  "QHeaderView::section {"
55                                  "color : white;"
56                                  "border: solid green;"
57                                  "}");
58 #if 0
59 "QAbstractItemView::item[role=\"header\"]{"
60 "background : orange;"
61 "color : yellow;"
62 "border: solid green;"
63 "font-size : 16px;"
64 "}"
65 "QAbstractItemView::item"
66 "background : orange;"
67 "color : white;"
68 "border: solid green;"
69 "font-size : 16px;"
70 "}"
71 "QTableView {"
72 "alternate-background-color: yellow;"
73 "background-color: red;"
74 "color : blue;"
75 "border: solid green;"
76 "gridline-color: green;"
77 "}"
78 #endif
79 #endif