intro about entry infobar: fix coding style and whitespace

This commit is contained in:
Hylke Bons 2011-05-14 00:18:57 +01:00
parent 6c354b2473
commit f7a7276fcc
4 changed files with 91 additions and 123 deletions

View file

@ -20,11 +20,11 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Timers; using System.Timers;
using Mono.Unix;
using MonoMac.Foundation; using MonoMac.Foundation;
using MonoMac.AppKit; using MonoMac.AppKit;
using MonoMac.ObjCRuntime; using MonoMac.ObjCRuntime;
using MonoMac.WebKit; using MonoMac.WebKit;
using Mono.Unix;
namespace SparkleShare { namespace SparkleShare {

View file

@ -69,11 +69,9 @@ namespace SparkleShare {
private void CreateAbout () private void CreateAbout ()
{ {
Gdk.Color color = Style.Foreground (StateType.Insensitive); Gdk.Color color = Style.Foreground (StateType.Insensitive);
string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color); string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color);
EventBox box = new EventBox (); EventBox box = new EventBox ();
box.ModifyBg (StateType.Normal, new TreeView ().Style.Base (StateType.Normal)); box.ModifyBg (StateType.Normal, new TreeView ().Style.Base (StateType.Normal));
@ -86,7 +84,6 @@ namespace SparkleShare {
box.Add (header); box.Add (header);
Version = new Label () { Version = new Label () {
Markup = "<small>Checking for updates...</small>", Markup = "<small>Checking for updates...</small>",
Xalign = 0, Xalign = 0,
@ -152,10 +149,6 @@ namespace SparkleShare {
vbox.PackStart (button_bar, false, false, 0); vbox.PackStart (button_bar, false, false, 0);
Add (vbox); Add (vbox);
} }
} }
} }

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General private License // You should have received a copy of the GNU General private License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using Gtk; using Gtk;
namespace SparkleShare { namespace SparkleShare {
@ -26,7 +27,6 @@ namespace SparkleShare {
public SparkleEntry () public SparkleEntry ()
{ {
ExampleTextActive = true; ExampleTextActive = true;
FocusGrabbed += delegate { OnEntered (); }; FocusGrabbed += delegate { OnEntered (); };
@ -39,37 +39,27 @@ namespace SparkleShare {
if (ExampleTextActive) if (ExampleTextActive)
UseExampleText (); UseExampleText ();
}; };
} }
private void OnEntered () private void OnEntered ()
{ {
if (ExampleTextActive) { if (ExampleTextActive) {
ExampleTextActive = false; ExampleTextActive = false;
Text = ""; Text = "";
UseNormalTextColor (); UseNormalTextColor ();
} }
} }
public string ExampleText public string ExampleText
{ {
get { get {
return pExampleText; return pExampleText;
} }
set { set {
pExampleText = value; pExampleText = value;
if (ExampleTextActive) { if (ExampleTextActive) {
@ -77,36 +67,26 @@ namespace SparkleShare {
UseExampleText (); UseExampleText ();
} }
} }
} }
private void UseExampleText () private void UseExampleText ()
{ {
Text = pExampleText; Text = pExampleText;
UseSecondaryTextColor (); UseSecondaryTextColor ();
} }
private void UseSecondaryTextColor () private void UseSecondaryTextColor ()
{ {
ModifyText (StateType.Normal, Style.Foreground (StateType.Insensitive)); ModifyText (StateType.Normal, Style.Foreground (StateType.Insensitive));
} }
private void UseNormalTextColor () private void UseNormalTextColor ()
{ {
ModifyText (StateType.Normal, Style.Foreground (StateType.Normal)); ModifyText (StateType.Normal, Style.Foreground (StateType.Normal));
} }
} }
} }

View file

@ -14,23 +14,21 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using Gtk; using Gtk;
namespace SparkleShare { namespace SparkleShare {
// An infobar // An infobar
public class SparkleInfobar : EventBox 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) { Window window = new Window (WindowType.Popup) {
Name = "gtk-tooltip" Name = "gtk-tooltip"
}; };
window.EnsureStyle (); window.EnsureStyle ();
Style = window.Style; Style = window.Style;
Label label = new Label () { Label label = new Label () {
@ -47,9 +45,6 @@ namespace SparkleShare {
hbox.PackStart (label, false, false, 0); hbox.PackStart (label, false, false, 0);
Add (hbox); Add (hbox);
} }
} }
} }