@@ -1220,7 +1220,7 @@ Boolean MCObject::resizeparent()
12201220
12211221Boolean MCObject::getforecolor (uint2 di, Boolean rev, Boolean hilite,
12221222 MCColor &c, MCPatternRef &r_pattern,
1223- int2 &x, int2 &y, MCDC *dc, MCObject *o)
1223+ int2 &x, int2 &y, MCDC *dc, MCObject *o, bool selected )
12241224{
12251225 uint2 i;
12261226 if (dc->getdepth () > 1 )
@@ -1259,14 +1259,65 @@ Boolean MCObject::getforecolor(uint2 di, Boolean rev, Boolean hilite,
12591259 if (di == DI_BACK)
12601260 c = dc->getwhite ();
12611261 else
1262- parent->getforecolor (di, rev, False , c, r_pattern, x, y, dc, o);
1262+ parent->getforecolor (di, rev, hilite , c, r_pattern, x, y, dc, o, selected );
12631263 return True;
12641264 }
12651265 if (parent && parent != MCdispatcher)
1266- return parent->getforecolor (di, rev, False , c, r_pattern, x, y, dc, o);
1266+ return parent->getforecolor (di, rev, hilite , c, r_pattern, x, y, dc, o, selected );
12671267 }
12681268 }
12691269
1270+ // Try to get the colour from the system theme rather than these hard-coded values
1271+ MCPlatformControlType t_control_type;
1272+ MCPlatformControlPart t_control_part;
1273+ MCPlatformControlState t_control_state;
1274+ MCPlatformThemeProperty t_theme_prop;
1275+ MCPlatformThemePropertyType t_theme_prop_type;
1276+ Properties which;
1277+ switch (di)
1278+ {
1279+ case DI_TOP:
1280+ which = P_TOP_COLOR;
1281+ break ;
1282+
1283+ case DI_BOTTOM:
1284+ which = P_BOTTOM_COLOR;
1285+ break ;
1286+
1287+ case DI_FORE:
1288+ which = P_FORE_COLOR;
1289+ break ;
1290+
1291+ case DI_BACK:
1292+ which = P_BACK_COLOR;
1293+ break ;
1294+
1295+ case DI_HILITE:
1296+ which = P_HILITE_COLOR;
1297+ break ;
1298+
1299+ case DI_FOCUS:
1300+ which = P_FOCUS_COLOR;
1301+ break ;
1302+
1303+ case DI_BORDER:
1304+ which = P_BORDER_COLOR;
1305+ break ;
1306+
1307+ case DI_SHADOW:
1308+ which = P_SHADOW_COLOR;
1309+ break ;
1310+
1311+ }
1312+ if (o->getthemeselectorsforprop (which, t_control_type, t_control_part, t_control_state, t_theme_prop, t_theme_prop_type))
1313+ {
1314+ if (selected)
1315+ t_control_state |= kMCPlatformControlStateSelected ;
1316+
1317+ if (MCPlatformGetControlThemePropColor (t_control_type, t_control_part, t_control_state, t_theme_prop, c))
1318+ return True;
1319+ }
1320+
12701321 switch (di)
12711322 {
12721323
@@ -1312,7 +1363,7 @@ Boolean MCObject::getforecolor(uint2 di, Boolean rev, Boolean hilite,
13121363 return True;
13131364}
13141365
1315- void MCObject::setforeground (MCDC *dc, uint2 di, Boolean rev, Boolean hilite)
1366+ void MCObject::setforeground (MCDC *dc, uint2 di, Boolean rev, Boolean hilite, bool selected )
13161367{
13171368 uint2 idi = di;
13181369 if (rev)
@@ -1337,7 +1388,7 @@ void MCObject::setforeground(MCDC *dc, uint2 di, Boolean rev, Boolean hilite)
13371388 MCColor color;
13381389 MCPatternRef t_pattern = nil;
13391390 int2 x, y;
1340- if (getforecolor (idi, rev, hilite, color, t_pattern, x, y, dc, this ))
1391+ if (getforecolor (idi, rev, hilite, color, t_pattern, x, y, dc, this , selected ))
13411392 {
13421393 MCColor fcolor;
13431394 if (dc->getdepth () == 1 && di != DI_BACK
@@ -4306,6 +4357,8 @@ void MCObject::mapfont(void)
43064357 // This should never happen as the only object with nil parent when
43074358 // opened should be MCdispatcher, which always has font attrs.
43084359 assert (false );
4360+
4361+ // TODO: font theming
43094362 }
43104363
43114364 // MW-2012-03-02: [[ Bug 10044 ]] If we had to temporarily map the parent's font
0 commit comments