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