From 272255a255fb127a5d767170688090e09537d400 Mon Sep 17 00:00:00 2001 From: William Joye Date: Mon, 21 Oct 2019 15:14:35 -0400 Subject: add support for MacOS darkmode --- tksao/frame/frame3dbase.C | 28 +++------------------------- tksao/frame/frame3dbase.h | 1 - tksao/widget/widget.C | 8 ++++---- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/tksao/frame/frame3dbase.C b/tksao/frame/frame3dbase.C index 21121d7..6afa83b 100644 --- a/tksao/frame/frame3dbase.C +++ b/tksao/frame/frame3dbase.C @@ -571,28 +571,6 @@ Vector3d Frame3dBase::imageSize3d(FrScale::SecMode mode ) zparams->zmax-zparams->zmin); } -void Frame3dBase::psColor(PSColorSpace mode, const char* color) -{ - ostringstream str; - switch (mode) { - case BW: - case GRAY: - psColorGray(getXColor(color), str); - str << " setgray"; - break; - case RGB: - psColorRGB(getXColor(color), str); - str << " setrgbcolor"; - break; - case CMYK: - psColorCMYK(getXColor(color), str); - str << " setcmykcolor"; - break; - } - str << endl << ends; - Tcl_AppendResult(interp, str.str().c_str(), NULL); -} - void Frame3dBase::psLine(Vector& ss, Vector& tt, int dd) { ostringstream str; @@ -638,7 +616,7 @@ void Frame3dBase::psBorder(PSColorSpace mode) for (int ii=0; ii<8; ii++) uu[ii] = Vector(vv[ii])*widgetToCanvas; - psColor(mode, borderColorName_); + renderPSColor(mode, getXColor(borderColorName_)); psWidth(1); // front @@ -676,7 +654,7 @@ void Frame3dBase::psCompass(PSColorSpace mode) Vector y = Vector(yy)*widgetToCanvas; Vector z = Vector(zz)*widgetToCanvas; - psColor(mode, compassColorName_); + renderPSColor(mode, getXColor(compassColorName_)); psWidth(1); psLine(o,x,0); @@ -690,7 +668,7 @@ void Frame3dBase::psHighlite(PSColorSpace mode) int rr[4]; calcHighlite(Coord::CANVAS,vv,rr); - psColor(mode, highliteColorName_); + renderPSColor(mode, getXColor(highliteColorName_)); psWidth(1); psLine(vv[0],vv[1],rr[0]); psLine(vv[1],vv[2],rr[1]); diff --git a/tksao/frame/frame3dbase.h b/tksao/frame/frame3dbase.h index 8eff5fb..8c3bdd5 100644 --- a/tksao/frame/frame3dbase.h +++ b/tksao/frame/frame3dbase.h @@ -104,7 +104,6 @@ class Frame3dBase : public Base { Vector3d imageCenter3d(FrScale::SecMode); Vector3d imageSize3d(FrScale::SecMode); - void psColor(PSColorSpace, const char*); void psLine(Vector&, Vector&, int); void psWidth(int); void psGraphics(PSColorSpace mode); diff --git a/tksao/widget/widget.C b/tksao/widget/widget.C index b4a0c8d..5c07b68 100644 --- a/tksao/widget/widget.C +++ b/tksao/widget/widget.C @@ -780,16 +780,16 @@ void Widget::renderPSColor(PSColorSpace mode, XColor* clr) ostringstream str; switch (mode) { - case Widget::BW: - case Widget::GRAY: + case BW: + case GRAY: psColorGray(clr, str); str << " setgray"; break; - case Widget::RGB: + case RGB: psColorRGB(clr, str); str << " setrgbcolor"; break; - case Widget::CMYK: + case CMYK: psColorCMYK(clr, str); str << " setcmykcolor"; break; -- cgit v0.12