[entry] use normal text colour when pasting in entry

This commit is contained in:
Hylke Bons 2010-10-08 17:52:46 +01:00
parent 341dd10747
commit 478351dddb

View file

@ -29,25 +29,14 @@ namespace SparkleShare {
ExampleTextActive = true; ExampleTextActive = true;
FocusGrabbed += delegate { FocusGrabbed += delegate { OnEntered (); };
ClipboardPasted += delegate { OnEntered (); };
if (ExampleTextActive) {
ExampleTextActive = false;
Text = "";
UseNormalTextColor ();
}
};
FocusOutEvent += delegate { FocusOutEvent += delegate {
if (Text.Equals ("") || Text == null) { if (Text.Equals ("") || Text == null)
ExampleTextActive = true; ExampleTextActive = true;
}
if (ExampleTextActive) if (ExampleTextActive)
UseExampleText (); UseExampleText ();
@ -56,6 +45,20 @@ namespace SparkleShare {
} }
private void OnEntered ()
{
if (ExampleTextActive) {
ExampleTextActive = false;
Text = "";
UseNormalTextColor ();
}
}
public string ExampleText public string ExampleText
{ {