Use black as text color in TextField and TextInput

It seems that there's not a single theme out there which properly sets
viewTextColor. The background of textedits is white, so the text has to
be black. On Air(-mobile) this is not a problem, since the text is black
anyway, on dark themes (which set the text color to white), text simply
isn't visible.

We'll have to look into how themes implement viewtextcolor, should
probably fix the themes instead of the components, but this makes it
work until we do.
This commit is contained in:
Sebastian Kügler 2012-05-21 13:25:25 +02:00
parent d6a96e32ee
commit 7024329085
4 changed files with 12 additions and 6 deletions

View File

@ -167,7 +167,8 @@ Item {
font.underline: theme.defaultFont.underline
font.weight: theme.defaultFont.weight
font.wordSpacing: theme.defaultFont.wordSpacing
color: theme.viewTextColor
//color: theme.viewTextColor
color: Qt.color("black")
selectByMouse: verticalScroll.interactive
onCursorPositionChanged: {

View File

@ -128,7 +128,8 @@ Item {
text: placeholderText
visible: textInput.text == "" && !textField.activeFocus
// XXX: using textColor and low opacity for theming placeholderText
color: theme.viewTextColor
// color: theme.viewTextColor
color: Qt.color("black")
opacity: 0.5
elide: Text.ElideRight
clip: true
@ -159,7 +160,8 @@ Item {
rightMargin: 2 * base.margins.right
}
selectByMouse: true
color: theme.textColor
color: Qt.color("black")
//color: theme.textColor
enabled: textField.enabled
clip: true

View File

@ -298,7 +298,8 @@ Item {
font.underline: theme.defaultFont.underline
font.weight: theme.defaultFont.weight
font.wordSpacing: theme.defaultFont.wordSpacing
color: theme.viewTextColor
color: Qt.color("black")
//color: theme.viewTextColor
selectByMouse: verticalScroll.interactive
onCursorPositionChanged: {

View File

@ -272,7 +272,8 @@ FocusScope {
text: placeholderText
visible: textInput.text == "" && !textField.activeFocus
// XXX: using textColor and low opacity for theming placeholderText
color: theme.viewTextColor
//color: theme.viewTextColor
color: Qt.color("black")
opacity: 0.5
elide: Text.ElideRight
clip: true
@ -300,7 +301,8 @@ FocusScope {
}
passwordCharacter: "•"
selectByMouse: true
color: theme.textColor
color: Qt.color("black")
//color: theme.textColor
enabled: textField.enabled
clip: true
focus: true