diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-14 15:54:21 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-14 15:54:21 (GMT) |
commit | 1a3afaa38cc774a3eacf5b309754de60d40b851b (patch) | |
tree | 8b0bb220efffe9e7cbc4cd6c7a86dab6f1c4a8a8 | |
parent | 55905083cdebeb6614614e7253a474e8ab1c6c7f (diff) | |
parent | 0cd0e555712e5e6e91c1b3632e26d440d2744af0 (diff) | |
download | tk-1a3afaa38cc774a3eacf5b309754de60d40b851b.zip tk-1a3afaa38cc774a3eacf5b309754de60d40b851b.tar.gz tk-1a3afaa38cc774a3eacf5b309754de60d40b851b.tar.bz2 |
Partial fix for [85cea56c27]: The -underline option does not show an underline on ttk::label, ttk::labelframe, ttk::notebook tabs.
-rw-r--r-- | generic/tkConfig.c | 10 | ||||
-rw-r--r-- | generic/ttk/ttkButton.c | 5 | ||||
-rw-r--r-- | generic/ttk/ttkFrame.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkThemeInt.h | 6 |
5 files changed, 17 insertions, 12 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 0e47b03..e544d05 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -690,11 +690,11 @@ DoObjConfig( } return TCL_ERROR; } - if (newIndex == TCL_INDEX_NONE) { - newIndex = (Tcl_Size)INT_MIN; - } else if ((size_t)newIndex > (size_t)TCL_INDEX_END>>1) { - newIndex++; - } + if (newIndex == TCL_INDEX_NONE) { + newIndex = (Tcl_Size)INT_MIN; + } else if ((size_t)newIndex > (size_t)TCL_INDEX_END>>1) { + newIndex++; + } if (internalPtr != NULL) { *((int *) oldInternalPtr) = *((int *) internalPtr); *((int *) internalPtr) = (int)newIndex; diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 856f867..c9539d4 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -5,7 +5,7 @@ */ #include "tkInt.h" -#include "ttkTheme.h" +#include "ttkThemeInt.h" #include "ttkWidget.h" /* Bit fields for OptionSpec mask field: @@ -66,8 +66,7 @@ static const Tk_OptionSpec BaseOptionSpecs[] = offsetof(Base,base.textVariableObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_INDEX, "-underline", "underline", "Underline", - TK_OPTION_UNDERLINE_DEF(Base, base.underline), 0}, - /* SB: OPTION_INT, see <<NOTE-NULLOPTIONS>> */ + TTK_OPTION_UNDERLINE_DEF(Base, base.underline), 0}, {TK_OPTION_STRING, "-width", "width", "Width", NULL, offsetof(Base,base.widthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index adb8ba9..942454a 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -5,7 +5,7 @@ */ #include "tkInt.h" -#include "ttkTheme.h" +#include "ttkThemeInt.h" #include "ttkWidget.h" #include "ttkManager.h" @@ -259,7 +259,7 @@ static const Tk_OptionSpec LabelframeOptionSpecs[] = { offsetof(Labelframe,label.textObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INDEX, "-underline", "underline", "Underline", - TK_OPTION_UNDERLINE_DEF(Labelframe, label.underline), 0}, + TTK_OPTION_UNDERLINE_DEF(Labelframe, label.underline), 0}, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", NULL, TCL_INDEX_NONE, offsetof(Labelframe,label.labelWidget), TK_OPTION_NULL_OK,0,LABELWIDGET_CHANGED|GEOMETRY_CHANGED }, diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 5a0445a..35088f8 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -3,7 +3,7 @@ */ #include "tkInt.h" -#include "ttkTheme.h" +#include "ttkThemeInt.h" #include "ttkWidget.h" #include "ttkManager.h" @@ -68,7 +68,7 @@ static const Tk_OptionSpec TabOptionSpecs[] = NULL, offsetof(Tab,compoundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,ttkCompoundStrings,GEOMETRY_CHANGED }, {TK_OPTION_INDEX, "-underline", "underline", "Underline", - TK_OPTION_UNDERLINE_DEF(Tab, underline), GEOMETRY_CHANGED}, + TTK_OPTION_UNDERLINE_DEF(Tab, underline), GEOMETRY_CHANGED}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 } }; diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h index 25a5fdf..67ffc34 100644 --- a/generic/ttk/ttkThemeInt.h +++ b/generic/ttk/ttkThemeInt.h @@ -39,4 +39,10 @@ MODULE_SCOPE Ttk_LayoutTemplate Ttk_FindLayoutTemplate( MODULE_SCOPE const char *Ttk_StyleName(Ttk_Style); +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) +# define TTK_OPTION_UNDERLINE_DEF(type, field) "-1", offsetof(type, field), TCL_INDEX_NONE, 0, NULL +#else +# define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL +#endif + #endif /* _TTKTHEMEINT */ |