Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 303161 Details for
Bug 436726
no visible difference when number of updates changes
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
what i've merged into master
gpk-update-pulse.patch (text/plain), 5.11 KB, created by
Richard Hughes
on 2008-04-21 15:34:14 UTC
(
hide
)
Description:
what i've merged into master
Filename:
MIME Type:
Creator:
Richard Hughes
Created:
2008-04-21 15:34:14 UTC
Size:
5.11 KB
patch
obsolete
>commit e9f684a17d1dfad8119368d1648033f1e88417d3 >Author: Richard Hughes <richard@hughsie.com> >Date: Mon Apr 21 16:03:29 2008 +0100 > > pulse the icon when the update list changes to fix rh#436726 > >diff --git a/src/gpk-notify.c b/src/gpk-notify.c >index 0437353..8e851fe 100644 >--- a/src/gpk-notify.c >+++ b/src/gpk-notify.c >@@ -713,6 +713,7 @@ gpk_notify_query_updates_finished_cb (PkClient *client, PkExitEnum exit, guint r > /* work out icon */ > icon = gpk_notify_get_best_update_icon (notify, client); > gpk_smart_icon_set_icon_name (notify->priv->sicon, icon); >+ gpk_smart_icon_pulse (notify->priv->sicon); > > /* make tooltip */ > if (status_security->len != 0) { >diff --git a/src/gpk-smart-icon.c b/src/gpk-smart-icon.c >index 11f00d6..509a4d1 100644 >--- a/src/gpk-smart-icon.c >+++ b/src/gpk-smart-icon.c >@@ -62,7 +62,10 @@ struct GpkSmartIconPrivate > gchar *new; > gchar *notify_data; > guint event_source; >+ guint pulse_source; > gboolean has_gconf_check; >+ gfloat icon_opacity; >+ gboolean going_down; > }; > > enum { >@@ -101,6 +104,101 @@ gpk_smart_icon_class_init (GpkSmartIconClass *klass) > G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); > } > >+/** >+ * gpk_smart_icon_set_pixmap_opacity: >+ **/ >+static gboolean >+gpk_smart_icon_set_pixmap_opacity (GdkPixbuf *pixbuf, gfloat adjust) >+{ >+ gint width, height, rowstride, n_channels; >+ guchar *pixels, *p; >+ gint x, y; >+ >+ width = gdk_pixbuf_get_width (pixbuf); >+ height = gdk_pixbuf_get_height (pixbuf); >+ rowstride = gdk_pixbuf_get_rowstride (pixbuf); >+ n_channels = gdk_pixbuf_get_n_channels (pixbuf); >+ pixels = gdk_pixbuf_get_pixels (pixbuf); >+ >+ /* scale the opacity of each pixel */ >+ for (y=0; y<height-1;y++) { >+ for (x=0; x<height-1;x++) { >+ p = pixels + y * rowstride + x * n_channels; >+ p[3] = (gfloat) p[3] * adjust; >+ } >+ } >+ return TRUE; >+} >+ >+/** >+ * gpk_smart_icon_pulse_timeout_cb: >+ **/ >+static gboolean >+gpk_smart_icon_pulse_timeout_cb (gpointer data) >+{ >+ GpkSmartIcon *sicon = (GpkSmartIcon *) data; >+ GdkPixbuf *pixbuf; >+ GdkRectangle area; >+ >+ g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE); >+ >+ /* have we hidden the icon already? */ >+ if (sicon->priv->current == NULL || sicon->priv->new == NULL) { >+ pk_debug ("not pulsing as icon cleared"); >+ return FALSE; >+ } >+ >+ /* get pixmap the same size as the original icon */ >+ gtk_status_icon_get_geometry (GTK_STATUS_ICON (sicon->priv->status_icon), NULL, &area, NULL); >+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), sicon->priv->current, area.width, 0, NULL); >+ >+ /* set the new pixmap with the correct opacity */ >+ gpk_smart_icon_set_pixmap_opacity (pixbuf, sicon->priv->icon_opacity); >+ gtk_status_icon_set_from_pixbuf (GTK_STATUS_ICON (sicon->priv->status_icon), pixbuf); >+ g_object_unref (pixbuf); >+ >+ /* dimming down */ >+ if (sicon->priv->going_down) { >+ sicon->priv->icon_opacity -= 0.1; >+ if (sicon->priv->icon_opacity<0) { >+ sicon->priv->icon_opacity = 0; >+ sicon->priv->going_down = FALSE; >+ } >+ return TRUE; >+ } >+ >+ /* dimming up */ >+ sicon->priv->icon_opacity += 0.1; >+ if (sicon->priv->icon_opacity>1) { >+ /* restore */ >+ gtk_status_icon_set_from_icon_name (GTK_STATUS_ICON (sicon->priv->status_icon), sicon->priv->current); >+ sicon->priv->pulse_source = 0; >+ return FALSE; >+ } >+ return TRUE; >+} >+ >+/** >+ * gpk_smart_icon_pulse: >+ **/ >+gboolean >+gpk_smart_icon_pulse (GpkSmartIcon *sicon) >+{ >+ g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE); >+ >+ sicon->priv->icon_opacity = 0.9; >+ sicon->priv->going_down = TRUE; >+ if (sicon->priv->pulse_source != 0) { >+ pk_warning ("already pulsing"); >+ return FALSE; >+ } >+ sicon->priv->pulse_source = g_timeout_add (20, gpk_smart_icon_pulse_timeout_cb, sicon); >+ return TRUE; >+} >+ >+/** >+ * gpk_smart_icon_set_icon_name_cb: >+ **/ > static gboolean > gpk_smart_icon_set_icon_name_cb (gpointer data) > { >@@ -353,6 +451,7 @@ gpk_smart_icon_init (GpkSmartIcon *sicon) > sicon->priv->dialog = NULL; > sicon->priv->notify_data = NULL; > sicon->priv->event_source = 0; >+ sicon->priv->pulse_source = 0; > sicon->priv->has_gconf_check = FALSE; > sicon->priv->gconf_client = gconf_client_get_default (); > >@@ -376,6 +475,14 @@ gpk_smart_icon_finalize (GObject *object) > sicon = PK_SMART_ICON (object); > g_return_if_fail (sicon->priv != NULL); > >+ /* remove any timers that may be firing */ >+ if (sicon->priv->event_source != 0) { >+ g_source_remove (sicon->priv->event_source); >+ } >+ if (sicon->priv->pulse_source != 0) { >+ g_source_remove (sicon->priv->pulse_source); >+ } >+ > g_free (sicon->priv->new); > g_free (sicon->priv->current); > g_object_unref (sicon->priv->gconf_client); >diff --git a/src/gpk-smart-icon.h b/src/gpk-smart-icon.h >index 6939355..683bc2d 100644 >--- a/src/gpk-smart-icon.h >+++ b/src/gpk-smart-icon.h >@@ -76,6 +76,7 @@ GType gpk_smart_icon_get_type (void) G_GNUC_CONST; > GpkSmartIcon *gpk_smart_icon_new (void); > GtkStatusIcon *gpk_smart_icon_get_status_icon (GpkSmartIcon *sicon); > gboolean gpk_smart_icon_sync (GpkSmartIcon *sicon); >+gboolean gpk_smart_icon_pulse (GpkSmartIcon *sicon); > gboolean gpk_smart_icon_set_icon_name (GpkSmartIcon *sicon, > const gchar *icon_name); > gboolean gpk_smart_icon_set_tooltip (GpkSmartIcon *sicon,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 436726
:
303149
| 303161