summaryrefslogtreecommitdiffstats
path: root/macosx/ttkMacOSXTheme.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-10-30 15:22:51 (GMT)
committerjenglish <jenglish@flightlab.com>2007-10-30 15:22:51 (GMT)
commitbbaec77e7acae48ed03a8b08a5bbd46ee3dd17ec (patch)
tree9b31b537a2c4034a53320d42fa7116e73638c36b /macosx/ttkMacOSXTheme.c
parent06e0381cd6b26bb2a980d4452a3bf9c04f43d11d (diff)
downloadtk-bbaec77e7acae48ed03a8b08a5bbd46ee3dd17ec.zip
tk-bbaec77e7acae48ed03a8b08a5bbd46ee3dd17ec.tar.gz
tk-bbaec77e7acae48ed03a8b08a5bbd46ee3dd17ec.tar.bz2
* generic/ttk/ttkWidget.c: Split up RedisplayWidget()
to factor out double-buffering related code. * macosx/ttkMacOSXAquaTheme.c: Use SetThemeBackGround/ kThemeBrushModelessDialogBackground{Active|Inactive} instead of ApplyThemeBackground/kThemeBackgroundWindowHeader (advice from DAS). * library/ttk/aquaTheme.tcl: Use darker shade for inactive and disabled text, to match typical values of most kThemeXXXTextColorInactive values.
Diffstat (limited to 'macosx/ttkMacOSXTheme.c')
-rw-r--r--macosx/ttkMacOSXTheme.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index 7f99776..616a0aa 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -27,7 +27,7 @@
* top-level window, not to the Tk_Window. BoxToRect()
* accounts for this.
*
- * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.12 2007/10/28 18:56:51 jenglish Exp $
+ * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.13 2007/10/30 15:22:52 jenglish Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -742,7 +742,7 @@ static Ttk_ElementSpec SizegripElementSpec = {
};
/*----------------------------------------------------------------------
- * +++ Background element -- an experiment.
+ * +++ Background element.
*
* This isn't quite right: In Aqua, the correct background for
* a control depends on what kind of container it belongs to,
@@ -751,36 +751,24 @@ static Ttk_ElementSpec SizegripElementSpec = {
* Also: patterned backgrounds should be aligned with the coordinate
* system of the top-level window. If we're drawing into an
* off-screen graphics port this leads to alignment glitches.
- *
- * Available kTheme constants:
- * kThemeBackgroundTabPane,
- * kThemeBackgroundPlacard,
- * kThemeBackgroundWindowHeader,
- * kThemeBackgroundListViewWindowHeader,
- * kThemeBackgroundSecondaryGroupBox,
- *
- * SetThemeBackground() offers more kThemeBrush* choices.
- *
*/
static void BackgroundElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- ThemeBackgroundKind kind = kThemeBackgroundWindowHeader;
+ ThemeBrush brush
+ = (state & TTK_STATE_BACKGROUND)
+ ? kThemeBrushModelessDialogBackgroundInactive
+ : kThemeBrushModelessDialogBackgroundActive
+ ;
+
Rect bounds = BoxToRect(d, Ttk_WinBox(tkwin));
- SInt32 depth = 32; /* ??? */
+ SInt32 depth = 32; /* ??? */
Boolean inColor = true;
- /* Avoid kThemeStatePressed, which seems to give bad results
- * for ApplyThemeBackground:
- */
- state &= ~TTK_STATE_PRESSED;
-
BEGIN_DRAWING(d)
- ApplyThemeBackground(kind, &bounds,
- Ttk_StateTableLookup(ThemeStateTable, state),
- depth, inColor);
+ SetThemeBackground(brush, depth, inColor);
QDSetPatternOrigin(PatternOrigin(tkwin, d));
EraseRect(&bounds);
END_DRAWING