From 9c8b7b72b05674531b388cc944f8c8943779d28c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 9 Oct 2013 12:58:14 +0200 Subject: [PATCH] eventlog: Remove spinner code and use GTK+3's native spinner --- SparkleShare/Linux/Makefile.am | 1 - SparkleShare/Linux/Pixmaps/icons/Makefile.am | 1 - .../Pixmaps/icons/process-working-22.png | Bin 4104 -> 0 bytes SparkleShare/Linux/SparkleEventLog.cs | 37 +++++---- SparkleShare/Linux/SparkleSpinner.cs | 76 ------------------ 5 files changed, 18 insertions(+), 97 deletions(-) delete mode 100755 SparkleShare/Linux/Pixmaps/icons/process-working-22.png delete mode 100755 SparkleShare/Linux/SparkleSpinner.cs diff --git a/SparkleShare/Linux/Makefile.am b/SparkleShare/Linux/Makefile.am index 5410ef99..a9a590bd 100644 --- a/SparkleShare/Linux/Makefile.am +++ b/SparkleShare/Linux/Makefile.am @@ -28,7 +28,6 @@ SOURCES = \ SparkleEventLog.cs \ SparkleSetup.cs \ SparkleSetupWindow.cs \ - SparkleSpinner.cs \ SparkleStatusIcon.cs \ SparkleUI.cs \ SparkleUIHelpers.cs diff --git a/SparkleShare/Linux/Pixmaps/icons/Makefile.am b/SparkleShare/Linux/Pixmaps/icons/Makefile.am index 175667c1..c6dd2af2 100755 --- a/SparkleShare/Linux/Pixmaps/icons/Makefile.am +++ b/SparkleShare/Linux/Pixmaps/icons/Makefile.am @@ -23,7 +23,6 @@ system_theme_icons = \ status,process-syncing-error-48.png app_theme_icons = \ - animations,process-working-22.png \ status,document-added-12.png \ status,document-edited-12.png \ status,document-deleted-12.png \ diff --git a/SparkleShare/Linux/Pixmaps/icons/process-working-22.png b/SparkleShare/Linux/Pixmaps/icons/process-working-22.png deleted file mode 100755 index 1b90a0348038b0a555188427967800a5e481ec31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4104 zcmeH~`8yMUAICA3W6^;eNs@Dvn1$R6nQPf$B1E)VBe|zYL_+1*Xo$&No3o)XDn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> zbWfasP@4$t5CIXpn%y$Raja`OiSFnum)_p}p}X(O$_BXSZJ73*^@7f(2BFtBEW94? zY@|9j%6sn9@}952_jup`6%lW6dY^gtdDoN z?1_Xa0ak=Q(Ld5M#eFCuVl>Lv&U@+4G>orGKXrJZ*jL%?2p3JMZ_?asi2s>O@n*r-Do3eHDbP8H^%cRj>RB%DxR;tg>)N;1} zO7jyVfK2g#Rv=YCXV#0PttXXs4!oy+9vUlNqyy%J6wbA*QUJH;>7j4hhK zgUMs@IMo)TpuTn-I-6)>5FXw_>R*F|H17?Ghh?P?Hv8@rt*bcn4ska;)~b=wnIo8_Qfb!|4THz#%7K^-ZzAnjt(&LDjr0*VX3IhY=VS_$J=TC zc1REFUlDu_3zr%8W+YH?(8c8K!3`04sJ*$~fBEFP7Scu@e*;9UK(t1yf{dZVvy(^1SxOlEdbr;U8mRrY;sF2r_+Dw;FCEnXD}OmRY@Kr z_+&0&(6S}ZRU=Wtt+(V6v@_jtEHh~e-WN7M+h|Rj$|i`kI9?2`%~uUaLNb(?RF zcuhhiS;U)rjgiM!PGHmCkvi!<-Pua128Jpz{jGG|OwH~s6v<{X_?JfH-)aqMr5P{w zn?Pz@*921pjQJ6xPBgcy^!0v!*SyuHOt=B#Q5Spn-u-RsE=7&TV^0l=oK(;rz+29l z%B3JaY46n2Bw4<@nmL6}`6z94GEAPewmnhx&DhO>UJxJ@T;nOOecKSTP*XF&@G0HZ i`56mUwG12EQ4lfJ#omn^z5Cx^&c@Q=Vugk0{r>=Vwt+|h diff --git a/SparkleShare/Linux/SparkleEventLog.cs b/SparkleShare/Linux/SparkleEventLog.cs index b72363da..a731e013 100755 --- a/SparkleShare/Linux/SparkleEventLog.cs +++ b/SparkleShare/Linux/SparkleEventLog.cs @@ -39,7 +39,8 @@ namespace SparkleShare { private EventBox content_wrapper; private ScrolledWindow scrolled_window; // private WebView web_view; - private SparkleSpinner spinner; + private VBox spinner_wrapper; + private Spinner spinner; public SparkleEventLog () : base ("") @@ -86,27 +87,29 @@ namespace SparkleShare { layout_sizes.Add (this.history_label); VBox layout_vertical = new VBox (false, 0); - this.spinner = new SparkleSpinner (22); + this.spinner = new Spinner (); + this.spinner_wrapper = new VBox (); this.content_wrapper = new EventBox (); this.scrolled_window = new ScrolledWindow (); this.content_wrapper.OverrideBackgroundColor (StateFlags.Normal, new Gdk.RGBA () { Red = 1, Green = 1, Blue=1, Alpha = 1 }); -/* - this.web_view = new WebView () { - Editable = false - }; +// this.web_view = new WebView () { Editable = false }; +// this.web_view.NavigationRequested += WebViewNavigationRequested; - - this.web_view.NavigationRequested += WebViewNavigationRequested; -*/ -// this.scrolled_window.Add (this.web_view); +// this.scrolled_window.Add (this.web_view); this.scrolled_window.AddWithViewport (new Button ("WebView")); - this.content_wrapper.Add (this.spinner); - + + this.spinner_wrapper = new VBox (false, 0); + this.spinner_wrapper.PackStart (new Label(""), true, true, 0); + this.spinner_wrapper.PackStart (this.spinner, false, false, 0); + this.spinner_wrapper.PackStart (new Label(""), true, true, 0); + this.spinner.SetSizeRequest (24, 24); this.spinner.Start (); + this.content_wrapper.Add (this.spinner_wrapper); + this.layout_horizontal = new HBox (true, 0); this.layout_horizontal.PackStart (layout_sizes, true, true, 12); @@ -157,15 +160,11 @@ namespace SparkleShare { }; Controller.UpdateChooserEnablementEvent += delegate (bool enabled) { - Application.Invoke (delegate { - this.combo_box.Sensitive = enabled; - }); + Application.Invoke (delegate { this.combo_box.Sensitive = enabled; }); }; Controller.UpdateContentEvent += delegate (string html) { - Application.Invoke (delegate { - UpdateContent (html); - }); + Application.Invoke (delegate { UpdateContent (html); }); }; Controller.ContentLoadingEvent += delegate { @@ -173,7 +172,7 @@ namespace SparkleShare { if (this.content_wrapper.Child != null) this.content_wrapper.Remove (this.content_wrapper.Child); - this.content_wrapper.Add (this.spinner); + this.content_wrapper.Add (this.spinner_wrapper); this.spinner.Start (); this.content_wrapper.ShowAll (); }); diff --git a/SparkleShare/Linux/SparkleSpinner.cs b/SparkleShare/Linux/SparkleSpinner.cs deleted file mode 100755 index 84ab3b10..00000000 --- a/SparkleShare/Linux/SparkleSpinner.cs +++ /dev/null @@ -1,76 +0,0 @@ -// SparkleShare, a collaboration and sharing tool. -// 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.Timers; -using Gtk; - -namespace SparkleShare { - - // This is a close implementation of GtkSpinner - public class SparkleSpinner : Image { - - private Timer timer; - - - public SparkleSpinner (int size) : base () - { - int current_frame = 0; - Gdk.Pixbuf spinner_gallery = SparkleUIHelpers.GetIcon ("process-working", size); - int frames_in_width = spinner_gallery.Width / size; - int frames_in_height = spinner_gallery.Height / size; - int frame_count = (frames_in_width * frames_in_height) - 1; - Gdk.Pixbuf [] frames = new Gdk.Pixbuf [frame_count]; - - int i = 0; - for (int y = 0; y < frames_in_height; y++) { - for (int x = 0; x < frames_in_width; x++) { - if (!(y == 0 && x == 0)) { - frames [i] = new Gdk.Pixbuf (spinner_gallery, x * size, y * size, size, size); - i++; - } - } - } - - timer = new Timer () { - Interval = 600 / frame_count - }; - - timer.Elapsed += delegate { - if (current_frame < frame_count - 1) - current_frame++; - else - current_frame = 0; - - Application.Invoke (delegate { - Pixbuf = frames [current_frame]; - }); - }; - } - - - public void Start () - { - timer.Start (); - } - - - public void Stop () - { - timer.Stop (); - } - } -}