65d1a4557e6d0ebccd5df7ff78f7bcd80376ad9e
[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 settingsSortOrder("sort-order");
17 static QString settingsDefaultCourses("default-courses");
18
19 #ifndef WANT_DEBUG
20 #define TRACE
21 #else
22 #include <QDebug>
23 #define TRACE qDebug()<<QString("[%1] %2(): %3").arg(__FILE__).arg(__func__).arg(__LINE__);
24 #endif
25
26 static int fontSize = 20;
27
28 class AppSettings {
29 public:
30     QVariant hcp;
31     QVariant homeClub;
32     QVariant sortOrder;
33     QVariant defaultCourses;
34 };
35
36 class ScoreColor
37 {
38  public:
39     static QColor holeBg()      { return Qt::white;                }
40     static QColor holeFg()      { return Qt::yellow;               }
41     static QColor birdie()      { return Qt::yellow;               }
42     static QColor par()         { return Qt::green;                }
43     static QColor bogey()       { return Qt::cyan;                 }
44     static QColor doubleBogey() { return Qt::red;                  }
45     static QColor bad()         { return Qt::red;                  }
46     static QColor subTotal()    { return Qt::white;                }
47     static QColor total()       { return Qt::white;                }
48 }; 
49
50 static QString statStyleSheet("QTableView {color : white;}");
51 static QString defaultStyleSheet("QTableView {"
52                                  "background-color: white;"
53                                  "color : gray;"
54                                  "border: solid green;"
55                                  "}"
56                                  "QHeaderView::section {"
57                                  "color : white;"
58                                  "border: solid green;"
59                                  "}");
60 #if 0
61 "QAbstractItemView::item[role=\"header\"]{"
62 "background : orange;"
63 "color : yellow;"
64 "border: solid green;"
65 "font-size : 16px;"
66 "}"
67 "QAbstractItemView::item"
68 "background : orange;"
69 "color : white;"
70 "border: solid green;"
71 "font-size : 16px;"
72 "}"
73 "QTableView {"
74 "alternate-background-color: yellow;"
75 "background-color: red;"
76 "color : blue;"
77 "border: solid green;"
78 "gridline-color: green;"
79 "}"
80 #endif
81 #endif