# HG changeset patch # User Santeri Piippo # Date 1387808984 -7200 # Node ID 108d7d21e1555d20c3a58c058544638be16b1258 # Parent d3cf7a23bb59757f42cf7463f1911e07c9b126e1 - added a configurable select color diff -r d3cf7a23bb59 -r 108d7d21e155 changelog.txt --- a/changelog.txt Mon Dec 23 16:16:45 2013 +0200 +++ b/changelog.txt Mon Dec 23 16:29:44 2013 +0200 @@ -44,6 +44,8 @@ - When adding edges with Intersector (which is done with Isecalc), the user is prompted for Isecalc's path now as well if necessary instead of just ignoring it and not adding the edgelines. - Added a configuration option for line anti-aliasing. +- Added a configurable selected color to blend to objects when they are selected, instead of a simple + light-up. Defaults to a blue color. - BFC red/green view and black edges no longer default to true. - When the background is dark, the "black edges" option actually means "white edges" now. - If the vertex snapper finds a vertex closer than 4 pixels, it likely is the vertex being looked for diff -r d3cf7a23bb59 -r 108d7d21e155 src/configDialog.cc --- a/src/configDialog.cc Mon Dec 23 16:16:45 2013 +0200 +++ b/src/configDialog.cc Mon Dec 23 16:29:44 2013 +0200 @@ -59,6 +59,7 @@ extern_cfg (String, ld_defaultname); extern_cfg (String, ld_defaultuser); extern_cfg (Int, ld_defaultlicense); +extern_cfg (String, gl_selectcolor); extern_cfg (String, prog_ytruder); extern_cfg (String, prog_rectifier); extern_cfg (String, prog_intersector); @@ -97,6 +98,10 @@ connect (ui->mainColorButton, SIGNAL (clicked()), this, SLOT (slot_setGLForeground())); + setButtonBackground (ui->selColorButton, gl_selectcolor); + connect (ui->selColorButton, SIGNAL (clicked()), + this, SLOT (slot_setGLSelectColor())); + ui->mainColorAlpha->setValue (gl_maincolor_alpha * 10.0f); ui->lineThickness->setValue (gl_linethickness); ui->colorizeObjects->setChecked (lv_colorize); @@ -532,6 +537,12 @@ } // ============================================================================= +// ----------------------------------------------------------------------------- +void ConfigDialog::slot_setGLSelectColor() +{ pickColor (gl_selectcolor, ui->selColorButton); +} + +// ============================================================================= // Sets background color of a given button. // ----------------------------------------------------------------------------- void ConfigDialog::setButtonBackground (QPushButton* button, str value) diff -r d3cf7a23bb59 -r 108d7d21e155 src/configDialog.h --- a/src/configDialog.h Mon Dec 23 16:16:45 2013 +0200 +++ b/src/configDialog.h Mon Dec 23 16:29:44 2013 +0200 @@ -80,6 +80,7 @@ private slots: void slot_setGLBackground(); void slot_setGLForeground(); + void slot_setGLSelectColor(); void slot_setShortcut(); void slot_resetShortcut(); void slot_clearShortcut(); diff -r d3cf7a23bb59 -r 108d7d21e155 src/gldraw.cc --- a/src/gldraw.cc Mon Dec 23 16:16:45 2013 +0200 +++ b/src/gldraw.cc Mon Dec 23 16:29:44 2013 +0200 @@ -59,6 +59,7 @@ cfg (String, gl_bgcolor, "#FFFFFF") cfg (String, gl_maincolor, "#A0A0A0") cfg (Float, gl_maincolor_alpha, 1.0) +cfg (String, gl_selectcolor, "#0080FF") cfg (Int, gl_linethickness, 2) cfg (Bool, gl_colorbfc, false) cfg (Int, gl_camera, GLRenderer::EFreeCamera) @@ -336,18 +337,17 @@ } } - long r = qcol.red(), + int r = qcol.red(), g = qcol.green(), b = qcol.blue(), a = qcol.alpha(); if (obj->topLevelParent()->isSelected()) { // Brighten it up for the select list. - const uchar add = 51; - - r = min (r + add, 255l); - g = min (g + add, 255l); - b = min (b + add, 255l); + QColor selcolor (gl_selectcolor); + r = (r + selcolor.red()) / 2; + g = (g + selcolor.green()) / 2; + b = (b + selcolor.blue()) / 2; } glColor4f ( diff -r d3cf7a23bb59 -r 108d7d21e155 ui/config.ui --- a/ui/config.ui Mon Dec 23 16:16:45 2013 +0200 +++ b/ui/config.ui Mon Dec 23 16:29:44 2013 +0200 @@ -7,7 +7,7 @@ 0 0 717 - 328 + 359 @@ -146,6 +146,27 @@ + + + Selected Color + + + + + + + This color is used for the main color. + + + + + + + :/icons/colorselect.png:/icons/colorselect.png + + + + @@ -155,7 +176,7 @@ - + This is the background color for the viewport.