diff --git a/SparkleShare/Mac/SparkleShare/Main.cs b/SparkleShare/Mac/SparkleShare/Main.cs index c97dd14c..2a7fb72f 100644 --- a/SparkleShare/Mac/SparkleShare/Main.cs +++ b/SparkleShare/Mac/SparkleShare/Main.cs @@ -35,6 +35,8 @@ namespace SparkleShare NSMenuItem NotificationsMenuItem; NSMenuItem AboutMenuItem; NSMenuItem QuitMenuItem; + + SparkleLog Log; NSWindow window; @@ -77,10 +79,10 @@ tile.Display (); StatusItem = NSStatusBar.SystemStatusBar.CreateStatusItem (28); StatusItem.Enabled = true; - StatusItem.Image = NSImage.ImageNamed ("sparkleshare-idle.png"); - StatusItem.AlternateImage = NSImage.ImageNamed ("sparkleshare-idle-focus.png"); - StatusItem.Image.Size = new SizeF (13, 13); - StatusItem.AlternateImage.Size = new SizeF (13, 13); + StatusItem.Image = NSImage.ImageNamed ("idle.png"); + StatusItem.AlternateImage = NSImage.ImageNamed ("idle-active.png"); + StatusItem.Image.Size = new SizeF (16 , 16); + StatusItem.AlternateImage.Size = new SizeF (16, 16); StatusItem.HighlightMode = true; Menu = new NSMenu (); @@ -91,7 +93,7 @@ tile.Display (); Timer timer = new Timer () { - Interval = 500 + Interval = 60 }; @@ -104,13 +106,19 @@ tile.Display (); timer.Elapsed += delegate { FolderMenuItem.InvokeOnMainThread (delegate { + + StatusItem.Image = NSImage.ImageNamed ("idle" + i + ".png"); + StatusItem.Image.Size = new SizeF (16 , 16); - if (i == 0){ - StatusItem.Image = NSImage.ImageNamed ("sparkleshare-idle-focus.png"); - i = 1; + StatusItem.AlternateImage = NSImage.ImageNamed ("idle" + i + ".png"); + StatusItem.AlternateImage.Size = new SizeF (16 , 16); + + if (i < 4){ + i++; }else{ - StatusItem.Image = NSImage.ImageNamed ("sparkleshare-idle.png"); - i = 0; + + // StatusItem.Image = NSImage.ImageNamed ("sparkleshare-idle.png"); + i = 0; } /*FolderMenuItem.Title+="Z";Menu.Update ();*/}); @@ -121,7 +129,7 @@ tile.Display (); Console.WriteLine ("DDDD"); }; - FolderMenuItem.Image = NSImage.ImageNamed ("NSFolder"); + FolderMenuItem.Image = NSImage.ImageNamed ("sparkleshare.icns"); FolderMenuItem.Image.Size = new SizeF (16, 16); Menu.AddItem (FolderMenuItem); @@ -133,73 +141,15 @@ tile.Display (); foreach (NSMenuItem item in FolderMenuItems) { - item.Activated += delegate { - - - - - button = new NSButton (new RectangleF (16, 12, 120, 31)) { - Title = "Open Folder", - BezelStyle = NSBezelStyle.Rounded - - }; - - button2 = new NSButton (new RectangleF (480 - 120 - 16, 12, 120, 31)) { - Title = "Close", - BezelStyle = NSBezelStyle.Rounded - - }; - - - bool minimizeBox = true; - bool maximizeBox = false; -NSWindowStyle style = (NSWindowStyle)(1 | (1 << 1) | (minimizeBox ? 4 : 1) | (maximizeBox ? 8 : 1)); - - -window = new NSWindow (new RectangleF (0, 0, 480, 640), - style, 0, false); - - - - - web_view = new WebView (new RectangleF (0, 12 + 31 + 16, 480, 640 - (12 + 31 + 16)), "", ""); - web_view.MainFrameUrl = "http://www.google.nl/"; - - - window.ContentView.AddSubview (button); - window.ContentView.AddSubview (button2); - window.ContentView.AddSubview (web_view); - - window.MaxSize = new SizeF (480, 640); - window.MinSize = new SizeF (480, 640); - - window.Title = "Recent Events in 'gnome-design'"; - - window.HasShadow = true; - //window.DefaultButtonCell = button2.Cell; - window.BackingType = NSBackingStore.Buffered; - - - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - - window.MakeKeyAndOrderFront (this); - window.Center (); - - - - - - }; + item.Image = NSImage.ImageNamed ("NSFolder"); + item.Image.Size = new SizeF (16, 16); Menu.AddItem (item); }; - - - - + Log = new SparkleLog ("bla"); Menu.AddItem (NSMenuItem.SeparatorItem); diff --git a/SparkleShare/Mac/SparkleShare/SparkleLog.cs b/SparkleShare/Mac/SparkleShare/SparkleLog.cs new file mode 100644 index 00000000..30ae9fde --- /dev/null +++ b/SparkleShare/Mac/SparkleShare/SparkleLog.cs @@ -0,0 +1,123 @@ +// SparkleShare, an instant update workflow to Git. +// Copyright (C) 2010 Hylke Bons +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using MonoMac.Foundation; +using MonoMac.AppKit; +using MonoMac.ObjCRuntime; +using MonoMac.WebKit; + +namespace SparkleShare { + + public class SparkleLog : NSWindow { + + public readonly string LocalPath; + + private WebView WebView; + private NSButton CloseButton; + private NSButton OpenFolderButton; + + + public SparkleLog (string path) : base () + { + + LocalPath = path; + + + bool minimizeBox = true; + bool maximizeBox = false; + + + SetFrame (new RectangleF (0, 0, 480, 640), true); + + StyleMask = (NSWindowStyle)(1 | (1 << 1) | (minimizeBox ? 4 : 1) | (maximizeBox ? 8 : 1)); + MaxSize = new SizeF (480, 640); + MinSize = new SizeF (480, 640); + HasShadow = true; + BackingType = NSBackingStore.Buffered; + + Center (); + + ContentView.AddSubview (CreateEventLog ()); + + OpenFolderButton = new NSButton (new RectangleF (16, 12, 120, 31)) { + Title = "Open Folder", + BezelStyle = NSBezelStyle.Rounded + }; + + OpenFolderButton.Activated += delegate { + // SparkleShare.Controller.OpenSparkleShareFolder (LocalPath); + }; + + ContentView.AddSubview (OpenFolderButton); + + + CloseButton = new NSButton (new RectangleF (480 - 120 - 16, 12, 120, 31)) { + Title = "Close", + BezelStyle = NSBezelStyle.Rounded + }; + + CloseButton.Activated += delegate { + Close (); + }; + + ContentView.AddSubview (CloseButton); + + + string name = System.IO.Path.GetFileName (LocalPath); + Title = String.Format ("Recent Events in ‘{0}’", name); + + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + MakeKeyAndOrderFront (this); + + } + + + new public void Close () + { + + InvokeOnMainThread (delegate { + base.Close (); + }); + + } + + + public void UpdateEventLog () + { + + } + + + private WebView CreateEventLog () + { + + RectangleF frame = new RectangleF (0, 12 + 31 + 16, 480, 640 - (12 + 31 + 16)); + + WebView = new WebView (frame, "", ""); + WebView.MainFrameUrl = "http://www.google.nl/"; + + return WebView; + + } + + } + +} diff --git a/SparkleShare/Mac/SparkleShare/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare/SparkleShare.csproj index 71fcd61c..f577a283 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare/SparkleShare.csproj @@ -51,6 +51,7 @@ MainMenu.xib + @@ -64,6 +65,13 @@ + + + + + + + diff --git a/SparkleShare/Mac/SparkleShare/idle-active.png b/SparkleShare/Mac/SparkleShare/idle-active.png new file mode 100644 index 00000000..ca826a08 Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle-active.png differ diff --git a/SparkleShare/Mac/SparkleShare/idle.png b/SparkleShare/Mac/SparkleShare/idle.png new file mode 100644 index 00000000..ebb7f00b Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle.png differ diff --git a/SparkleShare/Mac/SparkleShare/idle0.png b/SparkleShare/Mac/SparkleShare/idle0.png new file mode 100644 index 00000000..0070a165 Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle0.png differ diff --git a/SparkleShare/Mac/SparkleShare/idle1.png b/SparkleShare/Mac/SparkleShare/idle1.png new file mode 100644 index 00000000..863cc299 Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle1.png differ diff --git a/SparkleShare/Mac/SparkleShare/idle2.png b/SparkleShare/Mac/SparkleShare/idle2.png new file mode 100644 index 00000000..7b8cdcfc Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle2.png differ diff --git a/SparkleShare/Mac/SparkleShare/idle3.png b/SparkleShare/Mac/SparkleShare/idle3.png new file mode 100644 index 00000000..c4eaa098 Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle3.png differ diff --git a/SparkleShare/Mac/SparkleShare/idle4.png b/SparkleShare/Mac/SparkleShare/idle4.png new file mode 100644 index 00000000..a53e2261 Binary files /dev/null and b/SparkleShare/Mac/SparkleShare/idle4.png differ diff --git a/data/sparkleshare-gnome.svg b/data/sparkleshare-gnome.svg index 820af8c3..a7d050e3 100644 --- a/data/sparkleshare-gnome.svg +++ b/data/sparkleshare-gnome.svg @@ -16,7 +16,7 @@ inkscape:export-xdpi="90.000000" inkscape:export-ydpi="90.000000" inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:version="0.47 r22583" + inkscape:version="0.48.0 r9654" sodipodi:docname="sparkleshare-gnome.svg" sodipodi:version="0.32" style="display:inline;enable-background:new" @@ -30,9 +30,9 @@ guidetolerance="10000" height="300px" id="base" - inkscape:current-layer="layer18" - inkscape:cx="452.99246" - inkscape:cy="152.00765" + inkscape:current-layer="layer20" + inkscape:cx="363.28616" + inkscape:cy="119.67008" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:pageopacity="0.0" @@ -40,9 +40,9 @@ inkscape:showpageshadow="false" inkscape:snap-bbox="true" inkscape:snap-nodes="false" - inkscape:window-height="805" - inkscape:window-width="1332" - inkscape:window-x="412" + inkscape:window-height="778" + inkscape:window-width="1280" + inkscape:window-x="0" inkscape:window-y="0" inkscape:zoom="1" objecttolerance="10000" @@ -2561,6 +2561,46 @@ inkscape:label="small sizes" id="layer20" inkscape:groupmode="layer"> + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +