SL-9654 EEP Double click should apply instead of opening in settings picker

master
andreykproductengine 2018-09-17 20:29:45 +03:00
parent 8a65439c76
commit 53a93d3e73
3 changed files with 33 additions and 1 deletions

View File

@ -1332,7 +1332,7 @@ void LLFloaterEditExtDayCycle::doImportFromDisk()
void LLFloaterEditExtDayCycle::loadSettingFromFile(const std::vector<std::string>& filenames)
{
if (filenames.size() < 1) return;
if (filenames.size() < 1) return;
std::string filename = filenames[0];
LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL;
LLSettingsDay::ptr_t legacyday = LLEnvironment::createDayCycleFromLegacyPreset(filename);

View File

@ -302,6 +302,37 @@ void LLFloaterSettingsPicker::onButtonSelect()
closeFloater();
}
BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (mSettingAssetID.notNull()
&& mInventoryPanel)
{
LLUUID item_id = findItemID(mSettingAssetID, FALSE);
S32 inventory_x = x - mInventoryPanel->getRect().mLeft;
S32 inventory_y = y - mInventoryPanel->getRect().mBottom;
if (item_id.notNull()
&& mInventoryPanel->parentPointInView(inventory_x, inventory_y))
{
// make sure item (not folder) is selected
LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(item_id);
if (item_viewp && item_viewp->isSelected())
{
LLRect target_rect;
item_viewp->localRectToOtherView(item_viewp->getLocalRect(), &target_rect, this);
if (target_rect.pointInRect(x, y))
{
// Quick-apply
if (mCommitSignal)
(*mCommitSignal)(this, LLSD(mSettingAssetID));
closeFloater();
return TRUE;
}
}
}
}
return LLFloater::handleDoubleClick(x, y, mask);
}
//=========================================================================
void LLFloaterSettingsPicker::setActive(bool active)
{

View File

@ -96,6 +96,7 @@ private:
void onSelectionChange(const itemlist_t &items, bool user_action);
void onButtonCancel();
void onButtonSelect();
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
LLHandle<LLView> mOwnerHandle;