Open roman-yagodin opened 4 years ago
Clipboard watcher updates paste buttons state depending on the content of the clipboard, so user will not need to guess which button to click.
Skeleton implementation:
void InitTimer () { var timer = new ThreadStart (() => { while (true) { Thread.Sleep (500); if (Clipboard.ContainsData (TransferDataType.Html)) { Application.Invoke (() => { // TODO: Check widget state before change it TextCleanerWidget.btnPasteHtml.Sensitive = true; }); // Console.WriteLine ("Clipboard contains HTML."); } else { Application.Invoke (() => { // TODO: Check widget state before change it TextCleanerWidget.btnPasteHtml.Sensitive = false; }); } if (Clipboard.ContainsData (TransferDataType.Text)) { // Console.WriteLine ("Clipboard contains text."); } } }); var timerThread = new Thread (timer); timerThread.Start (); }
Clipboard watcher updates paste buttons state depending on the content of the clipboard, so user will not need to guess which button to click.
Skeleton implementation: