changed symbols for float/tiled mode, added mouse-driven mode toggle to buttonpress()
d37dfa1b
2 file(s) · +13 −11
| 94 | 94 | void |
|
| 95 | 95 | drawstatus() |
|
| 96 | 96 | { |
|
| 97 | - | static const char *mode[] = { "~", "|" }; |
|
| 97 | + | static const char *mode[] = { "><", "|=" }; |
|
| 98 | 98 | int i, x; |
|
| 99 | 99 | ||
| 100 | 100 | dc.x = dc.y = 0; |
| 106 | 106 | ||
| 107 | 107 | if(barwin == ev->window) { |
|
| 108 | 108 | if(ev->x < modew) |
|
| 109 | - | return; |
|
| 110 | - | x = modew; |
|
| 111 | - | for(a.i = 0; a.i < ntags; a.i++) { |
|
| 112 | - | x += textw(tags[a.i]); |
|
| 113 | - | if(ev->x < x) { |
|
| 114 | - | if(ev->button == Button1) |
|
| 115 | - | view(&a); |
|
| 116 | - | else if(ev->button == Button3) |
|
| 117 | - | toggleview(&a); |
|
| 118 | - | return; |
|
| 109 | + | togglemode(NULL); |
|
| 110 | + | else { |
|
| 111 | + | x = modew; |
|
| 112 | + | for(a.i = 0; a.i < ntags; a.i++) { |
|
| 113 | + | x += textw(tags[a.i]); |
|
| 114 | + | if(ev->x < x) { |
|
| 115 | + | if(ev->button == Button1) |
|
| 116 | + | view(&a); |
|
| 117 | + | else if(ev->button == Button3) |
|
| 118 | + | toggleview(&a); |
|
| 119 | + | return; |
|
| 120 | + | } |
|
| 119 | 121 | } |
|
| 120 | 122 | } |
|
| 121 | 123 | } |