diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 32 |
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 |