gnome about: Remove hacky implementation of links
This commit is contained in:
parent
dbf1367b22
commit
81939b4bb9
|
@ -116,7 +116,7 @@ namespace SparkleShare {
|
|||
|
||||
|
||||
Label copyright = new Label () {
|
||||
Text = "Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others.",
|
||||
Markup = string.Format ("Copyright © 2010–{0} Hylke Bons and others.", DateTime.Now.Year),
|
||||
Xalign = 0, Xpad = 0
|
||||
};
|
||||
|
||||
|
@ -164,30 +164,17 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public class SparkleLink : EventBox {
|
||||
public class SparkleLink : Label {
|
||||
|
||||
public SparkleLink (string text, string url)
|
||||
{
|
||||
VisibleWindow = false;
|
||||
Markup = string.Format ("<a href=\"{0}\"><span fgcolor=\"#729fcf\">{1}</span></a>", url, text);
|
||||
CanFocus = false;
|
||||
|
||||
Label label = new Label () {
|
||||
Markup = "<span underline='single'>" + text + "</span>"
|
||||
};
|
||||
|
||||
Gdk.RGBA highlight = new Gdk.RGBA ();
|
||||
highlight.Parse ("#729fcf");
|
||||
|
||||
Pango.FontDescription font = new Button ().StyleContext.GetFont (StateFlags.Normal);
|
||||
Pango.FontDescription font = StyleContext.GetFont (StateFlags.Normal);
|
||||
font.Size = 9 * 1024;
|
||||
|
||||
label.OverrideFont (font);
|
||||
label.OverrideColor (StateFlags.Normal, highlight);
|
||||
|
||||
EnterNotifyEvent += delegate { Window.Cursor = new Gdk.Cursor (Gdk.CursorType.Hand1); };
|
||||
LeaveNotifyEvent += delegate { Window.Cursor = new Gdk.Cursor (Gdk.CursorType.Arrow); };
|
||||
ButtonPressEvent += delegate { Program.Controller.OpenWebsite (url); };
|
||||
|
||||
Add (label);
|
||||
OverrideFont (font);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,11 +201,5 @@ namespace SparkleShare {
|
|||
Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
|
||||
clipboard.Text = text;
|
||||
}
|
||||
|
||||
|
||||
public override void OpenWebsite (string url)
|
||||
{
|
||||
OpenFile (url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace SparkleShare {
|
|||
public abstract void OpenFile (string path);
|
||||
|
||||
// Opens a file with the appropriate application
|
||||
public abstract void OpenWebsite (string url);
|
||||
public virtual void OpenWebsite (string url) { }
|
||||
|
||||
// Copies text to the clipboard
|
||||
public abstract void CopyToClipboard (string text);
|
||||
|
|
Loading…
Reference in a new issue