diff --git a/SparkleShare/Mac/SparkleIntro.cs b/SparkleShare/Mac/SparkleIntro.cs index 71dd6580..84811f85 100644 --- a/SparkleShare/Mac/SparkleIntro.cs +++ b/SparkleShare/Mac/SparkleIntro.cs @@ -20,11 +20,11 @@ using System.Drawing; using System.IO; using System.Timers; +using Mono.Unix; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.ObjCRuntime; using MonoMac.WebKit; -using Mono.Unix; namespace SparkleShare { diff --git a/SparkleShare/SparkleAbout.cs b/SparkleShare/SparkleAbout.cs index 7fffcb15..d21ce1a3 100644 --- a/SparkleShare/SparkleAbout.cs +++ b/SparkleShare/SparkleAbout.cs @@ -26,26 +26,26 @@ using Mono.Unix; namespace SparkleShare { - public class SparkleAbout : Window { + public class SparkleAbout : Window { - private Label Version; + private Label Version; - // Short alias for the translations - public static string _(string s) - { - return Catalog.GetString (s); - } + // Short alias for the translations + public static string _(string s) + { + return Catalog.GetString (s); + } - public SparkleAbout () : base ("") - { - DefaultSize = new Gdk.Size (360, 260); - BorderWidth = 0; - IconName = "folder-sparkleshare"; - WindowPosition = WindowPosition.Center; - Title = "About SparkleShare"; - Resizable = false; + public SparkleAbout () : base ("") + { + DefaultSize = new Gdk.Size (360, 260); + BorderWidth = 0; + IconName = "folder-sparkleshare"; + WindowPosition = WindowPosition.Center; + Title = "About SparkleShare"; + Resizable = false; CreateAbout (); @@ -64,16 +64,14 @@ namespace SparkleShare { }; SparkleShare.Controller.CheckForNewVersion (); - } + } private void CreateAbout () { - Gdk.Color color = Style.Foreground (StateType.Insensitive); string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color); - EventBox box = new EventBox (); box.ModifyBg (StateType.Normal, new TreeView ().Style.Base (StateType.Normal)); @@ -86,7 +84,6 @@ namespace SparkleShare { box.Add (header); - Version = new Label () { Markup = "Checking for updates...", Xalign = 0, @@ -152,10 +149,6 @@ namespace SparkleShare { vbox.PackStart (button_bar, false, false, 0); Add (vbox); - } - - } - + } } - diff --git a/SparkleShare/SparkleEntry.cs b/SparkleShare/SparkleEntry.cs index 48349549..14d62363 100644 --- a/SparkleShare/SparkleEntry.cs +++ b/SparkleShare/SparkleEntry.cs @@ -14,99 +14,79 @@ // You should have received a copy of the GNU General private License // along with this program. If not, see . + using Gtk; namespace SparkleShare { - public class SparkleEntry : Entry { + public class SparkleEntry : Entry { - public bool ExampleTextActive; - private string pExampleText; + public bool ExampleTextActive; + private string pExampleText; - public SparkleEntry () - { + public SparkleEntry () + { + ExampleTextActive = true; - ExampleTextActive = true; + FocusGrabbed += delegate { OnEntered (); }; + ClipboardPasted += delegate { OnEntered (); }; + + FocusOutEvent += delegate { - FocusGrabbed += delegate { OnEntered (); }; - ClipboardPasted += delegate { OnEntered (); }; - - FocusOutEvent += delegate { + if (Text.Equals ("") || Text == null) + ExampleTextActive = true; - if (Text.Equals ("") || Text == null) - ExampleTextActive = true; - - if (ExampleTextActive) - UseExampleText (); - - }; - - } + if (ExampleTextActive) + UseExampleText (); + }; + } - private void OnEntered () - { - - if (ExampleTextActive) { - - ExampleTextActive = false; - Text = ""; - UseNormalTextColor (); - - } - - } + private void OnEntered () + { + if (ExampleTextActive) { + ExampleTextActive = false; + Text = ""; + UseNormalTextColor (); + } + } - public string ExampleText - { + public string ExampleText + { + get { + return pExampleText; + } - get { + set { + pExampleText = value; - return pExampleText; + if (ExampleTextActive) { - } + UseExampleText (); - set { - - pExampleText = value; - - if (ExampleTextActive) { - - UseExampleText (); - - } - - } - - } + } + } + } - private void UseExampleText () - { - - Text = pExampleText; - UseSecondaryTextColor (); - - } + private void UseExampleText () + { + Text = pExampleText; + UseSecondaryTextColor (); + } - private void UseSecondaryTextColor () - { - - ModifyText (StateType.Normal, Style.Foreground (StateType.Insensitive)); - - } + private void UseSecondaryTextColor () + { + ModifyText (StateType.Normal, Style.Foreground (StateType.Insensitive)); + } - private void UseNormalTextColor () - { - - ModifyText (StateType.Normal, Style.Foreground (StateType.Normal)); - - } - - } - + private void UseNormalTextColor () + { + ModifyText (StateType.Normal, Style.Foreground (StateType.Normal)); + } + } } diff --git a/SparkleShare/SparkleInfobar.cs b/SparkleShare/SparkleInfobar.cs index 0a4f1a21..a7d85732 100644 --- a/SparkleShare/SparkleInfobar.cs +++ b/SparkleShare/SparkleInfobar.cs @@ -14,42 +14,37 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + using Gtk; namespace SparkleShare { - // An infobar - public class SparkleInfobar : EventBox - { + // An infobar + public class SparkleInfobar : EventBox { - public SparkleInfobar (string icon_name, string title, string text) - { + public SparkleInfobar (string icon_name, string title, string text) + { + Window window = new Window (WindowType.Popup) { + Name = "gtk-tooltip" + }; - Window window = new Window (WindowType.Popup) { - Name = "gtk-tooltip" - }; + window.EnsureStyle (); + Style = window.Style; - window.EnsureStyle (); + Label label = new Label () { + Markup = "" + title + "\n" + text + }; - Style = window.Style; + HBox hbox = new HBox (false, 12) { + BorderWidth = 12 + }; - Label label = new Label () { - Markup = "" + title + "\n" + text - }; + hbox.PackStart (new Image (SparkleUIHelpers.GetIcon (icon_name, 24)), + false, false, 0); - HBox hbox = new HBox (false, 12) { - BorderWidth = 12 - }; - - hbox.PackStart (new Image (SparkleUIHelpers.GetIcon (icon_name, 24)), - false, false, 0); - - hbox.PackStart (label, false, false, 0); - - Add (hbox); - - } - - } + hbox.PackStart (label, false, false, 0); + Add (hbox); + } + } }