google-code-export / gpick

Automatically exported from code.google.com/p/gpick
2 stars 0 forks source link

Indicate number of (selected, total) entries #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Certain uses of palettes require an exact color count (16 color 'sub-palettes', 
256-color 'master palettes'). To that end, it would be useful to indicate how 
many colors are selected, whenever a multiple selection is active; and also to 
indicate the new total color count whenever colors are added or removed from 
the palette.

I've begun investigating implementing this. IMO uiListPalette is the proper 
place to implement it, but it doesn't currently have access to the statusbar.

Original issue reported on code.google.com by 00a...@gmail.com on 10 Dec 2012 at 3:24

GoogleCodeExporter commented 9 years ago
Attached is a very basic implementation.
It informs you of the indices of the current selection (if there is one) and 
the total number of colors in the palette.
For now, it only activates when you drop color(s) on the PaletteList.

Current issues:

* I haven't figured out how I can print a '#'. sending it to a stringstream 
just makes it disappear.
* messy code.
* 'stats' command in file menu; i intend to get rid of it but for now it's 
useful.

Original comment by 00a...@gmail.com on 12 Dec 2012 at 2:37

Attachments:

GoogleCodeExporter commented 9 years ago
The first point above is wrong. `s.str("#");` doesn't work, but `s.str("");s << 
"#";` does.

Updated patch attached; it gives updates in most cases when it should. However 
I haven't figured out how to get it to update after adding a set of colors (eg. 
from 'blend colors' panel or 'mix colors' dialog), nor does it update when 
moving through the palette using the cursor keys.

Original comment by 00a...@gmail.com on 12 Dec 2012 at 3:25

Attachments:

GoogleCodeExporter commented 9 years ago
.. or when a color is added via the colorpicker

Original comment by 00a...@gmail.com on 12 Dec 2012 at 4:25

GoogleCodeExporter commented 9 years ago
I suggest using a separate widget in a status bar for this additional 
information, because status bar messages are context sensitive, and thus, only 
visible when palette widget is focused (changed in attached patch).

Palette widget needs 'cursor-changed' event handler to catch selection changes.

Original comment by thezbyg on 13 Dec 2012 at 5:06

Attachments:

GoogleCodeExporter commented 9 years ago
Fantastic! That is exactly the style I originally intended to implement this 
in. It turns out to work quite well, better than I thought before.

Note that while debugging this, I encountered a crash while dragging multiple 
colors to the end of the palette. However once I tried to reproduce it, I 
couldn't -- whether compiled with or without debugging symbols, with or without 
the changes I'm proposing in this issue, running under GDB or not. I'm 
considering it as a possible compiler or GTK+ bug for now.

The attached patch fixes all known outstanding issues. Totals are updated in 
all relevant circumstances. Unless there are any other issues you wish to 
raise, I'll commit it sometime in the next 3 days.

Original comment by 00a...@gmail.com on 13 Dec 2012 at 7:05

Attachments:

GoogleCodeExporter commented 9 years ago
Committed in commit bc15d3666491756b16d51075504423aace9ae9b1 .
Closing.

Original comment by 00a...@gmail.com on 17 Dec 2012 at 6:09