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:
authorJason Smith <jassmith@gmail.com>2012-11-16 23:01:02 +0400
committerJason Smith <jassmith@gmail.com>2012-11-16 23:01:02 +0400
commit8958e23f7fc7eba2c47d6ae410b69cada320157d (patch)
treea44e1e6b132700efe2631a45b79aa368821985c6 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage
parent735e4d6d0ac78056e123c7bc10a543b868766cc9 (diff)
[UIRefresh] Update new/open button on welcome page to use more compact styling.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs65
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.pngbin1305 -> 1191 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.pngbin1202 -> 1085 bytes
4 files changed, 49 insertions, 26 deletions
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 9c21f852a0..963f891b59 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
@@ -50,6 +50,11 @@ namespace MonoDevelop.Ide.WelcomePage
public bool DrawLeftBorder { get; set; }
public bool DrawRightBorder { get; set; }
+ public int BorderPadding { get; set; }
+
+ public int LeftTextPadding { get; set; }
+ public int InternalPadding { get; set; }
+
static WelcomePageListButton ()
{
starNormal = Gdk.Pixbuf.LoadFromResource ("star-normal.png");
@@ -68,6 +73,9 @@ namespace MonoDevelop.Ide.WelcomePage
WidthRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width;
HeightRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Height + 2;
Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask);
+
+ LeftTextPadding = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TextLeftPadding;
+ InternalPadding = Styles.WelcomeScreen.Pad.Padding;
}
public bool AllowPinning { get; set; }
@@ -127,31 +135,44 @@ namespace MonoDevelop.Ide.WelcomePage
{
using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) {
if (mouseOver) {
- ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
- ctx.Color = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.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);
+ if (BorderPadding <= 0) {
+ ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
+ ctx.Color = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.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.Color = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.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.Color = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBackgroundColor);
+ ctx.FillPreserve ();
+
+ ctx.LineWidth = 1;
+ ctx.Color = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBorderColor);
+ ctx.Stroke ();
}
-
- ctx.LineWidth = 1;
- ctx.Color = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBorderColor);
- ctx.Stroke ();
}
// Draw the icon
- int x = Allocation.X + Styles.WelcomeScreen.Pad.Padding;
+ int x = Allocation.X + InternalPadding;
int y = Allocation.Y + (Allocation.Height - icon.Height) / 2;
Gdk.CairoHelper.SetSourcePixbuf (ctx, icon, x, y);
ctx.Paint ();
@@ -178,7 +199,7 @@ namespace MonoDevelop.Ide.WelcomePage
// Draw the text
- int textWidth = Allocation.Width - Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TextLeftPadding - Styles.WelcomeScreen.Pad.Padding * 2;
+ int textWidth = Allocation.Width - LeftTextPadding - InternalPadding * 2;
var face = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
Pango.Layout titleLayout = new Pango.Layout (PangoContext);
@@ -206,7 +227,7 @@ namespace MonoDevelop.Ide.WelcomePage
height += h2;
}
- int tx = Allocation.X + Styles.WelcomeScreen.Pad.Padding + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TextLeftPadding;
+ int tx = Allocation.X + InternalPadding + LeftTextPadding;
int ty = Allocation.Y + (Allocation.Height - height) / 2;
ctx.MoveTo (tx, ty);
Pango.CairoHelper.ShowLayout (ctx, titleLayout);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs
index bd4385ce84..52fec460bd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs
@@ -82,13 +82,15 @@ namespace MonoDevelop.Ide.WelcomePage
Gtk.HBox hbox = new HBox ();
var btn = new WelcomePageListButton (GettextCatalog.GetString ("New..."), null, newProjectIcon, "monodevelop://MonoDevelop.Ide.Commands.FileCommands.NewProject");
- btn.WidthRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width / 2;
- btn.DrawRightBorder = true;
+ btn.WidthRequest = (int) (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width / 2.3);
+ btn.BorderPadding = 6;
+ btn.LeftTextPadding = 24;
hbox.PackStart (btn, false, false, 0);
btn = new WelcomePageListButton (GettextCatalog.GetString ("Open..."), null, openProjectIcon, "monodevelop://MonoDevelop.Ide.Commands.FileCommands.OpenFile");
- btn.WidthRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width / 2;
- btn.DrawLeftBorder = true;
+ btn.WidthRequest = (int) (Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width / 2.3);
+ btn.BorderPadding = 6;
+ btn.LeftTextPadding = 24;
hbox.PackStart (btn, false, false, 0);
box.PackStart (hbox, false, false, 0);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png
index d39cff7e2a..c2197388ab 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png
index 263798dbdb..111660560e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png
Binary files differ