windows: add icons to the status icon menu
This commit is contained in:
parent
5685f86d47
commit
55005cfebd
17
AUTHORS
17
AUTHORS
|
@ -10,22 +10,18 @@ Points of contact:
|
||||||
Łukasz Jernaś <deejay1@srem.org>
|
Łukasz Jernaś <deejay1@srem.org>
|
||||||
|
|
||||||
|
|
||||||
Contributors:
|
Code:
|
||||||
|
|
||||||
Alejandro Serrano <trupill@gmail.com>
|
Alejandro Serrano <trupill@gmail.com>
|
||||||
Alexandre Saiz Verdaguer <a@alexandresaiz.com>
|
Alexandre Saiz Verdaguer <a@alexandresaiz.com>
|
||||||
Alex Hudson <home@alexhudson.com>
|
Alex Hudson <home@alexhudson.com>
|
||||||
Allan Day <allanpday@gmail.com>
|
|
||||||
Andreas Nilsson <andreasn@gnome.org>
|
|
||||||
Benjamin Podszun <benjamin.podszun@gmail.com>
|
Benjamin Podszun <benjamin.podszun@gmail.com>
|
||||||
Bertrand Lorentz <bertrand.lorentz@gmail.com>
|
Bertrand Lorentz <bertrand.lorentz@gmail.com>
|
||||||
Gabriel Burt <gabriel.burt@gmail.com>
|
Gabriel Burt <gabriel.burt@gmail.com>
|
||||||
Garrett LeSage <garrett@novell.com>
|
Garrett LeSage <garrett@novell.com>
|
||||||
Hylke Bons <hylkebons@gmail.com>
|
Hylke Bons <hylkebons@gmail.com>
|
||||||
Jakub Steiner <jimmac@redhat.com>
|
|
||||||
Kristi Tsukida <kristi.tsukida@gmail.com>
|
Kristi Tsukida <kristi.tsukida@gmail.com>
|
||||||
Konstantinos Vaggelakos <kozze89@gmail.com>
|
Konstantinos Vaggelakos <kozze89@gmail.com>
|
||||||
Lapo Calamandrei <calamandrei@gmail.com>
|
|
||||||
Lars Falk-Petersen <dev@falk-petersen.no>
|
Lars Falk-Petersen <dev@falk-petersen.no>
|
||||||
Luis Cordova <cordoval@gmail.com>
|
Luis Cordova <cordoval@gmail.com>
|
||||||
Łukasz Jernaś <deejay1@srem.org>
|
Łukasz Jernaś <deejay1@srem.org>
|
||||||
|
@ -43,6 +39,15 @@ Contributors:
|
||||||
Travis Glenn Hansen <travisghansen@yahoo.com>
|
Travis Glenn Hansen <travisghansen@yahoo.com>
|
||||||
Vincent Untz <vuntz@gnome.org>
|
Vincent Untz <vuntz@gnome.org>
|
||||||
Will Thompson <will@willthompson.co.uk>
|
Will Thompson <will@willthompson.co.uk>
|
||||||
|
|
||||||
|
|
||||||
|
Artwork:
|
||||||
|
|
||||||
Thanks very much!
|
Andreas Nilsson <andreasn@gnome.org>
|
||||||
|
Jakub Steiner <jimmac@redhat.com>
|
||||||
|
Hylke Bons <hylkebons@gmail.com>
|
||||||
|
Lapo Calamandrei <calamandrei@gmail.com>
|
||||||
|
Yusuke Kamiyamane <p.yusukekamiyamane.com>
|
||||||
|
|
||||||
|
|
||||||
|
Thanks very much!
|
||||||
|
|
|
@ -245,6 +245,12 @@
|
||||||
<EmbeddedResource Include="..\..\data\tutorial-slide-2-windows.png">
|
<EmbeddedResource Include="..\..\data\tutorial-slide-2-windows.png">
|
||||||
<Link>Pixmaps\tutorial-slide-2-windows.png</Link>
|
<Link>Pixmaps\tutorial-slide-2-windows.png</Link>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="..\..\data\icons\folder-sparkleshare-windows-16.png">
|
||||||
|
<Link>Pixmaps\folder-sparkleshare-windows-16.png</Link>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="..\..\data\icons\folder-windows-16.png">
|
||||||
|
<Link>Pixmaps\folder-windows-16.png</Link>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Icons.tt">
|
<None Include="Icons.tt">
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace SparkleShare {
|
||||||
private int FrameNumber;
|
private int FrameNumber;
|
||||||
private string StateText;
|
private string StateText;
|
||||||
private ContextMenu context_menu;
|
private ContextMenu context_menu;
|
||||||
private MenuItem exit_item;
|
private SparkleMenuItem exit_item;
|
||||||
|
|
||||||
private Forms.NotifyIcon notify_icon = new Forms.NotifyIcon () {
|
private Forms.NotifyIcon notify_icon = new Forms.NotifyIcon () {
|
||||||
Text = "SparkleShare",
|
Text = "SparkleShare",
|
||||||
|
@ -147,28 +147,26 @@ namespace SparkleShare {
|
||||||
{
|
{
|
||||||
this.context_menu = new ContextMenu ();
|
this.context_menu = new ContextMenu ();
|
||||||
|
|
||||||
MenuItem status_item = new MenuItem () {
|
SparkleMenuItem status_item = new SparkleMenuItem () {
|
||||||
Header = StateText,
|
Header = StateText,
|
||||||
IsEnabled = false
|
IsEnabled = false
|
||||||
};
|
};
|
||||||
|
|
||||||
System.Windows.Controls.Image i = new System.Windows.Controls.Image();
|
System.Windows.Controls.Image i = new System.Windows.Controls.Image();
|
||||||
i.Source =
|
i.Source = SparkleUIHelpers.GetImageSource ("folder-sparkleshare-windows-16");
|
||||||
System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
|
i.Width = 16;
|
||||||
Icons.folder_sparkleshare_16.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty,
|
i.Height = 16;
|
||||||
System.Windows.Media.Imaging.BitmapSizeOptions.FromWidthAndHeight(16, 16));
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem folder_item = new MenuItem () {
|
SparkleMenuItem folder_item = new SparkleMenuItem () {
|
||||||
Header = "SparkleShare"//,
|
Header = "SparkleShare",
|
||||||
,Icon = i
|
Icon = i
|
||||||
};
|
};
|
||||||
|
|
||||||
folder_item.Click += delegate {
|
folder_item.Click += delegate {
|
||||||
Controller.SparkleShareClicked ();
|
Controller.SparkleShareClicked ();
|
||||||
};
|
};
|
||||||
|
|
||||||
MenuItem add_item = new MenuItem () {
|
SparkleMenuItem add_item = new SparkleMenuItem () {
|
||||||
Header = "Add Hosted Project…",
|
Header = "Add Hosted Project…",
|
||||||
IsEnabled = (!Program.Controller.FirstRun)
|
IsEnabled = (!Program.Controller.FirstRun)
|
||||||
};
|
};
|
||||||
|
@ -177,7 +175,7 @@ namespace SparkleShare {
|
||||||
Controller.AddHostedProjectClicked ();
|
Controller.AddHostedProjectClicked ();
|
||||||
};
|
};
|
||||||
|
|
||||||
MenuItem log_item = new MenuItem () {
|
SparkleMenuItem log_item = new SparkleMenuItem () {
|
||||||
Header = "View Recent Changes…",
|
Header = "View Recent Changes…",
|
||||||
IsEnabled = (Program.Controller.Folders.Count > 0)
|
IsEnabled = (Program.Controller.Folders.Count > 0)
|
||||||
};
|
};
|
||||||
|
@ -186,19 +184,19 @@ namespace SparkleShare {
|
||||||
Controller.OpenRecentEventsClicked ();
|
Controller.OpenRecentEventsClicked ();
|
||||||
};
|
};
|
||||||
|
|
||||||
MenuItem notify_item = new MenuItem ();
|
SparkleMenuItem notify_item = new SparkleMenuItem ();
|
||||||
|
|
||||||
if (Program.Controller.NotificationsEnabled)
|
if (Program.Controller.NotificationsEnabled)
|
||||||
notify_item = new MenuItem () { Header = "Turn Notifications Off" };
|
notify_item = new SparkleMenuItem () { Header = "Turn Notifications Off" };
|
||||||
else
|
else
|
||||||
notify_item = new MenuItem () { Header = "Turn Notifications On" };
|
notify_item = new SparkleMenuItem () { Header = "Turn Notifications On" };
|
||||||
|
|
||||||
notify_item.Click += delegate {
|
notify_item.Click += delegate {
|
||||||
Program.Controller.ToggleNotifications ();
|
Program.Controller.ToggleNotifications ();
|
||||||
CreateMenu ();
|
CreateMenu ();
|
||||||
};
|
};
|
||||||
|
|
||||||
MenuItem about_item = new MenuItem () {
|
SparkleMenuItem about_item = new SparkleMenuItem () {
|
||||||
Header = "About SparkleShare"
|
Header = "About SparkleShare"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -206,7 +204,7 @@ namespace SparkleShare {
|
||||||
Controller.AboutClicked ();
|
Controller.AboutClicked ();
|
||||||
};
|
};
|
||||||
|
|
||||||
exit_item = new MenuItem () {
|
exit_item = new SparkleMenuItem () {
|
||||||
Header = "Exit"
|
Header = "Exit"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -222,24 +220,29 @@ namespace SparkleShare {
|
||||||
|
|
||||||
if (Program.Controller.Folders.Count > 0) {
|
if (Program.Controller.Folders.Count > 0) {
|
||||||
foreach (string folder_name in Program.Controller.Folders) {
|
foreach (string folder_name in Program.Controller.Folders) {
|
||||||
MenuItem subfolder_item = new MenuItem () {
|
SparkleMenuItem subfolder_item = new SparkleMenuItem () {
|
||||||
Header = folder_name
|
Header = folder_name
|
||||||
};
|
};
|
||||||
|
|
||||||
subfolder_item.Click += OpenFolderDelegate (folder_name);
|
subfolder_item.Click += OpenFolderDelegate (folder_name);
|
||||||
|
|
||||||
subfolder_item.Icon = ErrorIcon;
|
System.Windows.Controls.Image i2 = new System.Windows.Controls.Image();
|
||||||
|
i2.Source = SparkleUIHelpers.GetImageSource ("folder-windows-16");
|
||||||
|
i2.Width = 16;
|
||||||
|
i2.Height = 16;
|
||||||
|
subfolder_item.Icon = i2;
|
||||||
/*
|
/*
|
||||||
if (Program.Controller.UnsyncedFolders.Contains (folder_name))
|
if (Program.Controller.UnsyncedFolders.Contains (folder_name))
|
||||||
subfolder_item.Icon = Icons.dialog_error_16;
|
subfolder_item.Icon = Icons.dialog_error_16;
|
||||||
else
|
else
|
||||||
subfolder_item.Icon = Icons.sparkleshare_windows_status;
|
subfolder_item.Icon = Icons.sparkleshare_windows_status;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
this.context_menu.Items.Add (subfolder_item);
|
this.context_menu.Items.Add (subfolder_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
MenuItem no_folders_item = new MenuItem () {
|
SparkleMenuItem no_folders_item = new SparkleMenuItem () {
|
||||||
Header = "No projects yet",
|
Header = "No projects yet",
|
||||||
IsEnabled = false
|
IsEnabled = false
|
||||||
};
|
};
|
||||||
|
@ -263,8 +266,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public void UpdateMenu ()
|
public void UpdateMenu ()
|
||||||
{
|
{
|
||||||
(this.context_menu.Items [0] as MenuItem).Header = StateText;
|
(this.context_menu.Items [0] as SparkleMenuItem).Header = StateText;
|
||||||
(this.context_menu.Items [0] as MenuItem).UpdateLayout ();
|
(this.context_menu.Items [0] as SparkleMenuItem).UpdateLayout ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -353,4 +356,13 @@ namespace SparkleShare {
|
||||||
[DllImport("user32.dll", EntryPoint = "DestroyIcon")]
|
[DllImport("user32.dll", EntryPoint = "DestroyIcon")]
|
||||||
static extern bool DestroyIcon (IntPtr hIcon);
|
static extern bool DestroyIcon (IntPtr hIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SparkleMenuItem : MenuItem {
|
||||||
|
|
||||||
|
public SparkleMenuItem () : base ()
|
||||||
|
{
|
||||||
|
Padding = new Thickness (6, 3, 4, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
data/icons/folder-sparkleshare-windows-16.png
Normal file
BIN
data/icons/folder-sparkleshare-windows-16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 729 B |
BIN
data/icons/folder-windows-16.png
Normal file
BIN
data/icons/folder-windows-16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 397 B |
1033
data/src/sparkleshare-windows.svg
Normal file
1033
data/src/sparkleshare-windows.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 41 KiB |
Loading…
Reference in a new issue