diff options
author | mobserveur <mobserveur@gmail.com> | 2024-07-14 23:51:21 +0200 |
---|---|---|
committer | mobserveur <mobserveur@gmail.com> | 2024-07-14 23:51:21 +0200 |
commit | 99ab1a2c04d5c4283e55f4234633dc53f488e188 (patch) | |
tree | 3258c21904c60136fba39c8886e1ccb569b69d9f | |
parent | b5ac09bdb43e0f2506d9229e0070c5e8b8792b17 (diff) |
Collapsable camera floater
This commit allows to collapse the camera floater
-rw-r--r-- | indra/newview/app_settings/settings.xml | 18 | ||||
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llfloatercamera.h | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_camera.xml | 113 |
4 files changed, 110 insertions, 52 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 81b35359be..f76992c30b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13762,7 +13762,10 @@ <key>Comment</key> <string> OpenGL buffer mapping mode: - 0:auto, 1:normal, 2:optimised, 3:unsynchronized.</string> + 0:auto + 1:normal + 2:optimised + 3:experimental.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -13770,7 +13773,18 @@ <key>Value</key> <integer>0</integer> </map> - + <key>MPVCameraCollapsed</key> + <map> + <key>Comment</key> + <string> + Camera floater collapsed</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <!-- Settings below are for back compatibility only. They are not used in current viewer anymore. But they can't be removed to avoid 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); +} diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 038ce8f173..561e9a5bb3 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -122,6 +122,9 @@ private: void showDebugInfo(bool show); + void toggleCollapsedView(); + void updateCollapsedView(); + // set to true when free camera mode is selected in modes list // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed static bool sFreeCamera; @@ -135,7 +138,8 @@ private: LLPanel* mViewerCameraInfo { nullptr }; LLPanel* mAgentCameraInfo { nullptr }; LLComboBox* mPresetCombo { nullptr }; - LLTextBox* mPreciseCtrls { nullptr }; + LLButton* mPreciseCtrls { nullptr }; + LLButton* mCollapseCtrl { nullptr }; }; /** diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 93b306d7d7..44a5638bc4 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -5,9 +5,11 @@ bottom="-50" follows="left|bottom" legacy_header_height="18" - can_minimize="true" + can_minimize="false" + can_collapse="false" can_close="true" - height="135" + width="410" + height="114" layout="topleft" name="camera_floater" help_topic="camera_floater" @@ -15,8 +17,7 @@ single_instance="true" title="CAMERA CONTROLS" chrome="true" - save_rect="true" - width="400"> + save_rect="true"> <floater.string name="rotate_tooltip"> Rotate Camera Around Focus @@ -36,18 +37,19 @@ <string name="inactive_combo_text">Use preset</string> <panel border="false" - height="123" + width="220" + height="90" layout="topleft" left="2" - top="0" + top="18" mouse_opaque="false" name="controls" - width="220"> + > <!--TODO: replace + - images --> <panel border="false" class="camera_zoom_panel" - height="123" + height="90" layout="topleft" left="0" mouse_opaque="false" @@ -56,54 +58,59 @@ width="220"> <joystick_rotate follows="top|left" + width="78" height="78" layout="topleft" left="7" + top="8" name="cam_rotate_stick" quadrant="left" sound_flags="3" visible="true" + scale_image="true" tool_tip="Orbit camera around focus" - top="25" - width="78" /> + /> <button follows="top|left" + width="18" height="18" + left_pad="4" + top="2" + layout="topleft" image_disabled="AddItem_Disabled" image_selected="AddItem_Press" image_unselected="AddItem_Off" - layout="topleft" - left_pad="14" name="zoom_plus_btn" - width="18" - top="23"> + > <commit_callback function="Zoom.plus" /> <mouse_held_callback function="Zoom.plus" /> </button> <slider_bar + width="18" height="50" + top_pad="0" layout="topleft" name="zoom_slider" orientation="vertical" tool_tip="Zoom camera toward focus" - top_pad="0" min_val="0" - max_val="1" - width="18"> + max_val="1" + > <commit_callback function="Slider.value_changed"/> </slider_bar> <button follows="top|left" + width="18" height="18" + top_pad="0" + layout="topleft" image_disabled="MinusItem_Disabled" image_selected="MinusItem_Press" image_unselected="MinusItem_Off" - layout="topleft" name="zoom_minus_btn" - top_pad="0" - width="18"> + > <commit_callback function="Zoom.minus" /> <mouse_held_callback @@ -111,35 +118,46 @@ </button> <joystick_track follows="top|left" + width="78" height="78" + left_pad="4" image_selected="Cam_Tracking_In" image_unselected="Cam_Tracking_Out" layout="topleft" - left="133" name="cam_track_stick" quadrant="left" - scale_image="false" + scale_image="true" sound_flags="3" tool_tip="Move camera up and down, left and right" - top="25" - width="78"/> - <text - type="string" - length="1" - follows="left|top" - height="15" + /> + <button + follows="top|left" + width="18" + height="18" + top="8" + left_pad="6" + layout="topleft" + name="collapse_btn" + > + </button> + <button + follows="top|left" + width="18" + height="18" + top_pad="4" layout="topleft" - left="41" - top_pad="9" - name="precise_ctrs_label" - width="200"> - Use precise controls - </text> + name="precise_btn" + image_disabled="Cam_FreeCam_Off" + image_selected="Cam_FreeCam_Off" + image_unselected="Cam_FreeCam_Off" + tool_tip="Use precise controls" + > + </button> </panel> </panel> <panel follows="left|top" - height="102" + height="90" layout="topleft" left_pad="2" right="-2" @@ -216,7 +234,7 @@ mouse_opaque="true" name="preset_combo" top_pad="10" - width="136"> + width="124"> <combo_list mouse_wheel_opaque="true"/> <combo_box.item @@ -226,13 +244,13 @@ </combo_box> <button height="16" - width="16" + width="16" layout="topleft" mouse_opaque="true" name="gear_btn" tool_tip="My Camera Presets" top_delta="3" - left_pad="10" + left_pad="10" image_selected="Icon_Gear" image_pressed="Icon_Gear" image_unselected="Icon_Gear" @@ -242,13 +260,16 @@ </button> <button follows="top|left" - height="25" - label="Save as preset..." + width="18" + height="18" + left_pad="4" + tooltip_text="Save as preset..." layout="topleft" - left="0" name="save_preset_btn" - top_pad="18" - width="150"> + image_disabled="Conv_toolbar_plus" + image_selected="Conv_toolbar_plus" + image_unselected="Conv_toolbar_plus" + > <button.commit_callback function="CameraPresets.Save"/> </button> @@ -259,7 +280,7 @@ top="135" width="400" height="150" - border="true" + border="false" visible="false" background_visible="true"/> <panel @@ -268,7 +289,7 @@ top="285" width="400" height="150" - border="true" + border="false" visible="false" background_visible="true"/> </floater> |