diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-29 23:56:01 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-29 23:58:55 +0300 |
commit | 23534c4f1c1dd3e4dbbcd5b5b3aa2bd44f5c6350 (patch) | |
tree | 98860fec90e7e6a85c49d8ba96307a8841781ebb /indra/newview | |
parent | c2c22b90535cca4aaacfd8ba539d5445de68af0e (diff) |
SL-17570 Slightly better support for system's picker
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatercolorpicker.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 1f0e8ee5fa..ba91277c79 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -184,15 +184,23 @@ void LLFloaterColorPicker::showUI () // code that will get switched in for default system color picker if ( swatch ) { + // Todo: this needs to be threaded for viewer not to timeout LLColor4 curCol = swatch->get (); send_agent_pause(); - getWindow()->dialogColorPicker( &curCol [ 0 ], &curCol [ 1 ], &curCol [ 2 ] ); + bool commit = getWindow()->dialogColorPicker( &curCol [ 0 ], &curCol [ 1 ], &curCol [ 2 ] ); send_agent_resume(); - setOrigRgb ( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] ); - setCurRgb( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] ); - - LLColorSwatchCtrl::onColorChanged ( swatch, LLColorSwatchCtrl::COLOR_CHANGE ); + if (commit) + { + setOrigRgb(curCol[0], curCol[1], curCol[2]); + setCurRgb(curCol[0], curCol[1], curCol[2]); + + LLColorSwatchCtrl::onColorChanged(swatch, LLColorSwatchCtrl::COLOR_SELECT); + } + else + { + LLColorSwatchCtrl::onColorChanged(swatch, LLColorSwatchCtrl::COLOR_CANCEL); + } } closeFloater(); |