Import Tk 8.6.10
This commit is contained in:
@@ -123,11 +123,18 @@ TkpDrawEntryBorderAndFocus(
|
||||
if (isSpinbox) {
|
||||
int incDecWidth;
|
||||
|
||||
oldWidth = Tk_Width(tkwin);
|
||||
/*
|
||||
* If native spinbox buttons are going to be drawn, then temporarily
|
||||
* change the width of the widget so that the same code can be used
|
||||
* for drawing the Entry portion of the Spinbox as is used to draw
|
||||
* an ordinary Entry. The width must be restored before returning.
|
||||
*/
|
||||
|
||||
ComputeIncDecParameters(Tk_Height(tkwin) - 2 * MAC_OSX_FOCUS_WIDTH,
|
||||
&incDecWidth);
|
||||
Tk_Width(tkwin) -= incDecWidth + 1;
|
||||
oldWidth = Tk_Width(tkwin);
|
||||
if (ComputeIncDecParameters(Tk_Height(tkwin) - 2 * MAC_OSX_FOCUS_WIDTH,
|
||||
&incDecWidth) != 0) {
|
||||
Tk_Width(tkwin) -= incDecWidth + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -149,6 +156,15 @@ TkpDrawEntryBorderAndFocus(
|
||||
bounds.size.width = Tk_Width(tkwin) - 2*MAC_OSX_FOCUS_WIDTH;
|
||||
bounds.size.height = Tk_Height(tkwin) - 2*MAC_OSX_FOCUS_WIDTH;
|
||||
if (!TkMacOSXSetupDrawingContext(d, NULL, 1, &dc)) {
|
||||
|
||||
/*
|
||||
* No graphics context is available. If the widget is a Spinbox, we
|
||||
* must restore its width before returning 0. (Ticket [273b6a4996].)
|
||||
*/
|
||||
|
||||
if (isSpinbox) {
|
||||
Tk_Width(tkwin) = oldWidth;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ChkErr(HIThemeDrawFrame, &bounds, &info, dc.context, HIOrientation);
|
||||
@@ -171,10 +187,10 @@ TkpDrawEntryBorderAndFocus(
|
||||
* have to implement it.
|
||||
*
|
||||
* Results:
|
||||
* 1 if it has drawn the border, 0 if not.
|
||||
* 1 if it has drawn the buttons, 0 if not.
|
||||
*
|
||||
* Side effects:
|
||||
* May draw the entry border into pixmap.
|
||||
* May draw the buttons into pixmap.
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
@@ -243,9 +259,9 @@ TkpDrawSpinboxButtons(
|
||||
*/
|
||||
|
||||
bgGC = Tk_GCForColor(sbPtr->entry.highlightBgColorPtr, d);
|
||||
rects[0].x = bounds.origin.x;
|
||||
rects[0].x = Tk_Width(tkwin) - incDecWidth - 1;
|
||||
rects[0].y = 0;
|
||||
rects[0].width = Tk_Width(tkwin);
|
||||
rects[0].width = incDecWidth + 1;
|
||||
rects[0].height = Tk_Height(tkwin);
|
||||
XFillRectangles(Tk_Display(tkwin), d, bgGC, rects, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user