[Geany-devel] plugin_add_toolbar_item()

Dimitar Zhekov dimitar.zhekov at xxxxx
Sun Apr 29 16:08:41 UTC 2012


Hi,

According to it's description, $subject "Inserts a toolbar item before
the Quit button, or after the previous plugin toolbar item. A separator
is added on the first call to this function [...]".

In reality, they are added like this: b c d e f | a Quit.

Looking at $subject source, it's obvious that the 2nd and subsequent
items are inserted before the separator created with the 1st item.

There are two ways to fix this:

Keep item counter, and insert the 2nd+ items at separator_position +
counter + 1; we must count the removals as well.

Always insert before Quit, which will reduce plugin_add_toolbar_item
by about 1/3.

Practically the two are identical, but the latter is much simpler. If
you agree to it, I'll write a patch.

Currently $subject is used by 4 plugins; they all add a single item.

-- 
E-gards: Jimmy



More information about the Devel mailing list