mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-18 15:14:09 +00:00
switchable theme
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@470 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
18
src/core.c
18
src/core.c
@@ -420,11 +420,29 @@ static void inherit_text(MwWidget handle, const char* key, const char* default_v
|
||||
MwSetText(handle, key, default_value);
|
||||
}
|
||||
|
||||
static void inherit_integer(MwWidget handle, const char* key, int default_value) {
|
||||
int n;
|
||||
MwWidget h = handle;
|
||||
while(h != NULL) {
|
||||
if((n = MwGetInteger(h, key)) != -1) {
|
||||
MwSetInteger(handle, key, n);
|
||||
return;
|
||||
}
|
||||
h = h->parent;
|
||||
}
|
||||
MwSetInteger(handle, key, default_value);
|
||||
}
|
||||
|
||||
void MwSetDefault(MwWidget handle) {
|
||||
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
|
||||
|
||||
inherit_text(handle, MwNbackground, MwDefaultBackground);
|
||||
inherit_text(handle, MwNforeground, MwDefaultForeground);
|
||||
#ifdef MW_CLASSIC_THEME
|
||||
inherit_integer(handle, MwNmodernLook, 0);
|
||||
#else
|
||||
inherit_integer(handle, MwNmodernLook, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MwHideCursor(MwWidget handle) {
|
||||
|
||||
Reference in New Issue
Block a user