From 478351dddb5513a878bc4d4fb07368d7439742e6 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 8 Oct 2010 17:52:46 +0100 Subject: [PATCH] [entry] use normal text colour when pasting in entry --- SparkleShare/SparkleEntry.cs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/SparkleShare/SparkleEntry.cs b/SparkleShare/SparkleEntry.cs index 7e4fe64b..ebe1e6ab 100644 --- a/SparkleShare/SparkleEntry.cs +++ b/SparkleShare/SparkleEntry.cs @@ -29,25 +29,14 @@ namespace SparkleShare { ExampleTextActive = true; - FocusGrabbed += delegate { - - if (ExampleTextActive) { - - ExampleTextActive = false; - Text = ""; - UseNormalTextColor (); - - } - - }; + FocusGrabbed += delegate { OnEntered (); }; + ClipboardPasted += delegate { OnEntered (); }; FocusOutEvent += delegate { - if (Text.Equals ("") || Text == null) { + if (Text.Equals ("") || Text == null) ExampleTextActive = true; - } - if (ExampleTextActive) UseExampleText (); @@ -56,6 +45,20 @@ namespace SparkleShare { } + private void OnEntered () + { + + if (ExampleTextActive) { + + ExampleTextActive = false; + Text = ""; + UseNormalTextColor (); + + } + + } + + public string ExampleText {