summaryrefslogtreecommitdiff
path: root/src/WinButton.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WinButton.cc')
-rw-r--r--src/WinButton.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/WinButton.cc b/src/WinButton.cc
index 48ce31c..900d23e 100644
--- a/src/WinButton.cc
+++ b/src/WinButton.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22/// $Id: WinButton.cc,v 1.15 2003/09/22 12:07:00 rathnor Exp $ 22/// $Id: WinButton.cc,v 1.16 2003/10/31 19:32:40 rathnor Exp $
23 23
24#include "WinButton.hh" 24#include "WinButton.hh"
25#include "App.hh" 25#include "App.hh"
@@ -50,6 +50,10 @@ void WinButton::buttonReleaseEvent(XButtonEvent &event) {
50void WinButton::drawType() { 50void WinButton::drawType() {
51 bool used = false; 51 bool used = false;
52 52
53 // if it's odd and we're centring, we need to add one
54 int oddW = width()%2;
55 int oddH = height()%2;
56
53 switch (m_type) { 57 switch (m_type) {
54 case MAXIMIZE: 58 case MAXIMIZE:
55 59
@@ -177,14 +181,15 @@ void WinButton::drawType() {
177 if (used) 181 if (used)
178 FbTk::FbWindow::clear(); 182 FbTk::FbWindow::clear();
179 else if (gc() != 0) { 183 else if (gc() != 0) {
184 // width/4 != width/2, so we use /4*2 so that it's properly centred
180 if (m_listen_to.isStuck()) { 185 if (m_listen_to.isStuck()) {
181 fillRectangle(gc(), 186 fillRectangle(gc(),
182 width()/2 - width()/4, height()/2 - height()/4, 187 width()/2 - width()/4, height()/2 - height()/4,
183 width()/2, height()/2); 188 width()/4*2 + oddW, height()/4*2 + oddH);
184 } else { 189 } else {
185 fillRectangle(gc(), 190 fillRectangle(gc(),
186 width()/2 - width()/10, height()/2 - height()/10, 191 width()/2 - width()/10, height()/2 - height()/10,
187 width()/5, height()/5); 192 width()/10*2 + oddW, height()/10*2 + oddH);
188 } 193 }
189 } 194 }
190 break; 195 break;
@@ -222,10 +227,15 @@ void WinButton::drawType() {
222 227
223 drawLine(gc(), 228 drawLine(gc(),
224 2, 2, 229 2, 2,
225 width() - 3, height() - 3); 230 width() - 2, height() - 2);
231 // I can't figure out why this second one needs a y offset of 1?????
232 // but it does - at least on my box:
233 // XFree86 Version 4.2.1.1 (Debian 4.2.1-12.1 20031003005825)
234 // (protocol Version 11, revision 0, vendor release 6600)
235
226 drawLine(gc(), 236 drawLine(gc(),
227 2, width() - 3, 237 2, height() - 3,
228 height() - 3, 2); 238 width() - 2, 1);
229 } 239 }
230 break; 240 break;
231 case SHADE: 241 case SHADE: