From 4cb3634932fe8175fb878894cce584bfb8bba8c6 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 21 Nov 2011 13:55:09 +0200 Subject: EXP-1630 FIXED Only show snapshot size spinners and "Constrain proportions" checkbox when Custom resolution is selected. --- indra/newview/llpanelsnapshot.cpp | 12 +- indra/newview/llpanelsnapshot.h | 1 + indra/newview/llpanelsnapshotinventory.cpp | 7 +- indra/newview/llpanelsnapshotlocal.cpp | 1 + indra/newview/llpanelsnapshotpostcard.cpp | 1 + indra/newview/llpanelsnapshotprofile.cpp | 1 + .../default/xui/en/panel_postcard_settings.xml | 163 +++++++++------- .../skins/default/xui/en/panel_snapshot_local.xml | 205 ++++++++++++--------- .../default/xui/en/panel_snapshot_profile.xml | 171 ++++++++++------- 9 files changed, 333 insertions(+), 229 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 90e32f973f..2f29e758c6 100644 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -124,15 +124,11 @@ LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer() // virtual void LLPanelSnapshot::updateCustomResControls() { + // Only show width/height spinners and the aspect ratio checkbox + // when a custom resolution is chosen. LLComboBox* combo = getChild(getImageSizeComboName()); - S32 selected_idx = combo->getFirstSelectedIndex(); - const bool enable = selected_idx == (combo->getItemCount() - 1); // Current Window or Custom selected - - getChild(getWidthSpinnerName())->setEnabled(enable); - getChild(getWidthSpinnerName())->setAllowEdit(enable); - getChild(getHeightSpinnerName())->setEnabled(enable); - getChild(getHeightSpinnerName())->setAllowEdit(enable); - enableAspectRatioCheckbox(enable); + const bool show = combo->getFirstSelectedIndex() == (combo->getItemCount() - 1); + getChild(getImageSizePanelName())->setVisible(show); } void LLPanelSnapshot::updateImageQualityLevel() diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h index 7adb2fabc7..f3274cf594 100644 --- a/indra/newview/llpanelsnapshot.h +++ b/indra/newview/llpanelsnapshot.h @@ -44,6 +44,7 @@ public: virtual std::string getHeightSpinnerName() const = 0; virtual std::string getAspectRatioCBName() const = 0; virtual std::string getImageSizeComboName() const = 0; + virtual std::string getImageSizePanelName() const = 0; virtual S32 getTypedPreviewWidth() const; virtual S32 getTypedPreviewHeight() const; diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index aca0ee6700..381c11348d 100644 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -54,6 +54,7 @@ private: /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; } /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; } /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; } /*virtual*/ void updateControls(const LLSD& info); void onSend(); @@ -70,6 +71,8 @@ LLPanelSnapshotInventory::LLPanelSnapshotInventory() // virtual BOOL LLPanelSnapshotInventory::postBuild() { + getChild(getWidthSpinnerName())->setAllowEdit(FALSE); + getChild(getHeightSpinnerName())->setAllowEdit(FALSE); getChild(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures return LLPanelSnapshot::postBuild(); } @@ -90,10 +93,6 @@ void LLPanelSnapshotInventory::updateCustomResControls() getChild(getWidthSpinnerName())->setVisible(show); getChild(getHeightSpinnerName())->setVisible(show); - - // Editing gets often enable elsewhere in common snapshot panel code. Override that. - getChild(getWidthSpinnerName())->setAllowEdit(FALSE); - getChild(getHeightSpinnerName())->setAllowEdit(FALSE); } // virtual diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 4a2614fa7d..d153ff598d 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -54,6 +54,7 @@ private: /*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; } /*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; } /*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; } /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const; /*virtual*/ void updateControls(const LLSD& info); diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index 6867c7af4e..f2bb8f530b 100644 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -62,6 +62,7 @@ private: /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; } /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; } /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; } /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; } /*virtual*/ void updateControls(const LLSD& info); diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index 89245fc804..a706318369 100644 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -57,6 +57,7 @@ private: /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; } /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; } /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; } /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } /*virtual*/ void updateControls(const LLSD& info); diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml index 84e3593798..aebbc51be1 100644 --- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml +++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml @@ -34,69 +34,104 @@ name="Custom" value="[i-1,i-1]" /> - - - - - - ([QLVL]) - + right="-10"> + + + + + + + + + ([QLVL]) + + + diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index 30403a21dd..ae0215a578 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -80,93 +80,128 @@ name="Custom" value="[i-1,i-1]" /> - - - - - - - - - - - ([QLVL]) - + right="-10"> + + + + + + + + + + + + + + ([QLVL]) + + +