diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-16 18:56:01 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-16 18:56:01 +0300 |
commit | 69ea47be1cee7298b65db8104f1c88e51554ba48 (patch) | |
tree | bf4cf799be4d9ceacec548edcd1eff30db92d757 /src/ui/color.c | |
parent | 6d8bf2508f5e2af36b61cca42ed68cad26c41d56 (diff) |
Added Pure Black and Pure White themes
Font changes cause window redrawing to pause so document layout doesn’t get an intermediate update with a different width.
Sheets are mouse-modal.
Diffstat (limited to 'src/ui/color.c')
-rw-r--r-- | src/ui/color.c | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/src/ui/color.c b/src/ui/color.c index 27d613cc..7d6ab2c2 100644 --- a/src/ui/color.c +++ b/src/ui/color.c | |||
@@ -49,8 +49,49 @@ iLocalDef void copy_(enum iColorId dst, enum iColorId src) { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | void setThemePalette_Color(enum iColorTheme theme) { | 51 | void setThemePalette_Color(enum iColorTheme theme) { |
52 | memcpy(palette_, theme == dark_ColorTheme ? darkPalette_ : lightPalette_, sizeof(darkPalette_)); | 52 | memcpy(palette_, isDark_ColorTheme(theme) ? darkPalette_ : lightPalette_, sizeof(darkPalette_)); |
53 | switch (theme) { | 53 | switch (theme) { |
54 | case pureBlack_ColorTheme: | ||
55 | copy_(uiBackground_ColorId, black_ColorId); | ||
56 | copy_(uiBackgroundHover_ColorId, black_ColorId); | ||
57 | copy_(uiBackgroundPressed_ColorId, orange_ColorId); | ||
58 | copy_(uiBackgroundSelected_ColorId, teal_ColorId); | ||
59 | copy_(uiBackgroundFramelessHover_ColorId, teal_ColorId); | ||
60 | copy_(uiText_ColorId, gray75_ColorId); | ||
61 | copy_(uiTextPressed_ColorId, black_ColorId); | ||
62 | copy_(uiTextStrong_ColorId, white_ColorId); | ||
63 | copy_(uiTextSelected_ColorId, white_ColorId); | ||
64 | copy_(uiTextFramelessHover_ColorId, white_ColorId); | ||
65 | copy_(uiTextShortcut_ColorId, cyan_ColorId); | ||
66 | copy_(uiTextAction_ColorId, cyan_ColorId); | ||
67 | copy_(uiTextCaution_ColorId, orange_ColorId); | ||
68 | copy_(uiFrame_ColorId, black_ColorId); | ||
69 | copy_(uiEmboss1_ColorId, gray25_ColorId); | ||
70 | copy_(uiEmboss2_ColorId, black_ColorId); | ||
71 | copy_(uiEmbossHover1_ColorId, cyan_ColorId); | ||
72 | copy_(uiEmbossHover2_ColorId, teal_ColorId); | ||
73 | copy_(uiEmbossPressed1_ColorId, brown_ColorId); | ||
74 | copy_(uiEmbossPressed2_ColorId, gray75_ColorId); | ||
75 | copy_(uiEmbossSelected1_ColorId, cyan_ColorId); | ||
76 | copy_(uiEmbossSelected2_ColorId, black_ColorId); | ||
77 | copy_(uiEmbossSelectedHover1_ColorId, white_ColorId); | ||
78 | copy_(uiEmbossSelectedHover2_ColorId, cyan_ColorId); | ||
79 | copy_(uiInputBackground_ColorId, black_ColorId); | ||
80 | copy_(uiInputBackgroundFocused_ColorId, black_ColorId); | ||
81 | copy_(uiInputText_ColorId, gray75_ColorId); | ||
82 | copy_(uiInputTextFocused_ColorId, white_ColorId); | ||
83 | copy_(uiInputFrame_ColorId, gray25_ColorId); | ||
84 | copy_(uiInputFrameHover_ColorId, cyan_ColorId); | ||
85 | copy_(uiInputFrameFocused_ColorId, orange_ColorId); | ||
86 | copy_(uiInputCursor_ColorId, orange_ColorId); | ||
87 | copy_(uiInputCursorText_ColorId, black_ColorId); | ||
88 | copy_(uiHeading_ColorId, cyan_ColorId); | ||
89 | copy_(uiIcon_ColorId, teal_ColorId); | ||
90 | copy_(uiIconHover_ColorId, cyan_ColorId); | ||
91 | copy_(uiSeparator_ColorId, gray25_ColorId); | ||
92 | copy_(uiMarked_ColorId, brown_ColorId); | ||
93 | copy_(uiMatching_ColorId, teal_ColorId); | ||
94 | break; | ||
54 | default: | 95 | default: |
55 | case dark_ColorTheme: | 96 | case dark_ColorTheme: |
56 | copy_(uiBackground_ColorId, gray25_ColorId); | 97 | copy_(uiBackground_ColorId, gray25_ColorId); |
@@ -88,18 +129,59 @@ void setThemePalette_Color(enum iColorTheme theme) { | |||
88 | copy_(uiInputCursorText_ColorId, black_ColorId); | 129 | copy_(uiInputCursorText_ColorId, black_ColorId); |
89 | copy_(uiHeading_ColorId, cyan_ColorId); | 130 | copy_(uiHeading_ColorId, cyan_ColorId); |
90 | copy_(uiIcon_ColorId, cyan_ColorId); | 131 | copy_(uiIcon_ColorId, cyan_ColorId); |
132 | copy_(uiIconHover_ColorId, cyan_ColorId); | ||
91 | copy_(uiSeparator_ColorId, black_ColorId); | 133 | copy_(uiSeparator_ColorId, black_ColorId); |
92 | copy_(uiMarked_ColorId, brown_ColorId); | 134 | copy_(uiMarked_ColorId, brown_ColorId); |
93 | copy_(uiMatching_ColorId, teal_ColorId); | 135 | copy_(uiMatching_ColorId, teal_ColorId); |
94 | break; | 136 | break; |
95 | case light_ColorTheme: | 137 | case light_ColorTheme: |
138 | copy_(uiBackground_ColorId, gray75_ColorId); | ||
139 | copy_(uiBackgroundHover_ColorId, gray75_ColorId); | ||
140 | copy_(uiBackgroundSelected_ColorId, orange_ColorId); | ||
141 | copy_(uiBackgroundPressed_ColorId, cyan_ColorId); | ||
142 | copy_(uiBackgroundFramelessHover_ColorId, orange_ColorId); | ||
143 | copy_(uiText_ColorId, black_ColorId); | ||
144 | copy_(uiTextStrong_ColorId, brown_ColorId); | ||
145 | copy_(uiTextPressed_ColorId, black_ColorId); | ||
146 | copy_(uiTextSelected_ColorId, black_ColorId); | ||
147 | copy_(uiTextFramelessHover_ColorId, black_ColorId); | ||
148 | copy_(uiTextShortcut_ColorId, brown_ColorId); | ||
149 | copy_(uiTextAction_ColorId, brown_ColorId); | ||
150 | copy_(uiTextCaution_ColorId, teal_ColorId); | ||
151 | copy_(uiFrame_ColorId, gray50_ColorId); | ||
152 | copy_(uiEmboss1_ColorId, white_ColorId); | ||
153 | copy_(uiEmboss2_ColorId, gray50_ColorId); | ||
154 | copy_(uiEmbossHover1_ColorId, gray50_ColorId); | ||
155 | copy_(uiEmbossHover2_ColorId, gray25_ColorId); | ||
156 | copy_(uiEmbossPressed1_ColorId, black_ColorId); | ||
157 | copy_(uiEmbossPressed2_ColorId, white_ColorId); | ||
158 | copy_(uiEmbossSelected1_ColorId, white_ColorId); | ||
159 | copy_(uiEmbossSelected2_ColorId, brown_ColorId); | ||
160 | copy_(uiEmbossSelectedHover1_ColorId, brown_ColorId); | ||
161 | copy_(uiEmbossSelectedHover2_ColorId, brown_ColorId); | ||
162 | copy_(uiInputBackground_ColorId, white_ColorId); | ||
163 | copy_(uiInputBackgroundFocused_ColorId, white_ColorId); | ||
164 | copy_(uiInputText_ColorId, gray25_ColorId); | ||
165 | copy_(uiInputTextFocused_ColorId, black_ColorId); | ||
166 | copy_(uiInputFrame_ColorId, gray25_ColorId); | ||
167 | copy_(uiInputFrameHover_ColorId, brown_ColorId); | ||
168 | copy_(uiInputFrameFocused_ColorId, teal_ColorId); | ||
169 | copy_(uiInputCursor_ColorId, teal_ColorId); | ||
170 | copy_(uiInputCursorText_ColorId, white_ColorId); | ||
171 | copy_(uiHeading_ColorId, brown_ColorId); | ||
172 | copy_(uiIcon_ColorId, brown_ColorId); | ||
173 | copy_(uiIconHover_ColorId, brown_ColorId); | ||
174 | copy_(uiSeparator_ColorId, gray25_ColorId); | ||
175 | copy_(uiMarked_ColorId, cyan_ColorId); | ||
176 | copy_(uiMatching_ColorId, orange_ColorId); | ||
177 | break; | ||
178 | case pureWhite_ColorTheme: | ||
96 | copy_(uiBackground_ColorId, white_ColorId); | 179 | copy_(uiBackground_ColorId, white_ColorId); |
97 | copy_(uiBackgroundHover_ColorId, gray75_ColorId); | 180 | copy_(uiBackgroundHover_ColorId, gray75_ColorId); |
98 | copy_(uiBackgroundSelected_ColorId, orange_ColorId); | 181 | copy_(uiBackgroundSelected_ColorId, orange_ColorId); |
99 | copy_(uiBackgroundPressed_ColorId, cyan_ColorId); | 182 | copy_(uiBackgroundPressed_ColorId, cyan_ColorId); |
100 | copy_(uiBackgroundFramelessHover_ColorId, orange_ColorId); | 183 | copy_(uiBackgroundFramelessHover_ColorId, orange_ColorId); |
101 | copy_(uiText_ColorId, gray25_ColorId); | 184 | copy_(uiText_ColorId, gray25_ColorId); |
102 | copy_(uiTextStrong_ColorId, black_ColorId); | ||
103 | copy_(uiTextPressed_ColorId, black_ColorId); | 185 | copy_(uiTextPressed_ColorId, black_ColorId); |
104 | copy_(uiTextStrong_ColorId, black_ColorId); | 186 | copy_(uiTextStrong_ColorId, black_ColorId); |
105 | copy_(uiTextSelected_ColorId, black_ColorId); | 187 | copy_(uiTextSelected_ColorId, black_ColorId); |
@@ -129,6 +211,7 @@ void setThemePalette_Color(enum iColorTheme theme) { | |||
129 | copy_(uiInputCursorText_ColorId, white_ColorId); | 211 | copy_(uiInputCursorText_ColorId, white_ColorId); |
130 | copy_(uiHeading_ColorId, brown_ColorId); | 212 | copy_(uiHeading_ColorId, brown_ColorId); |
131 | copy_(uiIcon_ColorId, brown_ColorId); | 213 | copy_(uiIcon_ColorId, brown_ColorId); |
214 | copy_(uiIconHover_ColorId, brown_ColorId); | ||
132 | copy_(uiSeparator_ColorId, gray50_ColorId); | 215 | copy_(uiSeparator_ColorId, gray50_ColorId); |
133 | copy_(uiMarked_ColorId, cyan_ColorId); | 216 | copy_(uiMarked_ColorId, cyan_ColorId); |
134 | copy_(uiMatching_ColorId, orange_ColorId); | 217 | copy_(uiMatching_ColorId, orange_ColorId); |