diff --git a/src/lib/views/sunlight/include/sTypes.h b/src/lib/views/sunlight/include/sTypes.h index da9a44d..5456018 100644 --- a/src/lib/views/sunlight/include/sTypes.h +++ b/src/lib/views/sunlight/include/sTypes.h @@ -7,12 +7,11 @@ #include #include -class sString : public sStyle { +class sString : public sStyle, public std::string { public: - std::string name; - sString(void) { name = ""; }; - sString(const std::string _name) { name = _name; }; - virtual ~sString(void) { name = ""; }; + sString(void) : std::string("") { }; + sString(const std::string s) : std::string(s) { }; + virtual ~sString(void) { }; }; // sString class sBGColor : public sStyle { @@ -22,18 +21,16 @@ virtual ~sBGColor(void); }; // sBGColor -class sRGB8Color : public sStyle { +class sRGB8Color : public sStyle, public ogRGB8 { public: - ogRGB8 color; - sRGB8Color(void) { color.red = color.green = color.blue = 0; } + sRGB8Color(void) { red = green = blue = 0; } sRGB8Color(uInt8, uInt8, uInt8); virtual ~sRGB8Color(void) { }; }; // sRGB8Color -class sRGBA8Color : public sStyle { +class sRGBA8Color : public sStyle, public ogRGBA8 { public: - ogRGBA8 color; - sRGBA8Color(void) { color.red = color.green = color.blue = color.alpha = 0; } + sRGBA8Color(void) { red = green = blue = alpha = 0; } sRGBA8Color(uInt8, uInt8, uInt8, uInt8); virtual ~sRGBA8Color(void) { }; }; // sRGBA8Color diff --git a/src/lib/views/sunlight/sTypes.cpp b/src/lib/views/sunlight/sTypes.cpp index 9bc258f..21e6194 100644 --- a/src/lib/views/sunlight/sTypes.cpp +++ b/src/lib/views/sunlight/sTypes.cpp @@ -12,32 +12,32 @@ return; } // sBGColor::~sBGColor -sRGB8Color::sRGB8Color(uInt8 red, uInt8 green, uInt8 blue) { - color.red = red; - color.green = green; - color.blue = blue; +sRGB8Color::sRGB8Color(uInt8 r, uInt8 g, uInt8 b) { + red = r; + green = g; + blue = b; return; } // sRGB8Color::sRGB8Color -sRGBA8Color::sRGBA8Color(uInt8 red, uInt8 green, uInt8 blue, uInt8 alpha) { - color.red = red; - color.green = green; - color.blue = blue; - color.alpha = alpha; +sRGBA8Color::sRGBA8Color(uInt8 r, uInt8 g, uInt8 b, uInt8 a) { + red = r; + green = g; + blue = b; + alpha = a; return; } // sRGBA8Color::sRGBAColor -sSize::sSize(uInt32 _width, uInt32 _height) { +sSize::sSize(uInt32 w, uInt32 h) { size = 0; - width = _width; - height = _height; + width = w; + height = h; return; } // sSize::sSize -sSize::sSize(uInt32 _size, uInt32 _width, uInt32 _height) { - size = _size; - width = _width; - height = _height; +sSize::sSize(uInt32 s, uInt32 w, uInt32 h) { + size = s; + width = w; + height = h; return; } // sSize::sSize diff --git a/src/lib/views/sunlight/vTitleTab.cpp b/src/lib/views/sunlight/vTitleTab.cpp index e1864e3..07b16d6 100644 --- a/src/lib/views/sunlight/vTitleTab.cpp +++ b/src/lib/views/sunlight/vTitleTab.cpp @@ -11,22 +11,30 @@ title = ""; // Retrieve the default font filename out of the style tree - sString * fontFileName = dynamic_cast(GetStyle("default font")); + sString * fontFileName = dynamic_cast(GetStyle("default.font.filename")); // Attempt to load the font if (NULL != fontFileName) { // I should check for failure here, although everything fails quietly... // so even if it does fail it won't matter much - font->Load(fontFileName->name.c_str(), 0); + font->Load(fontFileName->c_str(), 0); } + + sRGBA8Color * color = dynamic_cast(GetStyle("default.font.color.background")); + if (NULL != color) return; + font->SetBGColor(color->red, color->blue, color->green, color->alpha); + + color = dynamic_cast(GetStyle("defualt.font.color.foreground")); + if (NULL != color) return; + font->SetFGColor(color->red, color->blue, color->green, color->alpha); + return; } // vTitleTab::vTitleTab void vTitleTab::Draw(void) { ogPoint2d points[4]; - sBGColor * BGColor = NULL; - BGColor = dynamic_cast(GetStyle("passive title color")); + sBGColor * BGColor = dynamic_cast(GetStyle("passive title color")); if (NULL == BGColor) return; points[0].x = points[0].y = points[1].y = points[3].x = 0;