diff options
author | culler <culler> | 2021-04-20 21:44:01 (GMT) |
---|---|---|
committer | culler <culler> | 2021-04-20 21:44:01 (GMT) |
commit | 423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc (patch) | |
tree | de072e1c17cdabcdeaed6d5ebe4995161c0e5209 /macosx/ttkMacOSXTheme.c | |
parent | 269976f190336ef9eb04dea3a593de5c67b807e4 (diff) | |
download | tk-423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc.zip tk-423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc.tar.gz tk-423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc.tar.bz2 |
fix [cde766f911]: scrollbars do not update correctly for treeview widgets.
Diffstat (limited to 'macosx/ttkMacOSXTheme.c')
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 92c5156..c4e1f33 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -36,10 +36,22 @@ * Macros for handling drawing contexts. */ -#define BEGIN_DRAWING(d) { \ - TkMacOSXDrawingContext dc; \ - if (!TkMacOSXSetupDrawingContext((d), NULL, &dc)) {return;} -#define END_DRAWING \ +#define BEGIN_DRAWING(d) { \ + TkMacOSXDrawingContext dc; \ + if (!TkMacOSXSetupDrawingContext((d), NULL, &dc)) { \ + return; \ + } \ + +#define BEGIN_DRAWING_OR_REDRAW(d) { \ + TkMacOSXDrawingContext dc; \ + if (!TkMacOSXSetupDrawingContext((d), NULL, &dc)) { \ + NSView *view = TkMacOSXGetNSViewForDrawable(d); \ + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} \ + [(TKContentView *)view addTkDirtyRect:[view bounds]]; \ + return; \ + } \ + +#define END_DRAWING \ TkMacOSXRestoreDrawingContext(&dc);} #define HIOrientation kHIThemeOrientationNormal @@ -1602,7 +1614,7 @@ static void TabElementDraw( .position = Ttk_StateTableLookup(TabPositionTable, state), }; - BEGIN_DRAWING(d) + BEGIN_DRAWING_OR_REDRAW(d) if (TkMacOSXInDarkMode(tkwin)) { DrawDarkTab(bounds, state, dc.context); } else { @@ -2794,7 +2806,7 @@ static void FillElementDraw( NSColorSpace *deviceRGB = [NSColorSpace deviceRGBColorSpace]; NSColor *bgColor; CGFloat fill[4]; - BEGIN_DRAWING(d) + BEGIN_DRAWING_OR_REDRAW(d) GetBackgroundColor(dc.context, tkwin, 0, fill); bgColor = [NSColor colorWithColorSpace: deviceRGB components: fill count: 4]; |