Skip to content
Snippets Groups Projects
Commit 69b02def authored by NiranV's avatar NiranV
Browse files

STORM-2040: Removed: Unnecessary code for hiding/showing "Constrain proportions" checkbox.

It's either shown/hidden internally in each panel or is simply disabled/enabled depending on the resolution choice, it doesn't make any sense having this extra bit of code additionally hiding it.
parent 3745a125
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,6 @@ void LLPanelSnapshot::onOpen(const LLSD& key) ...@@ -65,8 +65,6 @@ void LLPanelSnapshot::onOpen(const LLSD& key)
{ {
LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true));
} }
updateCustomResControls();
} }
LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
...@@ -77,11 +75,6 @@ LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const ...@@ -77,11 +75,6 @@ LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
void LLPanelSnapshot::enableControls(BOOL enable) void LLPanelSnapshot::enableControls(BOOL enable)
{ {
setCtrlsEnabled(enable); setCtrlsEnabled(enable);
if (enable)
{
// Make sure only relevant controls are enabled/shown.
updateCustomResControls();
}
} }
LLSpinCtrl* LLPanelSnapshot::getWidthSpinner() LLSpinCtrl* LLPanelSnapshot::getWidthSpinner()
...@@ -121,16 +114,6 @@ LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer() ...@@ -121,16 +114,6 @@ LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer()
return parent; return parent;
} }
// virtual
void LLPanelSnapshot::updateCustomResControls()
{
// Only show width/height spinners and the aspect ratio checkbox
// when a custom resolution is chosen.
LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
const bool show = combo->getFirstSelectedIndex() == (combo->getItemCount() - 1);
getChild<LLUICtrl>(getImageSizePanelName())->setVisible(show);
}
void LLPanelSnapshot::updateImageQualityLevel() void LLPanelSnapshot::updateImageQualityLevel()
{ {
LLSliderCtrl* quality_slider = getChild<LLSliderCtrl>("image_quality_slider"); LLSliderCtrl* quality_slider = getChild<LLSliderCtrl>("image_quality_slider");
...@@ -188,8 +171,6 @@ void LLPanelSnapshot::onCustomResolutionCommit() ...@@ -188,8 +171,6 @@ void LLPanelSnapshot::onCustomResolutionCommit()
void LLPanelSnapshot::onResolutionComboCommit(LLUICtrl* ctrl) void LLPanelSnapshot::onResolutionComboCommit(LLUICtrl* ctrl)
{ {
updateCustomResControls();
LLSD info; LLSD info;
info["combo-res-change"]["control-name"] = ctrl->getName(); info["combo-res-change"]["control-name"] = ctrl->getName();
LLFloaterSnapshot::getInstance()->notify(info); LLFloaterSnapshot::getInstance()->notify(info);
......
...@@ -57,7 +57,6 @@ class LLPanelSnapshot: public LLPanel ...@@ -57,7 +57,6 @@ class LLPanelSnapshot: public LLPanel
protected: protected:
LLSideTrayPanelContainer* getParentContainer(); LLSideTrayPanelContainer* getParentContainer();
virtual void updateCustomResControls();
void updateImageQualityLevel(); void updateImageQualityLevel();
void goBack(); ///< Switch to the default (Snapshot Options) panel void goBack(); ///< Switch to the default (Snapshot Options) panel
void cancel(); void cancel();
......
...@@ -49,7 +49,6 @@ class LLPanelSnapshotInventory ...@@ -49,7 +49,6 @@ class LLPanelSnapshotInventory
/*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onOpen(const LLSD& key);
private: private:
/*virtual*/ void updateCustomResControls(); ///< Show/hide custom resolution controls (spinners and checkbox)
/*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; } /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; } /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; } /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; }
...@@ -73,7 +72,6 @@ BOOL LLPanelSnapshotInventory::postBuild() ...@@ -73,7 +72,6 @@ BOOL LLPanelSnapshotInventory::postBuild()
{ {
getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE); getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE); getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures
return LLPanelSnapshot::postBuild(); return LLPanelSnapshot::postBuild();
} }
...@@ -84,17 +82,6 @@ void LLPanelSnapshotInventory::onOpen(const LLSD& key) ...@@ -84,17 +82,6 @@ void LLPanelSnapshotInventory::onOpen(const LLSD& key)
LLPanelSnapshot::onOpen(key); LLPanelSnapshot::onOpen(key);
} }
// virtual
void LLPanelSnapshotInventory::updateCustomResControls()
{
LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
S32 selected_idx = combo->getFirstSelectedIndex();
const bool show = selected_idx == (combo->getItemCount() - 1); // Custom selected
getChild<LLUICtrl>(getWidthSpinnerName())->setVisible(show);
getChild<LLUICtrl>(getHeightSpinnerName())->setVisible(show);
}
// virtual // virtual
void LLPanelSnapshotInventory::updateControls(const LLSD& info) void LLPanelSnapshotInventory::updateControls(const LLSD& info)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment