ee2861051f
default, but foo.theme is tried afterwards as fallback. Bump revision. Discussed with jlam@
40 lines
1.2 KiB
Text
40 lines
1.2 KiB
Text
$NetBSD: patch-ag,v 1.1 2006/02/18 14:07:54 joerg Exp $
|
|
|
|
--- src/core/Fl_Style.cpp.orig 2003-02-02 10:50:33.000000000 +0000
|
|
+++ src/core/Fl_Style.cpp
|
|
@@ -284,21 +284,34 @@ Fl_Theme Fl_Style::load_theme(const char
|
|
|
|
Fl_Theme Fl_Style::load_theme(const char* name)
|
|
{
|
|
+ static const char so_suffix[] = ".so";
|
|
+ const char *suffix = so_suffix;
|
|
+
|
|
// no name leaves the built-in default:
|
|
if (!name || !*name) return fltk_theme;
|
|
|
|
+retry:
|
|
// add ".theme" if it is not there:
|
|
char name_buf[FL_PATH_MAX];
|
|
int n = strlen(name);
|
|
if (n < 6 || strcasecmp(name+n-6, ".theme"))
|
|
{
|
|
- snprintf(name_buf, FL_PATH_MAX, "%s.theme", name);
|
|
+ snprintf(name_buf, FL_PATH_MAX, "%s.theme%s", name, suffix);
|
|
+ name = name_buf;
|
|
+ } else {
|
|
+ snprintf(name_buf, FL_PATH_MAX, "%s%s", name, suffix);
|
|
name = name_buf;
|
|
}
|
|
|
|
+
|
|
+
|
|
// search for the file:
|
|
const char *path = fl_find_config_file(name);
|
|
if (!path) {
|
|
+ if (suffix == so_suffix) {
|
|
+ suffix = "";
|
|
+ goto retry;
|
|
+ }
|
|
// If they said "default" it is ok if the plugin is not found:
|
|
if (!strncmp(name, "default.", 8)) return fltk_theme;
|
|
return 0;
|