Color Picker - missing buttons?

I just downloaded version 1.1.0 of the ColorPicker and added it to my project, Compiled the widgetset, and when I bring up my window, I see the small button with the Color (black) listed. If I click the button, the RGB/HSV window opens, but the OK and Cancel buttons at the bottom of the window are cut off and I can’t seem to resize the window. So I can select various colors, but I don’t seem to be able to actually select one. Can someone tell me what I’m doing wrong?

My code is very simple:

ColorPicker cp = new ColorPicker();
vlWorkspace.addComponent(cp);

Nothing fancy - what am I missing? I’ll keep looking and post something if I figure it out…

thanks,

nbc

I haven’t used ColorPicker myself, but that sounds like a layout problem. It might help if you gave your ColorPicker a fixed size yourself, so it doesn’t try to fit into a smaller space than it actually can. Adding ?debug to your url and checking what the Analyze Layouts part says might also help, if there are any problems in your outer layout and they are somehow leaking to the ColorPicker component.

I tried setting the height of the ColorPicker, but that seems to only affect the first button that is shown on the screen. Clicking the button brings up the ColorPicker Popup window, and that seems to have a fixed height and I’m not sure how to change that…

nbc

I suspect that this is a theme issue - the ColorPicker has probably been tuned for reindeer and your theme might cause the layout to be off a little.

Color pickers in many applications are not resizable to allow better tuning of the layout for the basic case, and because there would not be much benefit from resizing in most cases.

Hi Henry - you are exactly right - I had my theme base set to ‘runo’. Changed it to reindeer and now I can see the Colorpicker buttons. However, the rest of my theme looks a bit off… So I can either switch to reindeer and rework my system, or figure out how to rebuild the color picker for runo…

Is there a way to recompile addons like colorpicker? I can see some (all?) the source code in the jar file, but I don’t see any way to rebuild it and change the theme… Or do I just need to stick to the reindeer theme?

thanks,

nbc

It looks like ColorPicker does not have any custom theme, but most of its component sizes are set explicitly in code. The sources are in the JAR and this is probably just a question of updating the sizes in ColorPickerPopup (or ColorPickerSelect).

To limit maintenance overhead, you could copy the class ColorPickerPopup to the package com.vaadin.addon.colorpicker in your project and edit it there - otherwise you will also have to copy and modify some other code. Your copy should be on the classpath before the (unmodified) JAR, so it will automatically “override” the default version.

I changed the buttonsHeight value from 30 to 100 in ColorPickerPopup.java and now the buttons are visible using the runo theme.

Thanks very much for the help,

nbc