Cosmetics
This commit is contained in:
+8
-7
@@ -122,13 +122,16 @@ enum FontSizeIndex
|
|||||||
#define COLOR(index) LcdFlags((index) << 16)
|
#define COLOR(index) LcdFlags((index) << 16)
|
||||||
#define COLOR_IDX(att) uint8_t((att) >> 16)
|
#define COLOR_IDX(att) uint8_t((att) >> 16)
|
||||||
|
|
||||||
//#define DEFAULT_COLOR COLOR(DEFAULT_COLOR_INDEX)
|
#define DEFAULT_COLOR COLOR(DEFAULT_COLOR_INDEX)
|
||||||
//#define DEFAULT_BGCOLOR COLOR(DEFAULT_BGCOLOR_INDEX)
|
#define DEFAULT_BGCOLOR COLOR(DEFAULT_BGCOLOR_INDEX)
|
||||||
//#define FOCUS_COLOR COLOR(FOCUS_COLOR_INDEX)
|
#define FOCUS_COLOR COLOR(FOCUS_COLOR_INDEX)
|
||||||
//#define FOCUS_BGCOLOR COLOR(FOCUS_BGCOLOR_INDEX)
|
#define FOCUS_BGCOLOR COLOR(FOCUS_BGCOLOR_INDEX)
|
||||||
|
#define DISABLE_COLOR COLOR(DISABLE_COLOR_INDEX)
|
||||||
|
#define CHECKBOX_COLOR COLOR(CHECKBOX_COLOR_INDEX)
|
||||||
|
#define CUSTOM_COLOR COLOR(CUSTOM_COLOR_INDEX)
|
||||||
|
|
||||||
//#define TEXT_STATUSBAR_COLOR COLOR(TEXT_STATUSBAR_COLOR_INDEX)
|
//#define TEXT_STATUSBAR_COLOR COLOR(TEXT_STATUSBAR_COLOR_INDEX)
|
||||||
//#define LINE_COLOR COLOR(LINE_COLOR_INDEX)
|
//#define LINE_COLOR COLOR(LINE_COLOR_INDEX)
|
||||||
#define SCROLLBOX_COLOR COLOR(SCROLLBOX_COLOR_INDEX)
|
|
||||||
//#define HEADER_SEPARATOR_COLOR COLOR(HEADER_SEPARATOR_COLOR_INDEX)
|
//#define HEADER_SEPARATOR_COLOR COLOR(HEADER_SEPARATOR_COLOR_INDEX)
|
||||||
//#define MENU_TITLE_BGCOLOR COLOR(MENU_TITLE_BGCOLOR_INDEX)
|
//#define MENU_TITLE_BGCOLOR COLOR(MENU_TITLE_BGCOLOR_INDEX)
|
||||||
//#define MENU_TITLE_COLOR COLOR(MENU_TITLE_COLOR_INDEX)
|
//#define MENU_TITLE_COLOR COLOR(MENU_TITLE_COLOR_INDEX)
|
||||||
@@ -137,7 +140,6 @@ enum FontSizeIndex
|
|||||||
//#define ALARM_COLOR COLOR(ALARM_COLOR_INDEX)
|
//#define ALARM_COLOR COLOR(ALARM_COLOR_INDEX)
|
||||||
//#define WARNING_COLOR COLOR(WARNING_COLOR_INDEX)
|
//#define WARNING_COLOR COLOR(WARNING_COLOR_INDEX)
|
||||||
//#define TEXT_DISABLE_COLOR COLOR(TEXT_DISABLE_COLOR_INDEX)
|
//#define TEXT_DISABLE_COLOR COLOR(TEXT_DISABLE_COLOR_INDEX)
|
||||||
//#define DISABLE_COLOR COLOR(DISABLE_COLOR_INDEX)
|
|
||||||
//#define CURVE_COLOR COLOR(CURVE_COLOR_INDEX)
|
//#define CURVE_COLOR COLOR(CURVE_COLOR_INDEX)
|
||||||
//#define CURVE_CURSOR_COLOR COLOR(CURVE_CURSOR_COLOR_INDEX)
|
//#define CURVE_CURSOR_COLOR COLOR(CURVE_CURSOR_COLOR_INDEX)
|
||||||
//#define TITLE_BGCOLOR COLOR(TITLE_BGCOLOR_INDEX)
|
//#define TITLE_BGCOLOR COLOR(TITLE_BGCOLOR_INDEX)
|
||||||
@@ -152,6 +154,5 @@ enum FontSizeIndex
|
|||||||
//#define BARGRAPH1_COLOR COLOR(BARGRAPH1_COLOR_INDEX)
|
//#define BARGRAPH1_COLOR COLOR(BARGRAPH1_COLOR_INDEX)
|
||||||
//#define BARGRAPH2_COLOR COLOR(BARGRAPH2_COLOR_INDEX)
|
//#define BARGRAPH2_COLOR COLOR(BARGRAPH2_COLOR_INDEX)
|
||||||
//#define BARGRAPH_BGCOLOR COLOR(BARGRAPH_BGCOLOR_INDEX)
|
//#define BARGRAPH_BGCOLOR COLOR(BARGRAPH_BGCOLOR_INDEX)
|
||||||
//#define CUSTOM_COLOR COLOR(CUSTOM_COLOR_INDEX)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -47,6 +47,36 @@ const char * getFileExtension(const char * filename, uint8_t size, uint8_t extMa
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Check if given extension exists in a list of extensions.
|
||||||
|
@param extension The extension to search for, including leading period.
|
||||||
|
@param pattern One or more file extensions concatenated together, including the periods.
|
||||||
|
The list is searched backwards and the first match, if any, is returned.
|
||||||
|
eg: ".gif.jpg.jpeg.png"
|
||||||
|
@param match Optional container to hold the matched file extension (wide enough to hold LEN_FILE_EXTENSION_MAX + 1).
|
||||||
|
@retval true if a extension was found in the lost, false otherwise.
|
||||||
|
*/
|
||||||
|
bool isExtensionMatching(const char * extension, const char * pattern, char * match)
|
||||||
|
{
|
||||||
|
const char *ext;
|
||||||
|
uint8_t extlen, fnlen;
|
||||||
|
int plen;
|
||||||
|
|
||||||
|
ext = getFileExtension(pattern, 0, 0, &fnlen, &extlen);
|
||||||
|
plen = (int)fnlen;
|
||||||
|
while (plen > 0 && ext) {
|
||||||
|
if (!strncasecmp(extension, ext, extlen)) {
|
||||||
|
if (match != nullptr) strncat(&(match[0]='\0'), ext, extlen);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
plen -= extlen;
|
||||||
|
if (plen > 0) {
|
||||||
|
ext = getFileExtension(pattern, plen, 0, nullptr, &extlen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// returns true if current working dir is at the root level
|
// returns true if current working dir is at the root level
|
||||||
bool isCwdAtRoot()
|
bool isCwdAtRoot()
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -390,6 +390,6 @@ void Window::drawVerticalScrollbar(BitmapBuffer * dc)
|
|||||||
yofs = innerHeight - y - yhgt;
|
yofs = innerHeight - y - yhgt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dc->drawSolidFilledRect(x-1, y + yofs, 3, yhgt, SCROLLBOX_COLOR);
|
dc->drawSolidFilledRect(x-1, y + yofs, 3, yhgt, CHECKBOX_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user