Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@xamarin.com>2014-03-05 17:21:10 +0400
committerMike Krüger <mkrueger@xamarin.com>2014-03-05 17:21:21 +0400
commit67120e1354abc46e63523a587fd4823921cf95f6 (patch)
treeb7db00151a6dd9cc0a27aeba9386e0f73f3a6c14 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage
parent403db439859cc5ef769e6809d33b56701ecd0ea0 (diff)
[Ide] Welcome page buttons are now more flexible.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs71
2 files changed, 42 insertions, 35 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs
index ea86cf4769..958cbd3cb0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs
@@ -59,6 +59,12 @@ namespace MonoDevelop.Ide.WelcomePage
set { box.Spacing = value; }
}
+ public bool MouseOver {
+ get {
+ return mouseOver;
+ }
+ }
+
public WelcomePageBarButton (string title, string href, string iconResource = null)
{
FontFamily = Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
index eb3c9c6794..10c6429c6f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
@@ -223,44 +223,45 @@ namespace MonoDevelop.Ide.WelcomePage
Pango.CairoHelper.ShowLayout (ctx, layout);
}
+ protected virtual void DrawHoverBackground (Cairo.Context ctx)
+ {
+ if (BorderPadding <= 0) {
+ ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
+ ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBackgroundColor));
+ ctx.Fill ();
+ ctx.MoveTo (Allocation.X, Allocation.Y + 0.5);
+ ctx.RelLineTo (Allocation.Width, 0);
+ ctx.MoveTo (Allocation.X, Allocation.Y + Allocation.Height - 0.5);
+ ctx.RelLineTo (Allocation.Width, 0);
+ if (DrawRightBorder) {
+ ctx.MoveTo (Allocation.Right + 0.5, Allocation.Y + 0.5);
+ ctx.LineTo (Allocation.Right + 0.5, Allocation.Bottom - 0.5);
+ }
+ if (DrawLeftBorder) {
+ ctx.MoveTo (Allocation.Left + 0.5, Allocation.Y + 0.5);
+ ctx.LineTo (Allocation.Left + 0.5, Allocation.Bottom - 0.5);
+ }
+ ctx.LineWidth = 1;
+ ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBorderColor));
+ ctx.Stroke ();
+ }
+ else {
+ Gdk.Rectangle region = Allocation;
+ region.Inflate (-BorderPadding, -BorderPadding);
+ ctx.RoundedRectangle (region.X + 0.5, region.Y + 0.5, region.Width - 1, region.Height - 1, 3);
+ ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBackgroundColor));
+ ctx.FillPreserve ();
+ ctx.LineWidth = 1;
+ ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBorderColor));
+ ctx.Stroke ();
+ }
+ }
+
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) {
- if (mouseOver) {
- if (BorderPadding <= 0) {
- ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
- ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBackgroundColor));
- ctx.Fill ();
- ctx.MoveTo (Allocation.X, Allocation.Y + 0.5);
- ctx.RelLineTo (Allocation.Width, 0);
- ctx.MoveTo (Allocation.X, Allocation.Y + Allocation.Height - 0.5);
- ctx.RelLineTo (Allocation.Width, 0);
-
- if (DrawRightBorder) {
- ctx.MoveTo (Allocation.Right + 0.5, Allocation.Y + 0.5);
- ctx.LineTo (Allocation.Right + 0.5, Allocation.Bottom - 0.5);
- }
- if (DrawLeftBorder) {
- ctx.MoveTo (Allocation.Left + 0.5, Allocation.Y + 0.5);
- ctx.LineTo (Allocation.Left + 0.5, Allocation.Bottom - 0.5);
- }
-
- ctx.LineWidth = 1;
- ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBorderColor));
- ctx.Stroke ();
- } else {
- Gdk.Rectangle region = Allocation;
- region.Inflate (-BorderPadding, -BorderPadding);
-
- ctx.RoundedRectangle (region.X + 0.5, region.Y + 0.5, region.Width - 1, region.Height - 1, 3);
- ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBackgroundColor));
- ctx.FillPreserve ();
-
- ctx.LineWidth = 1;
- ctx.SetSourceColor (CairoExtensions.ParseColor (HoverBorderColor));
- ctx.Stroke ();
- }
- }
+ if (mouseOver)
+ DrawHoverBackground (ctx);
// Draw the icon