diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 977de9c7b4372320069a8a9806e835439428a4eb..975c1a8daa950b078be9722e5ec2d803e871dd7e 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -141,8 +141,12 @@ BOOL LLPanelObject::postBuild() childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); // Position - mMenuClipboardPos = getChild<LLMenuButton>("clipboard_pos_btn"); mLabelPosition = getChild<LLTextBox>("label position"); + mBtnCopyPosition = findChild<LLButton>("copy_position_btn"); + mBtnCopyPosition->setCommitCallback([this](LLUICtrl*, const LLSD&) { onCopyPos(); }); + mBtnPastePosition = findChild<LLButton>("paste_position_btn"); + mBtnPastePosition->setCommitCallback([this](LLUICtrl*, const LLSD&) { onPastePos(); }); + mCtrlPosX = getChild<LLSpinCtrl>("Pos X"); childSetCommitCallback("Pos X",onCommitPosition,this); mCtrlPosY = getChild<LLSpinCtrl>("Pos Y"); @@ -151,8 +155,12 @@ BOOL LLPanelObject::postBuild() childSetCommitCallback("Pos Z",onCommitPosition,this); // Scale - mMenuClipboardSize = getChild<LLMenuButton>("clipboard_size_btn"); mLabelSize = getChild<LLTextBox>("label size"); + mBtnCopySize = findChild<LLButton>("copy_size_btn"); + mBtnCopySize->setCommitCallback([this](LLUICtrl*, const LLSD&) { onCopySize(); }); + mBtnPasteSize = findChild<LLButton>("paste_size_btn"); + mBtnPasteSize->setCommitCallback([this](LLUICtrl*, const LLSD&) { onPasteSize(); }); + mCtrlScaleX = getChild<LLSpinCtrl>("Scale X"); childSetCommitCallback("Scale X",onCommitScale,this); @@ -165,8 +173,12 @@ BOOL LLPanelObject::postBuild() childSetCommitCallback("Scale Z",onCommitScale,this); // Rotation - mMenuClipboardRot = getChild<LLMenuButton>("clipboard_rot_btn"); mLabelRotation = getChild<LLTextBox>("label rotation"); + mBtnCopyRotation = findChild<LLButton>("copy_rotation_btn"); + mBtnCopyRotation->setCommitCallback([this](LLUICtrl*, const LLSD&) { onCopyRot(); }); + mBtnPasteRotation = findChild<LLButton>("paste_rotation_btn"); + mBtnPasteRotation->setCommitCallback([this](LLUICtrl*, const LLSD&) { onPasteRot(); }); + mCtrlRotX = getChild<LLSpinCtrl>("Rot X"); childSetCommitCallback("Rot X",onCommitRotation,this); mCtrlRotY = getChild<LLSpinCtrl>("Rot Y"); @@ -177,11 +189,14 @@ BOOL LLPanelObject::postBuild() //-------------------------------------------------------- // Base Type + mBtnCopyPrimParams = findChild<LLButton>("copy_primparams_btn"); + mBtnCopyPrimParams->setCommitCallback([this](LLUICtrl*, const LLSD&) { onCopyParams(); }); + mBtnPastePrimParams = findChild<LLButton>("paste_primparams_btn"); + mBtnPastePrimParams->setCommitCallback([this](LLUICtrl*, const LLSD&) { onPasteParams(); }); + mComboBaseType = getChild<LLComboBox>("comboBaseType"); childSetCommitCallback("comboBaseType",onCommitParametric,this); - mMenuClipboardParams = getChild<LLMenuButton>("clipboard_obj_params_btn"); - // Cut mLabelCut = getChild<LLTextBox>("text cut"); mSpinCutBegin = getChild<LLSpinCtrl>("cut begin"); @@ -459,8 +474,9 @@ void LLPanelObject::getState( ) calcp->clearVar(LLCalc::Z_POS); } - mMenuClipboardPos->setEnabled(enable_move); mLabelPosition->setEnabled( enable_move ); + mBtnCopyPosition->setEnabled(enable_move); + mBtnPastePosition->setEnabled(enable_move && mHasClipboardPos); mCtrlPosX->setEnabled(enable_move); mCtrlPosY->setEnabled(enable_move); mCtrlPosZ->setEnabled(enable_move); @@ -485,8 +501,9 @@ void LLPanelObject::getState( ) calcp->setVar(LLCalc::Z_SCALE, 0.f); } - mMenuClipboardSize->setEnabled(enable_scale); mLabelSize->setEnabled( enable_scale ); + mBtnCopySize->setEnabled(enable_scale); + mBtnPasteSize->setEnabled(enable_scale && mHasClipboardSize); mCtrlScaleX->setEnabled( enable_scale ); mCtrlScaleY->setEnabled( enable_scale ); mCtrlScaleZ->setEnabled( enable_scale ); @@ -517,8 +534,9 @@ void LLPanelObject::getState( ) calcp->clearVar(LLCalc::Z_ROT); } - mMenuClipboardRot->setEnabled(enable_rotate); mLabelRotation->setEnabled( enable_rotate ); + mBtnCopyRotation->setEnabled(enable_rotate); + mBtnPasteRotation->setEnabled(enable_rotate && mHasClipboardRot); mCtrlRotX->setEnabled( enable_rotate ); mCtrlRotY->setEnabled( enable_rotate ); mCtrlRotZ->setEnabled( enable_rotate ); @@ -1096,8 +1114,10 @@ void LLPanelObject::getState( ) } // Update field enablement + mBtnCopyPrimParams->setEnabled(enabled); + mBtnPastePrimParams->setEnabled(enabled && mClipboardParams.isMap() && (mClipboardParams.size() != 0)); + mComboBaseType ->setEnabled( enabled ); - mMenuClipboardParams->setEnabled(enabled); mLabelCut ->setEnabled( enabled ); mSpinCutBegin ->setEnabled( enabled ); @@ -1254,7 +1274,8 @@ void LLPanelObject::getState( ) } mComboBaseType->setEnabled(!isMesh); - mMenuClipboardParams->setEnabled(!isMesh); + mBtnCopyPrimParams->setEnabled(!isMesh); + mBtnPastePrimParams->setEnabled(!isMesh); if (mCtrlSculptType) { @@ -2156,6 +2177,14 @@ void LLPanelObject::clearCtrls() mLabelRadiusOffset->setEnabled( FALSE ); mLabelRevolutions->setEnabled( FALSE ); + mBtnCopyPosition->setEnabled(FALSE); + mBtnPastePosition->setEnabled(FALSE); + mBtnCopySize->setEnabled(FALSE); + mBtnPasteSize->setEnabled(FALSE); + mBtnCopyRotation->setEnabled(FALSE); + mBtnPasteRotation->setEnabled(FALSE); + mBtnCopyPrimParams->setEnabled(FALSE); + mBtnPastePrimParams->setEnabled(FALSE); getChildView("scale_hole")->setEnabled(FALSE); getChildView("scale_taper")->setEnabled(FALSE); getChildView("advanced_cut")->setEnabled(FALSE); @@ -2394,7 +2423,11 @@ void LLPanelObject::onCopyPos() std::string stringVec = llformat("<%g, %g, %g>", mClipboardPos.mV[VX], mClipboardPos.mV[VY], mClipboardPos.mV[VZ]); LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); + LLStringUtil::format_map_t args; + args["VALUE"] = stringVec; + mBtnPastePosition->setToolTip(getString("paste_position", args)); mHasClipboardPos = true; + refresh(); } void LLPanelObject::onCopySize() @@ -2404,7 +2437,12 @@ void LLPanelObject::onCopySize() std::string stringVec = llformat("<%g, %g, %g>", mClipboardSize.mV[VX], mClipboardSize.mV[VY], mClipboardSize.mV[VZ]); LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); + LLStringUtil::format_map_t args; + args["VALUE"] = stringVec; + mBtnPasteSize->setToolTip(getString("paste_size", args)); + mHasClipboardSize = true; + refresh(); } void LLPanelObject::onCopyRot() @@ -2414,7 +2452,12 @@ void LLPanelObject::onCopyRot() std::string stringVec = llformat("<%g, %g, %g>", mClipboardRot.mV[VX], mClipboardRot.mV[VY], mClipboardRot.mV[VZ]); LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); + LLStringUtil::format_map_t args; + args["VALUE"] = stringVec; + mBtnPasteRotation->setToolTip(getString("paste_rotation", args)); + mHasClipboardRot = true; + refresh(); } void LLPanelObject::onPastePos() @@ -2513,6 +2556,7 @@ void LLPanelObject::onCopyParams() mClipboardParams["sculpt"]["type"] = sculpt_params->getSculptType(); } + refresh(); } void LLPanelObject::onPasteParams() diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index fcfb9d1edeba382001ba5c58d6975e28ec5f7c4a..42a9cbff0878bf8f8077596a705deb3fdb7994f7 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -104,7 +104,6 @@ class LLPanelObject final : public LLPanel protected: // Per-object options LLComboBox* mComboBaseType; - LLMenuButton* mMenuClipboardParams; LLTextBox* mLabelCut; LLSpinCtrl* mSpinCutBegin; @@ -144,20 +143,17 @@ class LLPanelObject final : public LLPanel LLTextBox* mLabelRevolutions; LLSpinCtrl* mSpinRevolutions; - LLMenuButton* mMenuClipboardPos; LLTextBox* mLabelPosition; LLSpinCtrl* mCtrlPosX; LLSpinCtrl* mCtrlPosY; LLSpinCtrl* mCtrlPosZ; - LLMenuButton* mMenuClipboardSize; LLTextBox* mLabelSize; LLSpinCtrl* mCtrlScaleX; LLSpinCtrl* mCtrlScaleY; LLSpinCtrl* mCtrlScaleZ; BOOL mSizeChanged; - LLMenuButton* mMenuClipboardRot; LLTextBox* mLabelRotation; LLSpinCtrl* mCtrlRotX; LLSpinCtrl* mCtrlRotY; @@ -174,6 +170,15 @@ class LLPanelObject final : public LLPanel LLCheckBoxCtrl *mCtrlSculptMirror; LLCheckBoxCtrl *mCtrlSculptInvert; + LLButton *mBtnCopyPosition = nullptr; + LLButton *mBtnPastePosition = nullptr; + LLButton *mBtnCopySize = nullptr; + LLButton *mBtnPasteSize = nullptr; + LLButton *mBtnCopyRotation = nullptr; + LLButton *mBtnPasteRotation = nullptr; + LLButton *mBtnCopyPrimParams = nullptr; + LLButton *mBtnPastePrimParams = nullptr; + LLVector3 mCurEulerDegrees; // to avoid sending rotation when not changed BOOL mIsPhysical; // to avoid sending "physical" when not changed BOOL mIsTemporary; // to avoid sending "temporary" when not changed diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index e257456e1c708c58ec1936f63434e69ea4de485a..50ea9fe9018f468e261d2fad60ed00468130e179 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1437,6 +1437,9 @@ even though the user gets a free copy. name="Object" top="16" width="295"> + <panel.string name="paste_position">Paste Position [VALUE]</panel.string> + <panel.string name="paste_size">Paste Size [VALUE]</panel.string> + <panel.string name="paste_rotation">Paste Rotation [VALUE]</panel.string> <check_box height="19" label="Locked" @@ -1479,19 +1482,6 @@ even though the user gets a free copy. name="object_horizontal" top_pad="10" width="95" /> - <menu_button - menu_filename="menu_copy_paste_pos.xml" - follows="top|left" - height="11" - image_disabled="ClipboardSmallMenu_Disabled" - image_selected="ClipboardSmallMenu_Press" - image_unselected="ClipboardSmallMenu_Off" - layout="topleft" - left_delta="0" - top_pad="13" - name="clipboard_pos_btn" - tool_tip="Paste options" - width="19"/> <text type="string" length="1" @@ -1500,8 +1490,8 @@ even though the user gets a free copy. layout="topleft" name="label position" tool_tip="Position (meters)" - left_pad="8" - top_delta="0" + left="5" + top_pad="13" width="121"> Position (m) </text> @@ -1514,7 +1504,7 @@ even though the user gets a free copy. label="X" label_width="10" layout="topleft" - left_delta="-27" + left_delta="0" max_val="512" min_val="-256" name="Pos X" @@ -1553,27 +1543,44 @@ even though the user gets a free copy. text_enabled_color="0 0.8 1 .65" top_pad="3" width="87" /> - <menu_button - menu_filename="menu_copy_paste_size.xml" - follows="top|left" - height="11" - image_disabled="ClipboardSmallMenu_Disabled" - image_selected="ClipboardSmallMenu_Press" - image_unselected="ClipboardSmallMenu_Off" - layout="topleft" - left_delta="0" - top_pad="13" - name="clipboard_size_btn" - tool_tip="Paste options" - width="19"/> + <button + follows="top|right" + height="19" + top_delta="-43" + left_pad="5" + tab_stop="false" + image_overlay="Clipboard_Copy" + name="copy_position_btn" + tool_tip="Copy Position" + width="20" /> + <button + follows="top|right" + height="19" + top_pad="3" + tab_stop="false" + image_overlay="Clipboard_Paste" + name="paste_position_btn" + tool_tip="Paste Position" + width="20" /> + <button + visible="false" + follows="top|right" + height="19" + top_pad="3" + mouse_opaque="true" + tab_stop="false" + label="p" + name="pip_pos_btn" + tool_tip="" + width="20" /> <text type="string" length="1" follows="left|top" height="10" layout="topleft" - left_pad="8" - top_delta="0" + left="5" + top_pad="5" name="label size" tool_tip="Size (meters)" width="121"> @@ -1588,7 +1595,7 @@ even though the user gets a free copy. label="X" label_width="10" layout="topleft" - left_delta="-27" + left_delta="0" max_val="64" min_val="0.01" name="Scale X" @@ -1627,27 +1634,44 @@ even though the user gets a free copy. text_enabled_color="1 1 1 1" top_pad="3" width="87" /> - <menu_button - menu_filename="menu_copy_paste_rot.xml" - follows="top|left" - height="11" - image_disabled="ClipboardSmallMenu_Disabled" - image_selected="ClipboardSmallMenu_Press" - image_unselected="ClipboardSmallMenu_Off" - layout="topleft" - left_delta="0" - top_pad="13" - name="clipboard_rot_btn" - tool_tip="Paste options" - width="19"/> + <button + follows="top|right" + height="19" + top_delta="-43" + left_pad="5" + tab_stop="false" + image_overlay="Clipboard_Copy" + name="copy_size_btn" + tool_tip="Copy Size" + width="20" /> + <button + follows="top|right" + height="19" + top_pad="3" + tab_stop="false" + image_overlay="Clipboard_Paste" + name="paste_size_btn" + tool_tip="Paste Size" + width="20" /> + <button + visible="false" + follows="top|right" + height="19" + top_pad="3" + mouse_opaque="true" + tab_stop="false" + label="p" + name="pip_size_btn" + tool_tip="" + width="20" /> <text type="string" length="1" follows="left|top" height="10" layout="topleft" - left_pad="8" - top_delta="0" + left="5" + top_pad="5" name="label rotation" tool_tip="Rotation (degrees)" width="121"> @@ -1662,7 +1686,7 @@ even though the user gets a free copy. label="X" label_width="10" layout="topleft" - left_delta="-27" + left_delta="0" max_val="9999" min_val="-9999" name="Rot X" @@ -1701,6 +1725,36 @@ even though the user gets a free copy. text_enabled_color="1 1 1 1" top_pad="3" width="87" /> + <button + follows="top|right" + height="19" + top_delta="-43" + left_pad="5" + tab_stop="false" + image_overlay="Clipboard_Copy" + name="copy_rotation_btn" + tool_tip="Copy Rotation" + width="20" /> + <button + follows="top|right" + height="19" + top_pad="3" + tab_stop="false" + image_overlay="Clipboard_Paste" + name="paste_rotation_btn" + tool_tip="Paste Rotation" + width="20" /> + <button + visible="false" + follows="top|right" + height="19" + top_pad="3" + mouse_opaque="true" + tab_stop="false" + label="p" + name="pip_rotation_btn" + tool_tip="" + width="20" /> <!-- <text type="string" length="1" @@ -1728,7 +1782,7 @@ even though the user gets a free copy. layout="topleft" name="comboBaseType" top="6" - left="125" + left="120" width="125"> <combo_box.item label="Box" @@ -1819,19 +1873,27 @@ even though the user gets a free copy. value="Path33Profile5" label="33->HalfCircle" /> </combo_box> - <menu_button - menu_filename="menu_copy_paste_object.xml" + <button follows="top|left" - height="15" - image_disabled="ClipboardMenu_Disabled" - image_selected="ClipboardMenu_Press" - image_unselected="ClipboardMenu_Off" - layout="topleft" - left_pad="8" - top_delta="2" - name="clipboard_obj_params_btn" - tool_tip="Paste options" - width="22"/> + height="19" + left_pad="1" + top_delta="0" + tab_stop="false" + image_overlay="Clipboard_Copy" + name="copy_primparams_btn" + tool_tip="Copy Primitive Parameters" + width="20" /> + <button + follows="top|left" + height="19" + left_pad="1" + top_delta="0" + mouse_opaque="true" + tab_stop="false" + image_overlay="Clipboard_Paste" + name="paste_primparams_btn" + tool_tip="Paste Primitive Parameters" + width="20" /> <text type="string" length="1"