summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorcsaba <csaba>2023-10-06 17:03:54 (GMT)
committercsaba <csaba>2023-10-06 17:03:54 (GMT)
commitdc3a071d220482ed8cccb89da7870de15a527d88 (patch)
tree26de8c003766c5230e65fe57f2718a736b3c7cf9 /generic/ttk
parent4b1316fef5c8a0b9ddee3ae103fb9bf70d7de3a0 (diff)
downloadtk-dc3a071d220482ed8cccb89da7870de15a527d88.zip
tk-dc3a071d220482ed8cccb89da7870de15a527d88.tar.gz
tk-dc3a071d220482ed8cccb89da7870de15a527d88.tar.bz2
Visual improvements regarding the focus ring around the ttk::combobox and ttk::spinbox widgets of the themes "alt" and "clam".
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkDefaultTheme.c25
-rw-r--r--generic/ttk/ttkElements.c7
2 files changed, 27 insertions, 5 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index f4795c8..e9f001a 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -377,21 +377,36 @@ static void FieldElementDraw(
int y1 = b.y, y2 = b.y + b.height - 1;
int w = WIN32_XDRAWLINE_HACK;
+ /*
+ * Draw the outer rounded rectangle
+ */
XDrawLine(disp, d, focusGC, x1+1, y1, x2-1+w, y1); /* N */
XDrawLine(disp, d, focusGC, x1+1, y2, x2-1+w, y2); /* S */
XDrawLine(disp, d, focusGC, x1, y1+1, x1, y2-1+w); /* W */
XDrawLine(disp, d, focusGC, x2, y1+1, x2, y2-1+w); /* E */
+
+ /*
+ * Draw the inner rectangle
+ */
+ b.x += 1; b.y += 1; b.width -= 2; b.height -= 2;
+ XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1);
} else {
+ /*
+ * Draw the outer rectangle
+ */
+ XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1);
+
+ /*
+ * Draw the inner border
+ */
GC borderGC = Tk_GCForColor(borderColor, d);
+ b.x += 1; b.y += 1; b.width -= 2; b.height -= 2;
DrawCorner(tkwin, d, border, borderGC,
- b.x, b.y, b.width, b.height, 0, DARK);
+ b.x, b.y, b.width, b.height, 0, BRDR);
DrawCorner(tkwin, d, border, borderGC,
- b.x, b.y, b.width, b.height, 1, DARK);
+ b.x, b.y, b.width, b.height, 1, LITE);
}
- b.x += 1; b.y += 1; b.width -= 2; b.height -= 2;
- XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1);
-
GC bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);
XFillRectangle(disp, d, bgGC, b.x+1, b.y+1, b.width-2, b.height-2);
} else {
diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c
index 0cb34a4..bbe5a95 100644
--- a/generic/ttk/ttkElements.c
+++ b/generic/ttk/ttkElements.c
@@ -247,6 +247,9 @@ static void FieldElementDraw(
int y1 = b.y, y2 = b.y + b.height - 1;
int w = WIN32_XDRAWLINE_HACK;
+ /*
+ * Draw the outer rounded rectangle
+ */
XDrawLine(disp, d, focusGC, x1+1, y1, x2-1+w, y1); /* N */
XDrawLine(disp, d, focusGC, x1+1, y2, x2-1+w, y2); /* S */
XDrawLine(disp, d, focusGC, x1, y1+1, x1, y2-1+w); /* W */
@@ -255,6 +258,10 @@ static void FieldElementDraw(
b.x += 1; b.y += 1; b.width -= 2; b.height -= 2;
}
+ /*
+ * If focusWidth > 1 then draw the inner rectangle,
+ * else the only one replacing the (outer) border
+ */
XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1);
GC bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);