summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-08-19 21:46:13 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-08-19 21:46:13 (GMT)
commit914c191b92ad40942ff18e343bddb6b6baca72d5 (patch)
treec445467a249aa7019d021bdf3ef5f5cf9ad7c81f
parent8a755bc3f0d29d9d844aef6a3ca00e71b6733c69 (diff)
downloadtk-914c191b92ad40942ff18e343bddb6b6baca72d5.zip
tk-914c191b92ad40942ff18e343bddb6b6baca72d5.tar.gz
tk-914c191b92ad40942ff18e343bddb6b6baca72d5.tar.bz2
As it is currently implemented (more or less copied from -foreground), -placeholderforeground for ttk widget is both a widget option and a styling option. Document this, and add a test for the styling option.
-rw-r--r--doc/ttk_combobox.n4
-rw-r--r--doc/ttk_entry.n4
-rw-r--r--doc/ttk_spinbox.n4
-rw-r--r--doc/ttk_widget.n9
-rw-r--r--tests/ttk/entry.test12
5 files changed, 26 insertions, 7 deletions
diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n
index 3ec3e77..3ece362 100644
--- a/doc/ttk_combobox.n
+++ b/doc/ttk_combobox.n
@@ -19,7 +19,7 @@ the user may select the value of the text field from among the
values in the list.
.SO ttk_widget
\-class \-cursor \-takefocus
-\-style \-placeholder
+\-style \-placeholder \-placeholderforeground
.SE
.\" ALSO: Other entry widget options
.SH "WIDGET-SPECIFIC OPTIONS"
@@ -148,6 +148,8 @@ Can only be changed when using non-native and non-graphical themes.
.br
\fB\-padding\fP \fIpadding\fP
.br
+\fB\-placeholderforeground\fP \fIcolor\fP
+.br
\fB\-postoffset\fP \fIpadding\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n
index 552700a..62b9951 100644
--- a/doc/ttk_entry.n
+++ b/doc/ttk_entry.n
@@ -26,7 +26,7 @@ standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command.
\-class \-cursor
\-font \-foreground
\-style
-\-takefocus \-xscrollcommand \-placeholder
+\-takefocus \-xscrollcommand \-placeholder \-placeholderforeground
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-exportselection exportSelection ExportSelection
@@ -454,6 +454,8 @@ Some themes use a graphical background and their field background colors cannot
.br
\fB\-padding\fP \fIpadding\fP
.br
+\fB\-placeholderforeground\fP \fIcolor\fP
+.br
\fB\-relief\fP \fIrelief\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n
index c18f987..b8f3ca2 100644
--- a/doc/ttk_spinbox.n
+++ b/doc/ttk_spinbox.n
@@ -22,7 +22,7 @@ of the \fBttk::entry\fR widget including support of the
to a Tcl variable.
.SO ttk_widget
\-class \-cursor \-state \-style
-\-takefocus \-xscrollcommand \-placeholder
+\-takefocus \-xscrollcommand \-placeholder \-placeholderforeground
.SE
.SO ttk_entry
\-validate \-validatecommand
@@ -111,6 +111,8 @@ value is specified for \fB\-fieldbackground\fP. Otherwise it is ignored.
.br
\fB\-padding\fP \fIpadding\fP
.br
+\fB\-placeholderforeground\fP \fIcolor\fP
+.br
\fB\-selectbackground\fP \fIcolor\fP
.br
\fB\-selectforeground\fP \fIcolor\fP
diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n
index 73affdd..17f1d88 100644
--- a/doc/ttk_widget.n
+++ b/doc/ttk_widget.n
@@ -152,13 +152,14 @@ to zero, then automatic wrapping is not performed; otherwise
the text is split into lines such that no line is longer
than the specified value.
.SH "ENTRY OPTIONS"
-The following option is supported by entry, spinbox and combobox:
+The following options are supported by entry, spinbox and combobox:
.OP \-placeholder placeHolder PlaceHolder
Specifies a help text string to display if no text is otherwise displayed,
that is when the widget is empty. The placeholder text is displayed using
-the values of the \fB\-font\fR and \fB\-justify\fR options. The foreground
-color of the placeholder text can be changed using the
-\fB\-placeholderforeground\fR style option.
+the values of the \fB\-font\fR, \fB\-justify\fR and
+\fB\-placeholderforeground\fR options.
+.OP \-placeholderforeground placeHolderForeground PlaceHolderForeground
+Specifies the foreground color of the placeholder text.
.SH "COMPATIBILITY OPTIONS"
This option is only available for themed widgets that have
.QW corresponding
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index a2d6016..f3174ae 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -342,6 +342,18 @@ test entry-10.2 {configuration option: "-placeholderforeground"} -setup {
destroy .e
} -result {red}
+test entry-10.3 {styling option: "-placeholderforeground"} -setup {
+ pack [ttk::entry .e]
+} -body {
+ set current [ttk::style configure TEntry -placeholderforeground]
+ ttk::style configure TEntry -placeholderforeground blue
+ set res [ttk::style configure TEntry -placeholderforeground]
+ ttk::style configure TEntry -placeholderforeground $current
+ set res
+} -cleanup {
+ destroy .e
+} -result {blue}
+
test entry-11.1 {Bug [2830360fff] - Don't loose invalid at focus events} -setup {
pack [ttk::entry .e]
update