summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercamera.cpp
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.com>2024-07-14 23:51:21 +0200
committermobserveur <mobserveur@gmail.com>2024-07-14 23:51:21 +0200
commit99ab1a2c04d5c4283e55f4234633dc53f488e188 (patch)
tree3258c21904c60136fba39c8886e1ccb569b69d9f /indra/newview/llfloatercamera.cpp
parentb5ac09bdb43e0f2506d9229e0070c5e8b8792b17 (diff)
Collapsable camera floater
This commit allows to collapse the camera floater
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r--indra/newview/llfloatercamera.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 4b91ff6881..b08af851c3 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -478,10 +478,8 @@ BOOL LLFloaterCamera::postBuild()
mZoom = getChild<LLPanelCameraZoom>(ZOOM);
mTrack = getChild<LLJoystickCameraTrack>(PAN);
mPresetCombo = getChild<LLComboBox>("preset_combo");
- mPreciseCtrls = getChild<LLTextBox>("precise_ctrs_label");
+ mPreciseCtrls = getChild<LLButton>("precise_btn");
- mPreciseCtrls->setShowCursorHand(false);
- mPreciseCtrls->setSoundFlags(LLView::MOUSE_UP);
mPreciseCtrls->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE));
mPresetCombo->setCommitCallback(boost::bind(&LLFloaterCamera::onCustomPresetSelected, this));
@@ -492,6 +490,11 @@ BOOL LLFloaterCamera::postBuild()
// ensure that appearance mode is handled while building. See EXT-7796.
handleAvatarEditingAppearance(sAppearanceEditing);
+ mCollapseCtrl = getChild<LLButton>("collapse_btn");
+ mCollapseCtrl->setCommitCallback(boost::bind(&LLFloaterCamera::toggleCollapsedView, this));
+
+ updateCollapsedView();
+
return LLFloater::postBuild();
}
@@ -736,3 +739,19 @@ void LLFloaterCamera::onCustomPresetSelected()
switchToPreset(selected_preset);
}
}
+
+void LLFloaterCamera::toggleCollapsedView()
+{
+ BOOL isCollapsed = gSavedSettings.getBOOL("MPVCameraCollapsed");
+ gSavedSettings.setBOOL("MPVCameraCollapsed", !isCollapsed);
+ updateCollapsedView();
+}
+
+void LLFloaterCamera::updateCollapsedView()
+{
+ BOOL isCollapsed = gSavedSettings.getBOOL("MPVCameraCollapsed");
+ mCollapseCtrl->setImageOverlay(!isCollapsed ? "Conv_toolbar_collapse" : "Conv_toolbar_expand");
+ getChild<LLPanel>("buttons_panel")->setVisible(!isCollapsed);
+ //mPreciseCtrls->setVisible(!collapse);
+ reshape(!isCollapsed ? 410 : 220, getRect().getHeight(), FALSE);
+}