<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/104895/">http://git.reviewboard.kde.org/r/104895/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 9th, 2012, 6:30 p.m., <b>Mark Gaiser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ehh optional perhaps?
I've seen forms behave like this before and back then when i first saw it i tried to delete the text.. Which obviously didn't happen. The text just disappears as soon as i start typing. I kinda dislike that behavior. I mean, there is a big fat blue focus border that has the purpose of telling the user that the one with the blue border (style dependent) is the one that currently has focus. The blinking cursor is yet another indication that the field has focus. I think that is enough.

Perhaps optional, but please not by default. This is just my opinion and i don't maintain plasma components (nor anything in KDE for that matter). You'd have to wait for a reply from some of the plasma component maintainers to get a final word on this.</pre>
 </blockquote>




 <p>On May 10th, 2012, 11:38 a.m., <b>Sebastian Kügler</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This just fixes a race condition, I don't quite understand your reservation, Mark?</pre>
 </blockquote>





 <p>On May 10th, 2012, 12:29 p.m., <b>David Edmundson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">No it doesn't. Currently if you give an item focus you hide the placeholder text. In this patch it only hides placeholder text after you start typing.</pre>
 </blockquote>





 <p>On May 10th, 2012, 12:30 p.m., <b>David Edmundson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"> ^ That reply was at Sebastian where he says it's a fix, where it's actually a large visual change. (reviewboard doesn't really show that very well)</pre>
 </blockquote>





 <p>On May 10th, 2012, 12:36 p.m., <b>Sebastian Kügler</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Funny, because I ran into this exact behaviour last night, and to make it work well, I had to resort to using a Timer which calls forceActiveFocus() on the TextArea, not quite intuitive either.

Does anyone have a suggestion which satisfies both usecase without hacks?</pre>
 </blockquote>





 <p>On May 10th, 2012, 1:18 p.m., <b>Sebastian Gottfried</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Using a timer to give a text field the focus sounds really strange in my ears.

We could obviously extend the API of the text fields with a boolean property "showPlaceholderWhileFocused" and give the responsibility to decide on the wanted behaviour to the application developer. But at least me would prefer a consistent behaviour for all text fields.</pre>
 </blockquote>





 <p>On May 10th, 2012, 7:01 p.m., <b>Mark Gaiser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The behavior is consistent right now. The defacto "standard" on the internet right now for forms seems to be to have a placeholder text and remove the placeholder as soon as the field gets focus. However, lately there have been more sites that do keep the placeholder even while focused and only moves away if you start typing. Like for example the twitter login page (though that does make the placeholder text a bit more transparent when you have the focus).

I think both options should be provided, but the default should be to remove the placeholder as soon as it gets focus.

Yet again just my opinion.</pre>
 </blockquote>





 <p>On May 10th, 2012, 8:17 p.m., <b>Mathias Kraus</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">How about the following:
- pre-focused text field shows the placeholder
- if the user press any key (e.g. Esc, arrow keys, backspace) or starts typing, the placeholder disappears and does't appear again, even if the text field is empty
- it the user clicks into a text field, the placeholder also disappears immediatelly</pre>
 </blockquote>





 <p>On May 10th, 2012, 8:19 p.m., <b>Laszlo Papp</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I do not have too strong opinions about either way; just some additional data fwiw:

1) QLineEdit - clear for focus
http://qt-project.org/doc/qt-4.8/qlineedit.html#placeholderText-prop

2) KLineEdit - most likely the same since there is no such an addition for KLineEdit, but inherits this from QLineEdit

3) Harmattan components: clear for typing

4) Symbian components: http://doc.qt.nokia.com/qt-components-symbian/qml-textfield.html#placeholderText-prop

5) Interesting that the following html practice shares the opinions as well:
http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_input_placeholder

On Linux with firefox, rekonq and so forth, it produces the behavior that the placeholder is gone for focus. On the contrary, the form keeps the placeholder until typing on Windows.</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The reason for the "clear on focus" behavior is to not confuse the user about the content as soon as the entry is focused ("about to be used")

The "legacy" way in this regard (pre-focused & hinting lineedits) was to also prefill the lineedit with the hint and pre-select the entire text (especially if you really just want some input here or assume a "Cancel" otherwise)
Maybe -and if an empty string is no valid entry- one could merge those - start with the prefilled selection, remove it and show the hint when the focus is lost w/o typing.
No idea whether this can be done in a purely declarative way, though.

As for changing the focus with a timer, ie. while the event chain is running - a hack that would QTimer::singleShot(3, this, SLOT) to cross some queued init code is one thing (not deterministic but may still do the job) - stuff like QTimer::singleShot(5000, this, SLOT) to show the hint for some seconds and then activate the linenedit means tricking the user (you could usually as well QTimer::singleShot(randomTime, this, randomSlot) - good way to piss users ;-)</pre>
<br />








<p>- Thomas</p>


<br />
<p>On May 9th, 2012, 4:53 p.m., Sebastian Gottfried wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDE Runtime.</div>
<div>By Sebastian Gottfried.</div>


<p style="color: grey;"><i>Updated May 9, 2012, 4:53 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Rationale: This allows the application to pre-focus a text field with a
placeholder text for the user. In the version before this would have
hidden the placeholder text and it may not have been obvious for user
what he was expected to enter in the text field.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Used it in ktouch/next, works fine.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>plasma/declarativeimports/plasmacomponents/qml/TextArea.qml <span style="color: grey">(2d9e89f)</span></li>

 <li>plasma/declarativeimports/plasmacomponents/qml/TextField.qml <span style="color: grey">(4ed15d9)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/104895/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Screenshots </h1>

<div>

 <a href="http://git.reviewboard.kde.org/r/104895/s/562/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2012/05/09/placeholder-with-focus_400x100.png" style="border: 1px black solid;" alt="Form in KTouch" /></a>

</div>


  </td>
 </tr>
</table>








  </div>
 </body>
</html>