SL-17570 Slightly better support for system's picker

master
Andrey Kleshchev 2022-06-29 23:56:01 +03:00
parent c2c22b9053
commit 23534c4f1c
1 changed files with 12 additions and 4 deletions

View File

@ -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 ] );
if (commit)
{
setOrigRgb(curCol[0], curCol[1], curCol[2]);
setCurRgb(curCol[0], curCol[1], curCol[2]);
LLColorSwatchCtrl::onColorChanged ( swatch, LLColorSwatchCtrl::COLOR_CHANGE );
LLColorSwatchCtrl::onColorChanged(swatch, LLColorSwatchCtrl::COLOR_SELECT);
}
else
{
LLColorSwatchCtrl::onColorChanged(swatch, LLColorSwatchCtrl::COLOR_CANCEL);
}
}
closeFloater();