windows: implement full (but ugly) balloons
This commit is contained in:
parent
3bde9ccdc4
commit
21ad9a25ec
|
@ -16,7 +16,6 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
|
@ -30,7 +29,7 @@ namespace SparkleShare {
|
|||
Controller.ShowBubbleEvent += delegate (string title,
|
||||
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>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SparkleSetup.resx">
|
||||
<DependentUpon>SparkleSetup.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="..\..\data\about.png">
|
||||
<Link>Pixmaps\about.png</Link>
|
||||
</EmbeddedResource>
|
||||
|
|
|
@ -19,12 +19,10 @@ using System;
|
|||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Forms = System.Windows.Forms;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
using Forms = System.Windows.Forms;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
|
@ -46,7 +44,6 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
|
||||
|
||||
// Short alias for the translations
|
||||
public static string _ (string s)
|
||||
{
|
||||
|
@ -56,11 +53,6 @@ namespace SparkleShare {
|
|||
|
||||
public SparkleStatusIcon ()
|
||||
{
|
||||
LostFocus += delegate {
|
||||
|
||||
this.context_menu.IsOpen = false;
|
||||
};
|
||||
|
||||
AnimationFrames = CreateAnimationFrames ();
|
||||
Animation = CreateAnimation ();
|
||||
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
|
||||
// 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 ()
|
||||
{
|
||||
this.notify_icon.Dispose ();
|
||||
|
@ -351,5 +349,9 @@ namespace SparkleShare {
|
|||
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
[DllImport("user32.dll", EntryPoint = "DestroyIcon")]
|
||||
static extern bool DestroyIcon (IntPtr hIcon);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue