After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 450715 - Also show icon when dragging icon from toolbar to editor
Also show icon when dragging icon from toolbar to editor
Status: RESOLVED FIXED
Product: libegg
Classification: Other
Component: toolbar
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Soren Sandmann Pedersen
Libegg maintenance
Depends on:
Blocks:
 
 
Reported: 2007-06-24 19:34 UTC by Jaap A. Haitsma
Modified: 2007-07-01 13:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which adds icon when dragging from toolbar to editor dialog (1.52 KB, patch)
2007-06-24 19:35 UTC, Jaap A. Haitsma
none Details | Review
Updated patch which uses icons of the same size as the toolbar for dragging (3.15 KB, patch)
2007-06-30 22:38 UTC, Jaap A. Haitsma
accepted-commit_now Details | Review
update-toolbareditor-from-libegg script (487 bytes, text/plain)
2007-06-30 22:41 UTC, Jaap A. Haitsma
  Details
Refactored patch (3.18 KB, patch)
2007-07-01 12:00 UTC, Jaap A. Haitsma
committed Details | Review

Description Jaap A. Haitsma 2007-06-24 19:34:13 UTC
Patch coming up
Comment 1 Jaap A. Haitsma 2007-06-24 19:35:34 UTC
Created attachment 90577 [details] [review]
Patch which adds icon when dragging from toolbar to editor dialog
Comment 2 Christian Persch 2007-06-24 19:47:33 UTC
Have you tested this in epiphany too?
Comment 3 Jaap A. Haitsma 2007-06-24 19:51:37 UTC
(In reply to comment #2)
> Have you tested this in epiphany too?
> 
No just in EOG. 

Is there a reason why it would not work in epiphany if it works in EOG???
Comment 4 Christian Persch 2007-06-24 19:55:17 UTC
Epiphany has some custom actions which aren't toolbuttons or separators, so I just wondered if it worked with them too.
Comment 5 Jaap A. Haitsma 2007-06-24 20:05:06 UTC
I guess they won't. If you look at the patch you see that I check if it's a seperator or a toolbutton. So unless you inherited it from one of these two you won't get a real icon.

I could change the patch so I don't check if it is a toolbutton. I'll just try to get the icon_name and stock_id from the object. If your custom actions set either of them the code will show an icon.

Comment 6 Jaap A. Haitsma 2007-06-30 22:38:09 UTC
Created attachment 90947 [details] [review]
Updated patch which uses icons of the same size as the toolbar for dragging

Furthermore this patch also works with some of the custom widgets in epiphany. It now works well with the "location entry" and the "related" widgets. It does not work with "Quick Bookmark" and "Quick Topic" because these seem to get tied to an action which does not have a stock_id or icon_name
Comment 7 Jaap A. Haitsma 2007-06-30 22:41:40 UTC
Created attachment 90948 [details]
update-toolbareditor-from-libegg script

I noticed that you always ask to apply the patch on epiphany and eog as well. I thought it would be handier if applications which use the egg toolbar would put the following script in their repository. They then just need to run the script to get the latest egg-toolbar. After that they just need to do a commit and put in the changelog "update to latest eggtoolbar"
Comment 8 Christian Persch 2007-07-01 09:46:33 UTC
The patch seems to mix spaces and tabs....

+              char *name;

|const|.

+              action = name ? find_action (etoolbar, name) : NULL;
+
+	      g_object_get (action,
+                            "icon-name", &icon_name,
+                            "stock-id", &stock_id,
+		            NULL);

You need to protect that g_object_get with |if (action)| since action can be NULL from the 1st line.

+                  if (G_UNLIKELY (!pixbuf))
+                    return;

That leaks |icon_name| and |stock_id|.

With those fixed, ok to commit. Thanks!
Comment 9 Jaap A. Haitsma 2007-07-01 09:56:41 UTC
Thanks for the review. Should I just use spaces?
Comment 10 Jaap A. Haitsma 2007-07-01 09:58:40 UTC
BTW do you also want me to sync epiphany with the latest changes.
And should I put the script I attached also in epiphany SVN?

Comment 11 Christian Persch 2007-07-01 11:10:59 UTC
(In reply to comment #9)
> Thanks for the review. Should I just use spaces?

Spaces is fine.

(In reply to comment #10)
> BTW do you also want me to sync epiphany with the latest changes.
> And should I put the script I attached also in epiphany SVN?

Yes, and yes.
Comment 12 Jaap A. Haitsma 2007-07-01 12:00:27 UTC
Created attachment 90966 [details] [review]
Refactored patch

Christian, can you review this refactored patch. It removes some code duplication and also adds the changes you requested.
Comment 13 Jaap A. Haitsma 2007-07-01 12:02:51 UTC
BTW maybe it's also handy if I add the update script to toolbar editor in libegg. This way developers of other modules can automatically pick up the script. What's your opinion about that?
Comment 14 Christian Persch 2007-07-01 12:17:27 UTC
Looks fine, thanks.

(In reply to comment #13)
> BTW maybe it's also handy if I add the update script to toolbar editor in
> libegg. This way developers of other modules can automatically pick up the
> script. What's your opinion about that?

Sure, that's ok.
Comment 15 Jaap A. Haitsma 2007-07-01 13:53:33 UTC
Commited to both libegg and epiphany. BTW I discovered a bug shortly afterwards *pixbuf has to be initialized to NULL. Otherwise it crashes in epiphany (I tested the updated patch on eog) because some of the custom widgets which don't have an icon_name or stock_id. 



Changelog epiphany

2007-07-01  Jaap Haitsma  <jaap@haitsma.org>

        * lib/egg/update-toolbareditor-from-libegg: script that syncs local
	toolbar editor copy with the one in libegg SVN
	* lib/egg/egg*: sync with toolbar editor in libegg. Sync obtained by 
	running update-toolbareditor-from-libegg
	* lib/egg/eggintl.h: removed not needed anymore by egg-toolbareditor
	* lib/egg/Makefile.am: remove eggintl.h

BTW should I remove update-from-egg.sh from epiphany svn. It's not needed anymore because now we have update-toolbareditor-from-libegg