forked from pyrite-dev/milsko
introduce MwNdarkThemeAutomatic
This commit is contained in:
parent
6f9f98f22c
commit
6927ffd27d
3 changed files with 7 additions and 1 deletions
|
|
@ -43,6 +43,7 @@
|
|||
#define MwNisRounded "IisRounded"
|
||||
#define MwNdarkTheme "IdarkTheme"
|
||||
#define MwNuseMonospace "IuseMonospace"
|
||||
#define MwNdarkThemeAutomatic "IdarkThemeAutomatic"
|
||||
|
||||
#define MwNtitle "Stitle"
|
||||
#define MwNtext "Stext"
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@
|
|||
<integer name="darkTheme" common="yes" />
|
||||
<integer name="useMonospace" common="yes" />
|
||||
<integer name="fillArea" />
|
||||
<integer name="darkThemeAutomatic" common="yes" />
|
||||
|
||||
<!-- waitMS is a special property, only applies to toplevel widget -->
|
||||
<integer name="waitMS" common="yes" />
|
||||
|
|
|
|||
|
|
@ -170,10 +170,12 @@ static void llclipboardhandler(MwLL handle, void* data) {
|
|||
static void lldarkthemehandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->common.user;
|
||||
int* ptr = data;
|
||||
int s;
|
||||
|
||||
if(IsFirstVisible(h)) {
|
||||
if(IsFirstVisible(h) && (shgeti(h->integer, MwNdarkTheme) == -1 || ((s = MwGetInteger(h, MwNdarkThemeAutomatic)) != MwDEFAULT && s))) {
|
||||
MwVaApply(h,
|
||||
MwNdarkTheme, *ptr,
|
||||
MwNdarkThemeAutomatic, 1,
|
||||
NULL);
|
||||
|
||||
MwDispatchUserHandler(h, MwNdarkThemeHandler, data);
|
||||
|
|
@ -573,6 +575,8 @@ void MwSetInteger(MwWidget handle, const char* key, int n) {
|
|||
if(strcmp(key, MwNdarkTheme) == 0) {
|
||||
MwWidget h = handle;
|
||||
|
||||
shdel(h->integer, MwNdarkThemeAutomatic);
|
||||
|
||||
while(h->parent != NULL && h->parent->widget_class != NULL) h = h->parent;
|
||||
|
||||
MwLLSetDarkTheme(h->lowlevel, n);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue