[entry] use normal text colour when pasting in entry
This commit is contained in:
parent
341dd10747
commit
478351dddb
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue