From 55005cfebdaf0fe6db817a1dee41699ccce09cdc Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 8 Mar 2012 01:16:34 +0000 Subject: [PATCH] windows: add icons to the status icon menu --- AUTHORS | 17 +- SparkleShare/Windows/SparkleShare.csproj | 6 + SparkleShare/Windows/SparkleStatusIcon.cs | 56 +- data/icons/folder-sparkleshare-windows-16.png | Bin 0 -> 729 bytes data/icons/folder-windows-16.png | Bin 0 -> 397 bytes data/src/sparkleshare-windows.svg | 1033 +++++++++++++++++ 6 files changed, 1084 insertions(+), 28 deletions(-) create mode 100644 data/icons/folder-sparkleshare-windows-16.png create mode 100644 data/icons/folder-windows-16.png create mode 100644 data/src/sparkleshare-windows.svg diff --git a/AUTHORS b/AUTHORS index 22723e31..3c6c8496 100755 --- a/AUTHORS +++ b/AUTHORS @@ -10,22 +10,18 @@ Points of contact: Łukasz Jernaś -Contributors: +Code: Alejandro Serrano Alexandre Saiz Verdaguer Alex Hudson - Allan Day - Andreas Nilsson Benjamin Podszun Bertrand Lorentz Gabriel Burt Garrett LeSage Hylke Bons - Jakub Steiner Kristi Tsukida Konstantinos Vaggelakos - Lapo Calamandrei Lars Falk-Petersen Luis Cordova Łukasz Jernaś @@ -43,6 +39,15 @@ Contributors: Travis Glenn Hansen Vincent Untz Will Thompson + + +Artwork: - Thanks very much! + Andreas Nilsson + Jakub Steiner + Hylke Bons + Lapo Calamandrei + Yusuke Kamiyamane + +Thanks very much! diff --git a/SparkleShare/Windows/SparkleShare.csproj b/SparkleShare/Windows/SparkleShare.csproj index 6a4bfd48..0f84b535 100644 --- a/SparkleShare/Windows/SparkleShare.csproj +++ b/SparkleShare/Windows/SparkleShare.csproj @@ -245,6 +245,12 @@ Pixmaps\tutorial-slide-2-windows.png + + Pixmaps\folder-sparkleshare-windows-16.png + + + Pixmaps\folder-windows-16.png + diff --git a/SparkleShare/Windows/SparkleStatusIcon.cs b/SparkleShare/Windows/SparkleStatusIcon.cs index 32fe8e22..ad267b81 100644 --- a/SparkleShare/Windows/SparkleStatusIcon.cs +++ b/SparkleShare/Windows/SparkleStatusIcon.cs @@ -35,7 +35,7 @@ namespace SparkleShare { private int FrameNumber; private string StateText; private ContextMenu context_menu; - private MenuItem exit_item; + private SparkleMenuItem exit_item; private Forms.NotifyIcon notify_icon = new Forms.NotifyIcon () { Text = "SparkleShare", @@ -147,28 +147,26 @@ namespace SparkleShare { { this.context_menu = new ContextMenu (); - MenuItem status_item = new MenuItem () { + SparkleMenuItem status_item = new SparkleMenuItem () { Header = StateText, IsEnabled = false }; System.Windows.Controls.Image i = new System.Windows.Controls.Image(); - i.Source = - System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap( - Icons.folder_sparkleshare_16.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty, - System.Windows.Media.Imaging.BitmapSizeOptions.FromWidthAndHeight(16, 16)); - + i.Source = SparkleUIHelpers.GetImageSource ("folder-sparkleshare-windows-16"); + i.Width = 16; + i.Height = 16; - MenuItem folder_item = new MenuItem () { - Header = "SparkleShare"//, - ,Icon = i + SparkleMenuItem folder_item = new SparkleMenuItem () { + Header = "SparkleShare", + Icon = i }; folder_item.Click += delegate { Controller.SparkleShareClicked (); }; - MenuItem add_item = new MenuItem () { + SparkleMenuItem add_item = new SparkleMenuItem () { Header = "Add Hosted Project…", IsEnabled = (!Program.Controller.FirstRun) }; @@ -177,7 +175,7 @@ namespace SparkleShare { Controller.AddHostedProjectClicked (); }; - MenuItem log_item = new MenuItem () { + SparkleMenuItem log_item = new SparkleMenuItem () { Header = "View Recent Changes…", IsEnabled = (Program.Controller.Folders.Count > 0) }; @@ -186,19 +184,19 @@ namespace SparkleShare { Controller.OpenRecentEventsClicked (); }; - MenuItem notify_item = new MenuItem (); + SparkleMenuItem notify_item = new SparkleMenuItem (); if (Program.Controller.NotificationsEnabled) - notify_item = new MenuItem () { Header = "Turn Notifications Off" }; + notify_item = new SparkleMenuItem () { Header = "Turn Notifications Off" }; else - notify_item = new MenuItem () { Header = "Turn Notifications On" }; + notify_item = new SparkleMenuItem () { Header = "Turn Notifications On" }; notify_item.Click += delegate { Program.Controller.ToggleNotifications (); CreateMenu (); }; - MenuItem about_item = new MenuItem () { + SparkleMenuItem about_item = new SparkleMenuItem () { Header = "About SparkleShare" }; @@ -206,7 +204,7 @@ namespace SparkleShare { Controller.AboutClicked (); }; - exit_item = new MenuItem () { + exit_item = new SparkleMenuItem () { Header = "Exit" }; @@ -222,24 +220,29 @@ namespace SparkleShare { if (Program.Controller.Folders.Count > 0) { foreach (string folder_name in Program.Controller.Folders) { - MenuItem subfolder_item = new MenuItem () { + SparkleMenuItem subfolder_item = new SparkleMenuItem () { Header = 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)) subfolder_item.Icon = Icons.dialog_error_16; else subfolder_item.Icon = Icons.sparkleshare_windows_status; */ + this.context_menu.Items.Add (subfolder_item); } } else { - MenuItem no_folders_item = new MenuItem () { + SparkleMenuItem no_folders_item = new SparkleMenuItem () { Header = "No projects yet", IsEnabled = false }; @@ -263,8 +266,8 @@ namespace SparkleShare { public void UpdateMenu () { - (this.context_menu.Items [0] as MenuItem).Header = StateText; - (this.context_menu.Items [0] as MenuItem).UpdateLayout (); + (this.context_menu.Items [0] as SparkleMenuItem).Header = StateText; + (this.context_menu.Items [0] as SparkleMenuItem).UpdateLayout (); } @@ -353,4 +356,13 @@ namespace SparkleShare { [DllImport("user32.dll", EntryPoint = "DestroyIcon")] static extern bool DestroyIcon (IntPtr hIcon); } + + + public class SparkleMenuItem : MenuItem { + + public SparkleMenuItem () : base () + { + Padding = new Thickness (6, 3, 4, 0); + } + } } diff --git a/data/icons/folder-sparkleshare-windows-16.png b/data/icons/folder-sparkleshare-windows-16.png new file mode 100644 index 0000000000000000000000000000000000000000..5a0e4e843565589b51a98595ed7004694401cef1 GIT binary patch literal 729 zcmV;~0w(>5P)xK~y-6rISlYRACgyf8YH+b*9W28>J|yMPx<>L4grLwF`O> zL9Hr?7Vca{`k~Ze`!lLsh=I|C;!43ebztTU%yzTZvrP z&Nfs82uOy^Rfu1Y%w=(WLQP%X7uxq7iImALdccm4;%6sl>0F&CHJ1Ygkwz_F1FD(Y z$m1Ckyo*o~+0?TI$G$vG^7$7;2GTFNTz4;-jmhFNe&#)56VOq?1n0n8u=NE1^;a(` z^gRHjC|@~1zGpYu6w%9yGy$$!CLVvHP4FI^1)Jcj73%NaBF>`M^pbsj0mh(98>rs9 zh%(JA+tiIN6lm()j!P0ua1QYnu?e%oPia4W1GBytBqO=g4^7P!P7VMH|LG}}n`bEQ z*$dthoFfX}LvY{{lnA6X!pC9a>&LKs!=)dH2M!ZHjUYA#rNAW+9Km~{1_vo(>$Gm^ zrZU)%`|*bS!3#*{$Rv){Ms={C*3BCcTL+&KoWlg~z&Wr9x=E4iXveJX!42Og zdi@drSGa}Vc7$9bvq!bvf|MBhNNSUFl)Dx{H)N@ z(e_7YOK`sNfuuFm+FcFzjaLcfFG%epe&{R!QtTp|n?V;>&F@KCBY1~;-dFlA!m7Vk z7xJViAfXw6JSm!t8hJ9Jzp+qEDG@;_RRUU;h}FL;6_IK6zj6Kz_@FlVOfK-*00000 LNkvXXu0mjf%3D6Y literal 0 HcmV?d00001 diff --git a/data/icons/folder-windows-16.png b/data/icons/folder-windows-16.png new file mode 100644 index 0000000000000000000000000000000000000000..59d697799b7228c8d7dafdfe1f91d173c63ed2a7 GIT binary patch literal 397 zcmV;80doF{P)TqMD)O#HiQtjru(2klG=W)g$|Yqg=p8$$_9qF#cv zl>_cS)q#}qhl83SE`p~aRt}66*}@^#Kq(E@>byXcpH!x@v=)f0)lcsjMffP{7Wu_Zvh4XMj*fmxzi)^00000NkvXXu0mjf{XwcK literal 0 HcmV?d00001 diff --git a/data/src/sparkleshare-windows.svg b/data/src/sparkleshare-windows.svg new file mode 100644 index 00000000..dfe89b3d --- /dev/null +++ b/data/src/sparkleshare-windows.svg @@ -0,0 +1,1033 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +