diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components/EventBoxTooltip.cs | 47 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs | 36 |
2 files changed, 42 insertions, 41 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/EventBoxTooltip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/EventBoxTooltip.cs index daba07577a..3d6e6223f9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/EventBoxTooltip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/EventBoxTooltip.cs @@ -37,8 +37,11 @@ namespace MonoDevelop.Components public class EventBoxTooltip : IDisposable
{
EventBox eventBox;
- string tip;
- TooltipPopoverWindow tooltipWindow;
+ TooltipPopoverWindow tooltipWindow; + ImageView image;
+ Pixbuf normalPixbuf;
+ Pixbuf activePixbuf;
+ string tip; bool mouseOver;
public Atk.Object Accessible {
@@ -51,11 +54,6 @@ namespace MonoDevelop.Components /// The EventBox should have Visible set to false otherwise the tooltip pop window
/// will have the wrong location.
/// </summary>
- - ImageView image;
- Pixbuf normalPixbuf;
- Pixbuf activePixbuf;
-
public EventBoxTooltip (EventBox eventBox)
{
this.eventBox = eventBox;
@@ -171,39 +169,6 @@ namespace MonoDevelop.Components public TaskSeverity? Severity { get; set; }
public PopupPosition Position { get; set; }
- } -#region Extension method for Pixbuf - internal static class PixbufExtension
- {
- public static unsafe Pixbuf ColorShiftPixbuf (this Pixbuf src, byte shift = 120)
- {
- var dest = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, src.BitsPerSample, src.Width, src.Height);
-
- byte* src_pixels_orig = (byte*)src.Pixels;
- byte* dest_pixels_orig = (byte*)dest.Pixels;
-
- for (int i = 0; i < src.Height; i++) {
- byte* src_pixels = src_pixels_orig + i * src.Rowstride;
- byte* dest_pixels = dest_pixels_orig + i * dest.Rowstride;
-
- for (int j = 0; j < src.Width; j++) {
- *(dest_pixels++) = PixelClamp (*(src_pixels++) + shift);
- *(dest_pixels++) = PixelClamp (*(src_pixels++) + shift);
- *(dest_pixels++) = PixelClamp (*(src_pixels++) + shift);
-
- if (src.HasAlpha) {
- *(dest_pixels++) = *(src_pixels++);
- }
- }
- }
- return dest;
- }
-
- static byte PixelClamp (int val)
- {
- return (byte)System.Math.Max (0, System.Math.Min (255, val));
- }
- } -#endregion
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs index e277d65b7c..2b7a3da97f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs @@ -39,6 +39,7 @@ using System.Threading.Tasks; using System.Net; using Xwt.Backends; using Gtk; +using Gdk; namespace MonoDevelop.Ide { @@ -837,6 +838,41 @@ namespace MonoDevelop.Ide image.Pixbuf = gravatar.Image.ToPixbuf (); }; } + + public static Pixbuf ColorShiftPixbuf (this Pixbuf src, byte shift = 120) + { + var dest = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, src.BitsPerSample, src.Width, src.Height); + + unsafe + { + + byte* src_pixels_orig = (byte*)src.Pixels; + byte* dest_pixels_orig = (byte*)dest.Pixels; + + for (int i = 0; i < src.Height; i++) { + byte* src_pixels = src_pixels_orig + i * src.Rowstride; + byte* dest_pixels = dest_pixels_orig + i * dest.Rowstride; + + for (int j = 0; j < src.Width; j++) { + *(dest_pixels++) = PixelClamp (*(src_pixels++) + shift); + *(dest_pixels++) = PixelClamp (*(src_pixels++) + shift); + *(dest_pixels++) = PixelClamp (*(src_pixels++) + shift); + + if (src.HasAlpha) { + *(dest_pixels++) = *(src_pixels++); + } + } + } + } + return dest; + } + + static byte PixelClamp (int val) + { + return (byte)System.Math.Max (0, System.Math.Min (255, val)); + } + + } class CustomImageLoader : Xwt.Drawing.IImageLoader |