diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-02-10 12:00:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-02-10 12:00:56 (GMT) |
commit | 9d0e242e4b1f33fb4d6824f15a7cbc515750ff49 (patch) | |
tree | f6ef23d91a32cac2921621ea078afa2750bb8e97 | |
parent | 24e76d8bcdf035fe16370283d86e8e0932fb1042 (diff) | |
parent | 2be0535134d88b19530481afc54d3495c487bd41 (diff) | |
download | tk-9d0e242e4b1f33fb4d6824f15a7cbc515750ff49.zip tk-9d0e242e4b1f33fb4d6824f15a7cbc515750ff49.tar.gz tk-9d0e242e4b1f33fb4d6824f15a7cbc515750ff49.tar.bz2 |
Merge 8.7
-rw-r--r-- | generic/ttk/ttkClamTheme.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkElements.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 8 | ||||
-rw-r--r-- | win/ttkWinTheme.c | 15 |
4 files changed, 17 insertions, 10 deletions
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 5ec8e23..8e68927 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -594,7 +594,7 @@ static const Ttk_ElementOptionSpec ScrollbarElementOptions[] = { offsetof(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) }, { "-gripsize", TK_OPTION_PIXELS, offsetof(ScrollbarElement,gripSizeObj), "7.5p" }, - { "-sliderlength", TK_OPTION_INT, + { "-sliderlength", TK_OPTION_PIXELS, offsetof(ScrollbarElement,sliderlengthObj), "30" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 428b236..548471d 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -482,7 +482,7 @@ static const Ttk_ElementOptionSpec SizegripOptions[] = { { "-background", TK_OPTION_BORDER, offsetof(SizegripElement,backgroundObj), DEFAULT_BACKGROUND }, { "-gripsize", TK_OPTION_PIXELS, - offsetof(SizegripElement,gripSizeObj), "15" }, + offsetof(SizegripElement,gripSizeObj), "11.25p" }, {0,TK_OPTION_BOOLEAN,0,0} }; diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index b38aa4a..5e7c16b 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -109,10 +109,10 @@ typedef struct static const Tk_OptionSpec NotebookOptionSpecs[] = { - {TK_OPTION_INT, "-width", "width", "Width", "0", + {TK_OPTION_PIXELS, "-width", "width", "Width", "0", offsetof(Notebook,notebook.widthObj),TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, - {TK_OPTION_INT, "-height", "height", "Height", "0", + {TK_OPTION_PIXELS, "-height", "height", "Height", "0", offsetof(Notebook,notebook.heightObj),TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Padding", NULL, @@ -411,8 +411,8 @@ static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) /* Client width/height overridable by widget options: */ - Tcl_GetIntFromObj(NULL, nb->notebook.widthObj,&reqWidth); - Tcl_GetIntFromObj(NULL, nb->notebook.heightObj,&reqHeight); + Tk_GetPixelsFromObj(NULL, nb->core.tkwin, nb->notebook.widthObj,&reqWidth); + Tk_GetPixelsFromObj(NULL, nb->core.tkwin, nb->notebook.heightObj,&reqHeight); if (reqWidth > 0) clientWidth = reqWidth; if (reqHeight > 0) diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index aabab50..4762813 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -102,6 +102,7 @@ typedef struct { Ttk_Padding margins; /* additional placement padding */ } FrameControlElementData; +#define BASE_DIM 16 #define _FIXEDSIZE 0x80000000UL #define _HALFMETRIC 0x40000000UL #define FIXEDSIZE(id) (id|_FIXEDSIZE) @@ -109,12 +110,12 @@ typedef struct { #define GETMETRIC(m) \ ((m) & _FIXEDSIZE ? (int)((m) & ~_FIXEDSIZE) : GetSystemMetrics((m)&0xFFFFFFF)) -static const FrameControlElementData FrameControlElements[] = { +static FrameControlElementData FrameControlElements[] = { { "Checkbutton.indicator", - DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(16), FIXEDSIZE(16), + DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), checkbutton_statemap, {0,0,4,0} }, { "Radiobutton.indicator", - DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(16), FIXEDSIZE(16), + DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), checkbutton_statemap, {0,0,4,0} }, { "uparrow", DFC_SCROLL, DFCS_SCROLLUP, SM_CXVSCROLL, SM_CYVSCROLL, @@ -155,7 +156,7 @@ static void FrameControlElementSize( int cx = GETMETRIC(p->cxId); int cy = GETMETRIC(p->cyId); - if (p->partId == DFCS_BUTTONCHECK || p->partId == DFCS_BUTTONRADIO) { + if ((p->cxId & _FIXEDSIZE) && cx == BASE_DIM) { /* * Retrieve the scaling factor (1.0, 1.25, 1.5, ...) * and multiply cx and cy by it @@ -167,6 +168,12 @@ static void FrameControlElementSize( atof(scalingPctPtr) / 100); cx *= scalingFactor; cy *= scalingFactor; + + /* + * Update the corresponding element of the array FrameControlElements + */ + p->cxId = FIXEDSIZE(cx); + p->cyId = FIXEDSIZE(cy); } if (p->cxId & _HALFMETRIC) cx /= 2; |