Merge lp:~ksamak/compiz/switcher_add_size_multiplier into lp:compiz/0.9.13
- switcher_add_size_multiplier
- Merge into 0.9.13
Status: | Superseded |
---|---|
Proposed branch: | lp:~ksamak/compiz/switcher_add_size_multiplier |
Merge into: | lp:compiz/0.9.13 |
Diff against target: |
372 lines (+121/-71) 3 files modified
plugins/switcher/src/switcher.cpp (+99/-68) plugins/switcher/src/switcher.h (+14/-3) plugins/switcher/switcher.xml.in (+8/-0) |
To merge this branch: | bzr merge lp:~ksamak/compiz/switcher_add_size_multiplier |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Pending | ||
Review via email: mp+299071@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-07-09.
Commit message
switcher: adds a size multiplier for A11Y purposes (sight impaired people)
Description of the change
this patch adds a size modifier to the base switcher, for sight impaired people.
It allows to set a variable in ccsm that will make the switchWindow bigger
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
ksamak (ksamak) wrote : | # |
On Tue, Jul 05, 2016 at 10:38:13AM -0000, Marco Trevisan (Treviño) wrote:
> I see some indentation issues, but a part from that it looks ok
You want me to have a look, and try to straighten that?
i guess should re-request a merge then.
--
Ksamak
hypra.fr Team
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
No need to re-request a merge. Just update this branch; MP will update automatically.
Just comment here once you've done.
ksamak (ksamak) wrote : | # |
indents modifs done.
I just remember i need to set noexpandtab in my vim. differences didn't appear in my buffer.
don't know if you can squash commits with bzr too (like in git) to get rid of parasite revisions.
Unmerged revisions
Preview Diff
1 | === modified file 'plugins/switcher/src/switcher.cpp' | |||
2 | --- plugins/switcher/src/switcher.cpp 2015-08-22 21:46:01 +0000 | |||
3 | +++ plugins/switcher/src/switcher.cpp 2016-07-05 14:10:56 +0000 | |||
4 | @@ -20,7 +20,9 @@ | |||
5 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
6 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
7 | 22 | * | 22 | * |
9 | 23 | * Author: David Reveman <davidr@novell.com> | 23 | * Author(s): |
10 | 24 | * - David Reveman <davidr@novell.com> | ||
11 | 25 | * - Auboyneau Vincent <ksamak@riseup.net> (size multiplier for A11Y) | ||
12 | 24 | */ | 26 | */ |
13 | 25 | 27 | ||
14 | 26 | #include "switcher.h" | 28 | #include "switcher.h" |
15 | @@ -35,36 +37,6 @@ | |||
16 | 35 | 37 | ||
17 | 36 | #define XWINDOWCHANGES_INIT {0, 0, 0, 0, 0, None, 0} | 38 | #define XWINDOWCHANGES_INIT {0, 0, 0, 0, 0, None, 0} |
18 | 37 | 39 | ||
19 | 38 | static float _boxVertices[] = | ||
20 | 39 | { | ||
21 | 40 | -(WIDTH >> 1), BOX_WIDTH, 0.0f, | ||
22 | 41 | (WIDTH >> 1), BOX_WIDTH, 0.0f, | ||
23 | 42 | -(WIDTH >> 1), 0.0f, 0.0f, | ||
24 | 43 | -(WIDTH >> 1), 0.0f, 0.0f, | ||
25 | 44 | (WIDTH >> 1), BOX_WIDTH, 0.0f, | ||
26 | 45 | (WIDTH >> 1), 0.0f, 0.0f, | ||
27 | 46 | |||
28 | 47 | -(WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f, | ||
29 | 48 | -(WIDTH >> 1) + BOX_WIDTH, HEIGHT - BOX_WIDTH, 0.0f, | ||
30 | 49 | -(WIDTH >> 1), BOX_WIDTH, 0.0f, | ||
31 | 50 | -(WIDTH >> 1), BOX_WIDTH, 0.0f, | ||
32 | 51 | -(WIDTH >> 1) + BOX_WIDTH, HEIGHT - BOX_WIDTH, 0.0f, | ||
33 | 52 | -(WIDTH >> 1) + BOX_WIDTH, BOX_WIDTH, 0.0f, | ||
34 | 53 | |||
35 | 54 | (WIDTH >> 1) - BOX_WIDTH, HEIGHT - BOX_WIDTH, 0.0f, | ||
36 | 55 | (WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f, | ||
37 | 56 | (WIDTH >> 1) - BOX_WIDTH, BOX_WIDTH, 0.0f, | ||
38 | 57 | (WIDTH >> 1) - BOX_WIDTH, BOX_WIDTH, 0.0f, | ||
39 | 58 | (WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f, | ||
40 | 59 | (WIDTH >> 1), BOX_WIDTH, 0.0f, | ||
41 | 60 | |||
42 | 61 | -(WIDTH >> 1), HEIGHT, 0.0f, | ||
43 | 62 | (WIDTH >> 1), HEIGHT, 0.0f, | ||
44 | 63 | -(WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f, | ||
45 | 64 | -(WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f, | ||
46 | 65 | (WIDTH >> 1), HEIGHT, 0.0f, | ||
47 | 66 | (WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f, | ||
48 | 67 | }; | ||
49 | 68 | 40 | ||
50 | 69 | void | 41 | void |
51 | 70 | SwitchScreen::updateWindowList (int count) | 42 | SwitchScreen::updateWindowList (int count) |
52 | @@ -78,7 +50,7 @@ | |||
53 | 78 | count = 3; | 50 | count = 3; |
54 | 79 | } | 51 | } |
55 | 80 | 52 | ||
57 | 81 | pos = ((count >> 1) - (int)windows.size ()) * WIDTH; | 53 | pos = ((count >> 1) - (int)windows.size ()) * static_cast<int>(WIDTH * sm); |
58 | 82 | move = 0; | 54 | move = 0; |
59 | 83 | 55 | ||
60 | 84 | selectedWindow = windows.front (); | 56 | selectedWindow = windows.front (); |
61 | @@ -184,9 +156,9 @@ | |||
62 | 184 | SwitchScreen::handleSelectionChange (bool toNext, int nextIdx) | 156 | SwitchScreen::handleSelectionChange (bool toNext, int nextIdx) |
63 | 185 | { | 157 | { |
64 | 186 | if (toNext) | 158 | if (toNext) |
66 | 187 | move -= WIDTH; | 159 | move -= static_cast<int>(WIDTH * sm); |
67 | 188 | else | 160 | else |
69 | 189 | move += WIDTH; | 161 | move += static_cast<int>(WIDTH * sm); |
70 | 190 | 162 | ||
71 | 191 | moreAdjust = true; | 163 | moreAdjust = true; |
72 | 192 | } | 164 | } |
73 | @@ -532,7 +504,7 @@ | |||
74 | 532 | 504 | ||
75 | 533 | updateWindowList (count); | 505 | updateWindowList (count); |
76 | 534 | 506 | ||
78 | 535 | allWindowsWidth = windows.size () * WIDTH; | 507 | allWindowsWidth = windows.size () * static_cast<int>(WIDTH * sm); |
79 | 536 | 508 | ||
80 | 537 | foreach (CompWindow *win, windows) | 509 | foreach (CompWindow *win, windows) |
81 | 538 | { | 510 | { |
82 | @@ -541,7 +513,7 @@ | |||
83 | 541 | if (selectedWindow == selected) | 513 | if (selectedWindow == selected) |
84 | 542 | break; | 514 | break; |
85 | 543 | 515 | ||
87 | 544 | pos -= WIDTH; | 516 | pos -= static_cast<int>(WIDTH * sm); |
88 | 545 | if (pos < -allWindowsWidth) | 517 | if (pos < -allWindowsWidth) |
89 | 546 | pos += allWindowsWidth; | 518 | pos += allWindowsWidth; |
90 | 547 | } | 519 | } |
91 | @@ -650,7 +622,7 @@ | |||
92 | 650 | float amount, chunk; | 622 | float amount, chunk; |
93 | 651 | int allWindowsWidth; | 623 | int allWindowsWidth; |
94 | 652 | 624 | ||
96 | 653 | allWindowsWidth = windows.size () * WIDTH; | 625 | allWindowsWidth = windows.size () * static_cast<int>(WIDTH * sm); |
97 | 654 | 626 | ||
98 | 655 | amount = msSinceLastPaint * 0.05f * optionGetSpeed (); | 627 | amount = msSinceLastPaint * 0.05f * optionGetSpeed (); |
99 | 656 | steps = amount / (0.5f * optionGetTimestep ()); | 628 | steps = amount / (0.5f * optionGetTimestep ()); |
100 | @@ -878,10 +850,10 @@ | |||
101 | 878 | mask, | 850 | mask, |
102 | 879 | x, | 851 | x, |
103 | 880 | y, | 852 | y, |
108 | 881 | WIDTH - (SPACE << 1), | 853 | static_cast<int>(WIDTH * sm) - (SPACE << 1), |
109 | 882 | HEIGHT - (SPACE << 1), | 854 | static_cast<int>(HEIGHT * sm) - (SPACE << 1), |
110 | 883 | WIDTH - (WIDTH >> 2), | 855 | static_cast<int>(WIDTH * sm) - (static_cast<int>(WIDTH * sm) >> 2), |
111 | 884 | HEIGHT - (HEIGHT >> 2)); | 856 | static_cast<int>(HEIGHT * sm) - (static_cast<int>(HEIGHT * sm) >> 2)); |
112 | 885 | } | 857 | } |
113 | 886 | 858 | ||
114 | 887 | void | 859 | void |
115 | @@ -901,8 +873,8 @@ | |||
116 | 901 | else | 873 | else |
117 | 902 | sAttrib.xScale = sAttrib.yScale; | 874 | sAttrib.xScale = sAttrib.yScale; |
118 | 903 | 875 | ||
121 | 904 | wx = x + WIDTH - icon->width () * sAttrib.xScale - SPACE; | 876 | wx = x + static_cast<int>(WIDTH * sm) - icon->width () * sAttrib.xScale - SPACE; |
122 | 905 | wy = y + HEIGHT - icon->height () * sAttrib.yScale - SPACE; | 877 | wy = y + static_cast<int>(HEIGHT * sm) - icon->height () * sAttrib.yScale - SPACE; |
123 | 906 | } | 878 | } |
124 | 907 | 879 | ||
125 | 908 | void | 880 | void |
126 | @@ -931,8 +903,8 @@ | |||
127 | 931 | width = icon->width () * sAttrib.xScale; | 903 | width = icon->width () * sAttrib.xScale; |
128 | 932 | height = icon->height () * sAttrib.yScale; | 904 | height = icon->height () * sAttrib.yScale; |
129 | 933 | 905 | ||
132 | 934 | wx = x + SPACE + ((WIDTH - (SPACE << 1)) - width) / 2; | 906 | wx = x + SPACE + ((static_cast<int>(WIDTH * sm) - (SPACE << 1)) - width) / 2; |
133 | 935 | wy = y + SPACE + ((HEIGHT - (SPACE << 1)) - height) / 2; | 907 | wy = y + SPACE + ((static_cast<int>(HEIGHT * sm) - (SPACE << 1)) - height) / 2; |
134 | 936 | } | 908 | } |
135 | 937 | 909 | ||
136 | 938 | void | 910 | void |
137 | @@ -943,8 +915,8 @@ | |||
138 | 943 | float width, | 915 | float width, |
139 | 944 | float height) | 916 | float height) |
140 | 945 | { | 917 | { |
143 | 946 | wx = x + SPACE + ((WIDTH - (SPACE << 1)) - width) / 2; | 918 | wx = x + SPACE + ((static_cast<int>(WIDTH * sm) - (SPACE << 1)) - width) / 2; |
144 | 947 | wy = y + SPACE + ((HEIGHT - (SPACE << 1)) - height) / 2; | 919 | wy = y + SPACE + ((static_cast<int>(HEIGHT * sm) - (SPACE << 1)) - height) / 2; |
145 | 948 | } | 920 | } |
146 | 949 | 921 | ||
147 | 950 | 922 | ||
148 | @@ -971,6 +943,7 @@ | |||
149 | 971 | int x, y, x1, x2, cx; | 943 | int x, y, x1, x2, cx; |
150 | 972 | unsigned short color[4]; | 944 | unsigned short color[4]; |
151 | 973 | 945 | ||
152 | 946 | sm = sScreen->sm; | ||
153 | 974 | const CompWindow::Geometry &g = window->geometry (); | 947 | const CompWindow::Geometry &g = window->geometry (); |
154 | 975 | 948 | ||
155 | 976 | if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK || | 949 | if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK || |
156 | @@ -991,23 +964,25 @@ | |||
157 | 991 | glEnable (GL_SCISSOR_TEST); | 964 | glEnable (GL_SCISSOR_TEST); |
158 | 992 | glScissor (x1, 0, x2 - x1, screen->height ()); | 965 | glScissor (x1, 0, x2 - x1, screen->height ()); |
159 | 993 | 966 | ||
177 | 994 | foreach (CompWindow *w, sScreen->windows) | 967 | foreach (CompWindow *w, sScreen->windows) |
178 | 995 | { | 968 | { |
179 | 996 | if (x + WIDTH > x1) | 969 | if (x + static_cast<int>(WIDTH * sm) > x1) { |
180 | 997 | SwitchWindow::get (w)->paintThumb (gWindow->lastPaintAttrib (), | 970 | auto switchWin = SwitchWindow::get(w); |
181 | 998 | transform, mask, x, y); | 971 | switchWin->sm = sm; |
182 | 999 | x += WIDTH; | 972 | switchWin->paintThumb (gWindow->lastPaintAttrib (), transform, mask, x, y); |
183 | 1000 | } | 973 | } |
184 | 1001 | 974 | x += static_cast<int>(WIDTH * sm); | |
185 | 1002 | foreach (CompWindow *w, sScreen->windows) | 975 | } |
186 | 1003 | { | 976 | |
187 | 1004 | if (x > x2) | 977 | foreach (CompWindow *w, sScreen->windows) |
188 | 1005 | break; | 978 | { |
189 | 1006 | 979 | if (x > x2) { break; } | |
190 | 1007 | SwitchWindow::get (w)->paintThumb (gWindow->lastPaintAttrib (), | 980 | |
191 | 1008 | transform, mask, x, y); | 981 | auto switchWin = SwitchWindow::get(w); |
192 | 1009 | x += WIDTH; | 982 | switchWin->sm = sm; |
193 | 1010 | } | 983 | switchWin->paintThumb (gWindow->lastPaintAttrib (), transform, mask, x, y); |
194 | 984 | x += static_cast<int>(WIDTH * sm); | ||
195 | 985 | } | ||
196 | 1011 | 986 | ||
197 | 1012 | glDisable (GL_SCISSOR_TEST); | 987 | glDisable (GL_SCISSOR_TEST); |
198 | 1013 | 988 | ||
199 | @@ -1025,7 +1000,7 @@ | |||
200 | 1025 | streamingBuffer->begin (GL_TRIANGLES); | 1000 | streamingBuffer->begin (GL_TRIANGLES); |
201 | 1026 | 1001 | ||
202 | 1027 | streamingBuffer->addColors (1, color); | 1002 | streamingBuffer->addColors (1, color); |
204 | 1028 | streamingBuffer->addVertices (24, _boxVertices); | 1003 | streamingBuffer->addVertices (24, sScreen->_boxVertices); |
205 | 1029 | 1004 | ||
206 | 1030 | streamingBuffer->end (); | 1005 | streamingBuffer->end (); |
207 | 1031 | streamingBuffer->render (wTransform, attrib); | 1006 | streamingBuffer->render (wTransform, attrib); |
208 | @@ -1102,6 +1077,58 @@ | |||
209 | 1102 | 1077 | ||
210 | 1103 | } | 1078 | } |
211 | 1104 | 1079 | ||
212 | 1080 | void SwitchScreen::setSizeMultiplier() { | ||
213 | 1081 | sm = optionGetSizeMultiplier(); | ||
214 | 1082 | float width = (WIDTH >> 1) * sm; | ||
215 | 1083 | float height = HEIGHT * sm; | ||
216 | 1084 | float box_width = BOX_WIDTH * sm; | ||
217 | 1085 | float boxVertices[72] = | ||
218 | 1086 | { | ||
219 | 1087 | -width, box_width, 0.0f, | ||
220 | 1088 | width, box_width, 0.0f, | ||
221 | 1089 | -width, 0.0f, 0.0f, | ||
222 | 1090 | -width, 0.0f, 0.0f, | ||
223 | 1091 | width, box_width, 0.0f, | ||
224 | 1092 | width, 0.0f, 0.0f, | ||
225 | 1093 | |||
226 | 1094 | -width, height - box_width, 0.0f, | ||
227 | 1095 | -width + box_width, height - box_width, 0.0f, | ||
228 | 1096 | -width, box_width, 0.0f, | ||
229 | 1097 | -width, box_width, 0.0f, | ||
230 | 1098 | -width + box_width, height - box_width, 0.0f, | ||
231 | 1099 | -width + box_width, box_width, 0.0f, | ||
232 | 1100 | |||
233 | 1101 | width - box_width, height - box_width, 0.0f, | ||
234 | 1102 | width, height - box_width, 0.0f, | ||
235 | 1103 | width - box_width, box_width, 0.0f, | ||
236 | 1104 | width - box_width, box_width, 0.0f, | ||
237 | 1105 | width, height - box_width, 0.0f, | ||
238 | 1106 | width, box_width, 0.0f, | ||
239 | 1107 | |||
240 | 1108 | -width, height, 0.0f, | ||
241 | 1109 | width, height, 0.0f, | ||
242 | 1110 | -width, height - box_width, 0.0f, | ||
243 | 1111 | -width, height - box_width, 0.0f, | ||
244 | 1112 | width, height, 0.0f, | ||
245 | 1113 | width, height - box_width, 0.0f, | ||
246 | 1114 | }; | ||
247 | 1115 | std::copy(boxVertices, boxVertices + 72, _boxVertices); | ||
248 | 1116 | |||
249 | 1117 | foreach (CompWindow *w, windows) | ||
250 | 1118 | { | ||
251 | 1119 | auto switchWin = SwitchWindow::get(w); | ||
252 | 1120 | switchWin->resetGraphics(); | ||
253 | 1121 | } | ||
254 | 1122 | } | ||
255 | 1123 | |||
256 | 1124 | void SwitchWindow::resetGraphics() { | ||
257 | 1125 | sm = sScreen->optionGetSizeMultiplier(); | ||
258 | 1126 | if (sScreen->popupWindow && sScreen->popupWindow == window->id ()) { | ||
259 | 1127 | gWindow->glPaintSetEnabled (this, false); | ||
260 | 1128 | gWindow->glPaintSetEnabled (this, true); | ||
261 | 1129 | } | ||
262 | 1130 | } | ||
263 | 1131 | |||
264 | 1105 | SwitchScreen::SwitchScreen (CompScreen *screen) : | 1132 | SwitchScreen::SwitchScreen (CompScreen *screen) : |
265 | 1106 | BaseSwitchScreen (screen), | 1133 | BaseSwitchScreen (screen), |
266 | 1107 | PluginClassHandler<SwitchScreen,CompScreen> (screen), | 1134 | PluginClassHandler<SwitchScreen,CompScreen> (screen), |
267 | @@ -1115,14 +1142,16 @@ | |||
268 | 1115 | pos (0), | 1142 | pos (0), |
269 | 1116 | move (0), | 1143 | move (0), |
270 | 1117 | translate (0.0), | 1144 | translate (0.0), |
272 | 1118 | sTranslate (0.0) | 1145 | sTranslate (0.0), |
273 | 1146 | sm(1) | ||
274 | 1119 | { | 1147 | { |
275 | 1120 | zoom = optionGetZoom () / 30.0f; | 1148 | zoom = optionGetZoom () / 30.0f; |
276 | 1121 | |||
277 | 1122 | zooming = (optionGetZoom () > 0.05f); | 1149 | zooming = (optionGetZoom () > 0.05f); |
278 | 1123 | |||
279 | 1124 | optionSetZoomNotify (boost::bind (&SwitchScreen::setZoom, this)); | 1150 | optionSetZoomNotify (boost::bind (&SwitchScreen::setZoom, this)); |
280 | 1125 | 1151 | ||
281 | 1152 | setSizeMultiplier(); | ||
282 | 1153 | optionSetSizeMultiplierNotify(boost::bind(&SwitchScreen::setSizeMultiplier, this)); | ||
283 | 1154 | |||
284 | 1126 | auto bgUpdater = [=] (...){ this->updateBackground (this->optionGetUseBackgroundColor (), this->optionGetBackgroundColor ());}; | 1155 | auto bgUpdater = [=] (...){ this->updateBackground (this->optionGetUseBackgroundColor (), this->optionGetBackgroundColor ());}; |
285 | 1127 | optionSetUseBackgroundColorNotify (bgUpdater); | 1156 | optionSetUseBackgroundColorNotify (bgUpdater); |
286 | 1128 | optionSetBackgroundColorNotify (bgUpdater); | 1157 | optionSetBackgroundColorNotify (bgUpdater); |
287 | @@ -1182,8 +1211,10 @@ | |||
288 | 1182 | BaseSwitchWindow (dynamic_cast<BaseSwitchScreen *> | 1211 | BaseSwitchWindow (dynamic_cast<BaseSwitchScreen *> |
289 | 1183 | (SwitchScreen::get (screen)), window), | 1212 | (SwitchScreen::get (screen)), window), |
290 | 1184 | PluginClassHandler<SwitchWindow,CompWindow> (window), | 1213 | PluginClassHandler<SwitchWindow,CompWindow> (window), |
291 | 1214 | sm(1), | ||
292 | 1185 | sScreen (SwitchScreen::get (screen)) | 1215 | sScreen (SwitchScreen::get (screen)) |
293 | 1186 | { | 1216 | { |
294 | 1217 | sm = sScreen->optionGetSizeMultiplier(); | ||
295 | 1187 | GLWindowInterface::setHandler (gWindow, false); | 1218 | GLWindowInterface::setHandler (gWindow, false); |
296 | 1188 | CompositeWindowInterface::setHandler (cWindow, false); | 1219 | CompositeWindowInterface::setHandler (cWindow, false); |
297 | 1189 | 1220 | ||
298 | 1190 | 1221 | ||
299 | === modified file 'plugins/switcher/src/switcher.h' | |||
300 | --- plugins/switcher/src/switcher.h 2015-08-22 21:46:01 +0000 | |||
301 | +++ plugins/switcher/src/switcher.h 2016-07-05 14:10:56 +0000 | |||
302 | @@ -20,7 +20,9 @@ | |||
303 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
304 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
305 | 22 | * | 22 | * |
307 | 23 | * Author: David Reveman <davidr@novell.com> | 23 | * Author(s): |
308 | 24 | * - David Reveman <davidr@novell.com> | ||
309 | 25 | * - Auboyneau Vincent <ksamak@riseup.net> (size multiplier for A11Y) | ||
310 | 24 | */ | 26 | */ |
311 | 25 | 27 | ||
312 | 26 | #include <stdio.h> | 28 | #include <stdio.h> |
313 | @@ -96,6 +98,11 @@ | |||
314 | 96 | 98 | ||
315 | 97 | float translate; | 99 | float translate; |
316 | 98 | float sTranslate; | 100 | float sTranslate; |
317 | 101 | |||
318 | 102 | void setSizeMultiplier(); | ||
319 | 103 | float sm; | ||
320 | 104 | float _boxVertices[72]; | ||
321 | 105 | |||
322 | 99 | }; | 106 | }; |
323 | 100 | 107 | ||
324 | 101 | class SwitchWindow : | 108 | class SwitchWindow : |
325 | @@ -115,6 +122,8 @@ | |||
326 | 115 | bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &, | 122 | bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &, |
327 | 116 | const CompRegion &, unsigned int); | 123 | const CompRegion &, unsigned int); |
328 | 117 | 124 | ||
329 | 125 | void resetGraphics(); | ||
330 | 126 | |||
331 | 118 | void paintThumb (const GLWindowPaintAttrib &attrib, | 127 | void paintThumb (const GLWindowPaintAttrib &attrib, |
332 | 119 | const GLMatrix &transform, | 128 | const GLMatrix &transform, |
333 | 120 | unsigned int mask, | 129 | unsigned int mask, |
334 | @@ -143,6 +152,8 @@ | |||
335 | 143 | 152 | ||
336 | 144 | IconMode getIconMode (); | 153 | IconMode getIconMode (); |
337 | 145 | 154 | ||
338 | 155 | float sm; // sizeMultiplier | ||
339 | 156 | |||
340 | 146 | SwitchScreen *sScreen; | 157 | SwitchScreen *sScreen; |
341 | 147 | }; | 158 | }; |
342 | 148 | 159 | ||
343 | @@ -160,8 +171,8 @@ | |||
344 | 160 | 171 | ||
345 | 161 | extern const unsigned short BOX_WIDTH; | 172 | extern const unsigned short BOX_WIDTH; |
346 | 162 | 173 | ||
349 | 163 | #define WINDOW_WIDTH(count) (WIDTH * (count) + (SPACE << 1)) | 174 | #define WINDOW_WIDTH(count) (static_cast<int>(WIDTH * optionGetSizeMultiplier()) * (count) + (SPACE << 1)) |
350 | 164 | #define WINDOW_HEIGHT (HEIGHT + (SPACE << 1)) | 175 | #define WINDOW_HEIGHT (static_cast<int>(HEIGHT * optionGetSizeMultiplier()) + (SPACE << 1)) |
351 | 165 | 176 | ||
352 | 166 | #define SWITCH_SCREEN(s) \ | 177 | #define SWITCH_SCREEN(s) \ |
353 | 167 | SwitchScreen *ss = SwitchScreen::get (s) | 178 | SwitchScreen *ss = SwitchScreen::get (s) |
354 | 168 | 179 | ||
355 | === modified file 'plugins/switcher/switcher.xml.in' | |||
356 | --- plugins/switcher/switcher.xml.in 2015-08-22 21:46:01 +0000 | |||
357 | +++ plugins/switcher/switcher.xml.in 2016-07-05 14:10:56 +0000 | |||
358 | @@ -98,6 +98,14 @@ | |||
359 | 98 | <max>50</max> | 98 | <max>50</max> |
360 | 99 | <precision>0.1</precision> | 99 | <precision>0.1</precision> |
361 | 100 | </option> | 100 | </option> |
362 | 101 | <option name="size_multiplier" type="float"> | ||
363 | 102 | <_short>Size multiplier</_short> | ||
364 | 103 | <_long>adjusts the size of the switch windows</_long> | ||
365 | 104 | <default>1</default> | ||
366 | 105 | <min>0.1</min> | ||
367 | 106 | <max>10</max> | ||
368 | 107 | <precision>0.1</precision> | ||
369 | 108 | </option> | ||
370 | 101 | <option name="window_match" type="match"> | 109 | <option name="window_match" type="match"> |
371 | 102 | <_short>Switcher windows</_short> | 110 | <_short>Switcher windows</_short> |
372 | 103 | <_long>Windows that should be shown in switcher</_long> | 111 | <_long>Windows that should be shown in switcher</_long> |
I see some indentation issues, but a part from that it looks ok