|
From: <ma...@us...> - 2003-12-29 08:51:25
|
Update of /cvsroot/sharedaemon/ui-wx/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11264
Modified Files:
Images.cpp
Log Message:
Fixed font colour in toolbar buttons and added two fall-back directories for images location
Index: Images.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- Images.cpp 29 Dec 2003 04:34:33 -0000 1.47
+++ Images.cpp 29 Dec 2003 08:51:22 -0000 1.48
@@ -334,7 +334,9 @@
GetImage(image),
(tmp_new.GetWidth()-32)/2, 2, true
);
- mdc.SetTextForeground(wxColour(50, 50, 50));
+ mdc.SetTextForeground(
+ wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)
+ );
mdc.GetTextExtent(name, &x, &y);
mdc.DrawText(name, (tmp_new.GetWidth()-x)/2, 36);
#ifndef __WXMSW__ /* Use wxMask for transparency */
@@ -433,6 +435,34 @@
path.Prepend(wxT(":"));
path.Prepend(wxT("::Resources"));
#endif
+
+
+ /* Check path validity */
+ if (wxDirExists(path)) {
+ return path;
+ } else {
+ wxLogDebug(wxT("Images were not found in %s."), path.c_str());
+
+ path = wxT("../images/default");
+ if (wxDirExists(path)) {
+ wxLogDebug(
+ wxT("Found possible images dir at %s instead."),
+ path.c_str()
+ );
+ return path;
+ }
+
+ path = wxT("../src/images/default");
+ if (wxDirExists(path)) {
+ wxLogDebug(
+ wxT("Found possible images dir at %s instead."),
+ path.c_str()
+ );
+ return path;
+ }
+
+ wxLogError(wxT("Fatal! Unable to find images directory."));
+ return wxEmptyString;
+ }
- return path;
}
|