windows: implement full (but ugly) balloons
This commit is contained in:
parent
3bde9ccdc4
commit
21ad9a25ec
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ namespace SparkleShare {
|
||||||
Controller.ShowBubbleEvent += delegate (string title,
|
Controller.ShowBubbleEvent += delegate (string title,
|
||||||
string subtext, string image_path) {
|
string subtext, string image_path) {
|
||||||
|
|
||||||
// TODO SparkleUI.StatusIcon.ShowBalloon (title, subtext, image_path);
|
SparkleUI.StatusIcon.ShowBalloon (title, subtext, image_path);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,10 +203,6 @@
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="SparkleSetup.resx">
|
|
||||||
<DependentUpon>SparkleSetup.cs</DependentUpon>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="..\..\data\about.png">
|
<EmbeddedResource Include="..\..\data\about.png">
|
||||||
<Link>Pixmaps\about.png</Link>
|
<Link>Pixmaps\about.png</Link>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
|
@ -19,12 +19,10 @@ using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using Forms = System.Windows.Forms;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
|
using Forms = System.Windows.Forms;
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
|
||||||
|
@ -46,7 +44,6 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Short alias for the translations
|
// Short alias for the translations
|
||||||
public static string _ (string s)
|
public static string _ (string s)
|
||||||
{
|
{
|
||||||
|
@ -56,11 +53,6 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public SparkleStatusIcon ()
|
public SparkleStatusIcon ()
|
||||||
{
|
{
|
||||||
LostFocus += delegate {
|
|
||||||
|
|
||||||
this.context_menu.IsOpen = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
AnimationFrames = CreateAnimationFrames ();
|
AnimationFrames = CreateAnimationFrames ();
|
||||||
Animation = CreateAnimation ();
|
Animation = CreateAnimation ();
|
||||||
notify_icon.Icon = AnimationFrames [0];
|
notify_icon.Icon = AnimationFrames [0];
|
||||||
|
@ -112,9 +104,6 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[DllImport("user32.dll", EntryPoint = "DestroyIcon")]
|
|
||||||
static extern bool DestroyIcon(IntPtr hIcon);
|
|
||||||
|
|
||||||
|
|
||||||
// Slices up the graphic that contains the
|
// Slices up the graphic that contains the
|
||||||
// animation frames.
|
// animation frames.
|
||||||
|
@ -317,6 +306,15 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void ShowBalloon (string title, string subtext, string image_path)
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
// - Use the image pointed to by image_path
|
||||||
|
// - Find a way to use the prettier (Win7?) balloons
|
||||||
|
this.notify_icon.ShowBalloonTip (5 * 1000, title, subtext, Forms.ToolTipIcon.Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Dispose ()
|
public void Dispose ()
|
||||||
{
|
{
|
||||||
this.notify_icon.Dispose ();
|
this.notify_icon.Dispose ();
|
||||||
|
@ -351,5 +349,9 @@ namespace SparkleShare {
|
||||||
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[DllImport("user32.dll", EntryPoint = "DestroyIcon")]
|
||||||
|
static extern bool DestroyIcon (IntPtr hIcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue