- Add non-volatile settings for hcp, home club, etc.
[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 #if 0
12 #define SC_BLUE_THEME
13
14 QColor colorHoleBg(64, 64, 64);
15 QColor colorHoleFg(Qt::yellow);
16 QColor colorBirdie(00, 0x99, 00);
17 QColor colorPar(Qt::black);
18 #ifdef SC_ORANGE_THEME
19 QColor colorBogey(0xfc, 0xaf, 0x3e);
20 QColor colorDoubleBogey(0xf5, 0x79, 0x00);
21 QColor colorBad(0xce, 0x5c, 0x00);
22 #endif
23 #ifdef SC_BLUE_THEME
24 QColor colorBogey(0x20, 0x4a, 0x87);
25 QColor colorDoubleBogey(0x34, 0x65, 0xa4);
26 QColor colorBad(0x72, 0x9f, 0xcf);
27 #endif
28 QColor colorSubTotal(Qt::black);
29 QColor colorTotal(Qt::black);
30 #endif
31
32 #include <QColor>
33
34 class AppSettings {
35 public:
36     QVariant hcp;
37     QVariant homeClub;
38     QVariant defaultCourses;
39 };
40
41 class ScoreColor
42 {
43  public:
44     static QColor holeBg()      { return Qt::white;                }
45     static QColor holeFg()      { return Qt::yellow;               }
46     static QColor birdie()      { return Qt::yellow;               }
47     static QColor par()         { return Qt::green;                }
48     static QColor bogey()       { return Qt::cyan;                 }
49     static QColor doubleBogey() { return Qt::red;                  }
50     static QColor bad()         { return Qt::red;                  }
51     static QColor subTotal()    { return Qt::white;                }
52     static QColor total()       { return Qt::white;                }
53 }; 
54
55 class ScoreStyle {
56 public:
57     static QString style()
58     {
59         return QString("QTableView {"
60                          "background-color: white;"
61                          "color : gray;"
62                          "border: solid green;"
63                          "font-size : 20px;"
64                          "font-style : italic;"
65                        "}"
66                        "QHeaderView::section {"
67                          "color : white;"
68                          "border: solid green;"
69                          "font: bold italic large;"
70                        "}");
71
72 #if 0
73                        "QAbstractItemView::item[role=\"header\"]{"
74                          "background : orange;"
75                          "color : yellow;"
76                          "border: solid green;"
77                          "font-size : 16px;"
78                        "}"
79                        "QAbstractItemView::item"
80                          "background : orange;"
81                          "color : white;"
82                          "border: solid green;"
83                          "font-size : 16px;"
84                        "}"
85                        "QTableView {"
86                          "alternate-background-color: yellow;"
87                          "background-color: red;"
88                          "color : blue;"
89                          "border: solid green;"
90                          "gridline-color: green;"
91                        "}"
92
93 #endif
94     }
95     static QString headerView()
96     {
97         return QString("QHeaderView::section { background-color : #404040 }");
98         //return QString("QHeaderView { background-color : #404040 }");
99         return QString("QTableView { background-color : red }");
100     }
101 };
102
103 #endif