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 () {
|
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
|
Xalign = 0, Xpad = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ namespace SparkleShare {
|
||||||
SparkleLink website_link = new SparkleLink ("Website", Controller.WebsiteLinkAddress);
|
SparkleLink website_link = new SparkleLink ("Website", Controller.WebsiteLinkAddress);
|
||||||
SparkleLink credits_link = new SparkleLink ("Credits", Controller.CreditsLinkAddress);
|
SparkleLink credits_link = new SparkleLink ("Credits", Controller.CreditsLinkAddress);
|
||||||
SparkleLink report_problem_link = new SparkleLink ("Report a problem", Controller.ReportProblemLinkAddress);
|
SparkleLink report_problem_link = new SparkleLink ("Report a problem", Controller.ReportProblemLinkAddress);
|
||||||
SparkleLink debug_log_link = new SparkleLink ("Debug log", Controller.DebugLogLinkAddress);
|
SparkleLink debug_log_link = new SparkleLink ("Debug log", Controller.DebugLogLinkAddress);
|
||||||
|
|
||||||
|
|
||||||
layout_vertical.PackStart (new Label (""), true, true, 0);
|
layout_vertical.PackStart (new Label (""), true, true, 0);
|
||||||
|
@ -164,30 +164,17 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class SparkleLink : EventBox {
|
public class SparkleLink : Label {
|
||||||
|
|
||||||
public SparkleLink (string text, string url)
|
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 () {
|
Pango.FontDescription font = StyleContext.GetFont (StateFlags.Normal);
|
||||||
Markup = "<span underline='single'>" + text + "</span>"
|
|
||||||
};
|
|
||||||
|
|
||||||
Gdk.RGBA highlight = new Gdk.RGBA ();
|
|
||||||
highlight.Parse ("#729fcf");
|
|
||||||
|
|
||||||
Pango.FontDescription font = new Button ().StyleContext.GetFont (StateFlags.Normal);
|
|
||||||
font.Size = 9 * 1024;
|
font.Size = 9 * 1024;
|
||||||
|
|
||||||
label.OverrideFont (font);
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,11 +201,5 @@ namespace SparkleShare {
|
||||||
Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
|
Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
|
||||||
clipboard.Text = text;
|
clipboard.Text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void OpenWebsite (string url)
|
|
||||||
{
|
|
||||||
OpenFile (url);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace SparkleShare {
|
||||||
public abstract void OpenFile (string path);
|
public abstract void OpenFile (string path);
|
||||||
|
|
||||||
// Opens a file with the appropriate application
|
// Opens a file with the appropriate application
|
||||||
public abstract void OpenWebsite (string url);
|
public virtual void OpenWebsite (string url) { }
|
||||||
|
|
||||||
// Copies text to the clipboard
|
// Copies text to the clipboard
|
||||||
public abstract void CopyToClipboard (string text);
|
public abstract void CopyToClipboard (string text);
|
||||||
|
|
Loading…
Reference in a new issue