Skip to content

Commit b903c79

Browse files
committed
astgui: make sure colour is matched correctly
1 parent b1e99fd commit b903c79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

astgui/src/main/uk/ac/starlink/ast/gui/ComponentColourControls.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public void setColourStore( ColourStore colourStore )
148148
{
149149
this.colourStore = colourStore;
150150
colourStore.addChangeListener( this );
151+
matchColour();
151152
}
152153

153154
/**
@@ -190,11 +191,10 @@ public String getDescription()
190191
*/
191192
protected void chooseColour()
192193
{
193-
Color[] newColour = new Color[1];
194-
newColour[0] = JColorChooser.showDialog( this, "Select Colour",
195-
colourIcon.getMainColour() );
194+
Color newColour = JColorChooser.showDialog( this, "Select Colour",
195+
colourStore.getColour() );
196196
if ( newColour != null ) {
197-
colourStore.setColor( newColour[0] );
197+
colourStore.setColor( newColour );
198198
}
199199
}
200200

0 commit comments

Comments
 (0)