author | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
commit | a7e015198a8c5ad3b6e144a9032b059086253e00 (patch) (unidiff) | |
tree | b712b6f11310d88744fe393a92b3160b741a7efe /noncore/settings/appearance2/colorlistitem.h | |
parent | beba0e73306815337bf04dee39502233595e9739 (diff) | |
download | opie-a7e015198a8c5ad3b6e144a9032b059086253e00.zip opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.gz opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings/appearance2/colorlistitem.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/appearance2/colorlistitem.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/settings/appearance2/colorlistitem.h b/noncore/settings/appearance2/colorlistitem.h index 10e4468..f8d5c45 100644 --- a/noncore/settings/appearance2/colorlistitem.h +++ b/noncore/settings/appearance2/colorlistitem.h | |||
@@ -79,62 +79,63 @@ public: | |||
79 | for ( int i = 0; i < s_colorcount; i++ ) | 79 | for ( int i = 0; i < s_colorcount; i++ ) |
80 | cfg. writeEntry ( s_colorlut [i]. m_key, m_colors [i]. name ( )); | 80 | cfg. writeEntry ( s_colorlut [i]. m_key, m_colors [i]. name ( )); |
81 | return true; | 81 | return true; |
82 | } | 82 | } |
83 | 83 | ||
84 | QColor color ( QColorGroup::ColorRole role ) | 84 | QColor color ( QColorGroup::ColorRole role ) |
85 | { | 85 | { |
86 | int i = r2i ( role ); | 86 | int i = r2i ( role ); |
87 | return i >= 0 ? m_colors [i] : QColor ( ); | 87 | return i >= 0 ? m_colors [i] : QColor ( ); |
88 | } | 88 | } |
89 | 89 | ||
90 | void setColor ( QColorGroup::ColorRole role, QColor c ) | 90 | void setColor ( QColorGroup::ColorRole role, QColor c ) |
91 | { | 91 | { |
92 | int i = r2i ( role ); | 92 | int i = r2i ( role ); |
93 | if ( i >= 0 ) { | 93 | if ( i >= 0 ) { |
94 | m_colors [i] = c; | 94 | m_colors [i] = c; |
95 | buildPalette ( ); | 95 | buildPalette ( ); |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | QString label ( QColorGroup::ColorRole role ) | 99 | QString label ( QColorGroup::ColorRole role ) |
100 | { | 100 | { |
101 | int i = r2i ( role ); | 101 | int i = r2i ( role ); |
102 | return i >= 0 ? qApp-> translate ( "Appearance", s_colorlut [i]. m_label ) : QString::null; | 102 | return i >= 0 ? qApp-> translate ( "Appearance", s_colorlut [i]. m_label ) : QString::null; |
103 | } | 103 | } |
104 | 104 | ||
105 | private: | 105 | private: |
106 | QPalette m_palette; | 106 | QPalette m_palette; |
107 | QColor *m_colors; | 107 | QColor *m_colors; |
108 | 108 | ||
109 | static struct colorlut { | 109 | static struct colorlut { |
110 | QColorGroup::ColorRole m_role; | 110 | QColorGroup::ColorRole m_role; |
111 | const char * m_key; | 111 | const char * m_key; |
112 | const char * m_def; | 112 | const char * m_def; |
113 | const char * m_label; | 113 | const char * m_label; |
114 | } const s_colorlut []; | 114 | } const s_colorlut []; |
115 | static const int s_colorcount; | 115 | static const int s_colorcount; |
116 | 116 | ||
117 | static int r2i ( QColorGroup::ColorRole role ) | 117 | static int r2i ( QColorGroup::ColorRole role ) |
118 | { | 118 | { |
119 | for ( int i = 0; i < s_colorcount; i++ ) { | 119 | for ( int i = 0; i < s_colorcount; i++ ) { |
120 | if ( s_colorlut [i]. m_role == role ) | 120 | if ( s_colorlut [i]. m_role == role ) |
121 | return i; | 121 | return i; |
122 | } | 122 | } |
123 | return -1; | 123 | return -1; |
124 | } | 124 | } |
125 | }; | 125 | }; |
126 | 126 | ||
127 | // from etc/colors/Liquid.scheme | ||
127 | const ColorListItem::colorlut ColorListItem::s_colorlut [] = { | 128 | const ColorListItem::colorlut ColorListItem::s_colorlut [] = { |
128 | { QColorGroup::Base, "Base", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Base" ) }, | 129 | { QColorGroup::Base, "Base", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Base" ) }, |
129 | { QColorGroup::Background, "Background", "#E5E1D5", QT_TRANSLATE_NOOP( "Appearance", "Background" ) }, | 130 | { QColorGroup::Background, "Background", "#E0E0E0", QT_TRANSLATE_NOOP( "Appearance", "Background" ) }, |
130 | { QColorGroup::Button, "Button", "#D6CDBB", QT_TRANSLATE_NOOP( "Appearance", "Button" ) }, | 131 | { QColorGroup::Button, "Button", "#96c8fa", QT_TRANSLATE_NOOP( "Appearance", "Button" ) }, |
131 | { QColorGroup::ButtonText, "ButtonText", "#000000", QT_TRANSLATE_NOOP( "Appearance", "Button Text" ) }, | 132 | { QColorGroup::ButtonText, "ButtonText", "#000000", QT_TRANSLATE_NOOP( "Appearance", "Button Text" ) }, |
132 | { QColorGroup::Highlight, "Highlight", "#800000", QT_TRANSLATE_NOOP( "Appearance", "Highlight" ) }, | 133 | { QColorGroup::Highlight, "Highlight", "#73adef", QT_TRANSLATE_NOOP( "Appearance", "Highlight" ) }, |
133 | { QColorGroup::HighlightedText, "HighlightedText", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Highlighted Text" ) }, | 134 | { QColorGroup::HighlightedText, "HighlightedText", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Highlighted Text" ) }, |
134 | { QColorGroup::Text, "Text", "#000000", QT_TRANSLATE_NOOP( "Appearance", "Text" ) } | 135 | { QColorGroup::Text, "Text", "#000000", QT_TRANSLATE_NOOP( "Appearance", "Text" ) } |
135 | }; | 136 | }; |
136 | 137 | ||
137 | const int ColorListItem::s_colorcount = sizeof( s_colorlut ) / sizeof ( s_colorlut [0] ); | 138 | const int ColorListItem::s_colorcount = sizeof( s_colorlut ) / sizeof ( s_colorlut [0] ); |
138 | 139 | ||
139 | 140 | ||
140 | #endif | 141 | #endif |