# HG changeset patch # User John W. Eaton # Date 1367834803 14400 # Node ID 2df11dd7a589d22d6a812246bf0883c8dcb24352 # Parent 818eef7b2618c99826f32944083ce988afba6137 draw border around color picker swatches * color-picker.cc (color_picker::update_button): Add 1px solid border with text color to the css for the button. diff -r 818eef7b2618 -r 2df11dd7a589 libgui/src/color-picker.cc --- a/libgui/src/color-picker.cc Mon May 06 06:00:44 2013 -0400 +++ b/libgui/src/color-picker.cc Mon May 06 06:06:43 2013 -0400 @@ -49,8 +49,17 @@ // draw the button with the actual color (using a stylesheet) void color_picker::update_button () { - QString css = QString("background-color: %1; border: none;" ) - .arg(_color.name()); + // Is this the right place to look for a "foreground" color that would + // provide a reasonable border for the color swatches? + QWidget *p = parentWidget (); + + QString bordercolor + = p ? p->palette().text().color().name() : QString ("#000000"); + + QString css = QString("background-color: %1; border: 1px solid %2;") + .arg(_color.name()) + .arg(bordercolor); + setStyleSheet(css); repaint (); }