summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llsliderctrl.cpp37
-rw-r--r--indra/llui/llsliderctrl.h4
-rw-r--r--indra/newview/llpanelenvironment.cpp15
-rw-r--r--indra/newview/llpanelenvironment.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_environment.xml651
5 files changed, 403 insertions, 305 deletions
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 0056cb6dc4..c3c3ce04f9 100644
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -283,6 +283,31 @@ void LLSliderCtrl::updateText()
}
}
+void LLSliderCtrl::updateSliderRect()
+{
+ S32 right = getRect().getWidth();
+ S32 top = getRect().getHeight();
+ S32 bottom = 0;
+ S32 left = 0;
+ static LLUICachedControl<S32> sliderctrl_spacing("UISliderctrlSpacing", 0);
+ if (mEditor)
+ {
+ LLRect editor_rect = mEditor->getRect();
+ S32 editor_width = editor_rect.getWidth();
+ editor_rect.mRight = right;
+ editor_rect.mLeft = right - editor_width;
+ mEditor->setRect(editor_rect);
+
+ right -= editor_width + sliderctrl_spacing;
+ }
+ if (mLabelBox)
+ {
+ left += mLabelBox->getRect().getWidth() + sliderctrl_spacing;
+ }
+
+ mSlider->setRect(LLRect(left, top,right,bottom));
+}
+
// static
void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata )
{
@@ -404,6 +429,18 @@ void LLSliderCtrl::onCommit()
LLF32UICtrl::onCommit();
}
+void LLSliderCtrl::setRect(const LLRect& rect)
+{
+ LLF32UICtrl::setRect(rect);
+ updateSliderRect();
+}
+
+//virtual
+void LLSliderCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+ LLF32UICtrl::reshape(width, height, called_from_parent);
+ updateSliderRect();
+}
void LLSliderCtrl::setPrecision(S32 precision)
{
diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h
index 67cca9ef04..75fcdc4b71 100644
--- a/indra/llui/llsliderctrl.h
+++ b/indra/llui/llsliderctrl.h
@@ -125,6 +125,9 @@ public:
mSlider->setControlName(control_name, context);
}
+ /*virtual*/ void setRect(const LLRect& rect);
+ /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
+
static void onSliderCommit(LLUICtrl* caller, const LLSD& userdata);
static void onEditorCommit(LLUICtrl* ctrl, const LLSD& userdata);
@@ -133,6 +136,7 @@ public:
private:
void updateText();
+ void updateSliderRect();
void reportInvalidData();
const LLFontGL* mFont;
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index abd1913185..6e6879ca0c 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -73,6 +73,7 @@ const std::string LLPanelEnvironmentInfo::SLD_DAYLENGTH("sld_day_length");
const std::string LLPanelEnvironmentInfo::SLD_DAYOFFSET("sld_day_offset");
const std::string LLPanelEnvironmentInfo::SLD_ALTITUDES("sld_altitudes");
const std::string LLPanelEnvironmentInfo::ICN_GROUND("icon_ground");
+const std::string LLPanelEnvironmentInfo::ICN_WATER("icon_water");
const std::string LLPanelEnvironmentInfo::CHK_ALLOWOVERRIDE("chk_allow_override");
const std::string LLPanelEnvironmentInfo::LBL_TIMEOFDAY("lbl_apparent_time");
const std::string LLPanelEnvironmentInfo::PNL_SETTINGS("pnl_environment_config");
@@ -107,6 +108,9 @@ const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_MASK(
const U32 ALTITUDE_SLIDER_COUNT = 3;
const F32 ALTITUDE_DEFAULT_HEIGHT_STEP = 1000;
+const U32 ALTITUDE_MARKERS_COUNT = 3;
+
+const std::string slider_marker_base = "mark";
const std::string alt_sliders[] = {
"sld1",
@@ -441,10 +445,21 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
getChild<LLUICtrl>(SLD_DAYOFFSET)->setEnabled(can_enable && !is_legacy);
getChild<LLUICtrl>(SLD_ALTITUDES)->setEnabled(can_enable && isRegion() && !is_legacy);
getChild<LLUICtrl>(ICN_GROUND)->setColor((can_enable && isRegion() && !is_legacy) ? LLColor4::white : LLColor4::grey % 0.8f);
+ getChild<LLUICtrl>(ICN_WATER)->setColor((can_enable && isRegion() && !is_legacy) ? LLColor4::white : LLColor4::grey % 0.8f);
getChild<LLUICtrl>(BTN_RST_ALTITUDES)->setEnabled(can_enable && isRegion() && !is_legacy);
getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setEnabled(can_enable && isRegion() && !is_legacy);
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setEnabled(can_enable && isRegion() && !is_legacy);
+ for (U32 idx = 0; idx < ALTITUDE_MARKERS_COUNT; idx++)
+ {
+ LLUICtrl* marker = findChild<LLUICtrl>(slider_marker_base + llformat("%u", idx));
+ if (marker)
+ {
+ static LLColor4 marker_color(0.75f, 0.75f, 0.75f, 1.f);
+ marker->setColor((can_enable && isRegion() && !is_legacy) ? marker_color : marker_color % 0.3f);
+ }
+ }
+
getChild<LLSettingsDropTarget>(SDT_DROP_TARGET)->setDndEnabled(enabled && !is_legacy);
return true;
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index 18ab64dc12..b5debe69c2 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -71,6 +71,7 @@ protected:
static const std::string SLD_DAYOFFSET;
static const std::string SLD_ALTITUDES;
static const std::string ICN_GROUND;
+ static const std::string ICN_WATER;
static const std::string CHK_ALLOWOVERRIDE;
static const std::string BTN_APPLY;
static const std::string BTN_CANCEL;
diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml
index a39973fe3a..ed344f2a14 100644
--- a/indra/newview/skins/default/xui/en/panel_region_environment.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml
@@ -2,7 +2,7 @@
<panel
border="true"
- follows="top|left"
+ follows="all"
height="375"
label="Environment"
layout="topleft"
@@ -22,6 +22,7 @@
<layout_stack
width="530"
height="367"
+ auto_resize="true"
follows="all"
layout="topleft"
animate="false"
@@ -57,297 +58,7 @@
auto_resize="true"
user_resize="false"
min_height="0"
- top="5"
- name="pnl_environment_altitudes"
- visible="true">
- <text follows="top|left"
- font="SansSerif"
- halign="left"
- text_color="white"
- left="5"
- top="2">Sky Altitudes</text>
- <multi_slider
- height="270"
- follows="top|left"
- orientation="vertical"
- increment="25"
- min_val="100"
- max_val="4000"
- thumb_image="Inv_SettingsSky"
- thumb_width="17"
- thumb_highlight_color="white"
- decimal_digits="0"
- draw_track="true"
- overlap_threshold="100"
- initial_value="0"
- layout="topleft"
- left="10"
- max_sliders="3"
- name="sld_altitudes"
- show_text="false"
- top_pad="20"
- use_triangle="false"
- width="17">
- <slider name="sld1"
- value="1000"/>
- <slider name="sld2"
- value="2000"/>
- <slider name="sld3"
- value="3000"/>
- </multi_slider>
- <panel
- follows="top|left"
- height="21"
- width="222"
- layout="topleft"
- visible="true"
- left="10"
- top_pad="10"
- name="pnl_ground">
- <icon
- follows="top|left"
- height="17"
- width="17"
- image_name="Inv_SettingsSky"
- layout="topleft"
- name="icon_ground"
- mouse_opaque="false"
- visible="true"
- top_pad="2"
- left_delta="0"/>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="12"
- layout="topleft"
- left_pad="8"
- top_delta="2"
- width="50"
- name="txt_ground">
- Ground
- </text>
- <line_editor
- follows="top|right"
- enabled="false"
- top_delta="-3"
- right="-5"
- xxxleft="-160"
- height="20"
- layout="topleft"
- name="edt_invname_ground"
- width="155">
- Unknown
- </line_editor>
- <settings_drop_target
- height="20"
- top_delta="0"
- left_delta="0"
- follows="top|left"
- layout="topleft"
- name="sdt_ground"
- tool_tip="Drag a setting from Inventory onto this target box to select it as the ground level sky."
- width="155" />
- </panel>
- <panel
- follows="top|left"
- height="21"
- width="222"
- layout="topleft"
- visible="true"
- left="10"
- top_pad="10"
- name="pnl_water">
- <icon
- follows="left|top"
- height="17"
- width="17"
- image_name="Inv_SettingsWater"
- layout="topleft"
- name="icon_water"
- mouse_opaque="false"
- visible="true"
- top_pad="2"
- left_delta="0"/>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="12"
- layout="topleft"
- left_pad="8"
- top_delta="2"
- width="200"
- name="txt_water">
- Water
- </text>
- <line_editor
- follows="top|right"
- enabled="false"
- top_delta="-3"
- right="-5"
- xxxleft="-160"
- height="20"
- layout="topleft"
- name="edt_invname_water"
- width="155">
- Unknown
- </line_editor>
- <settings_drop_target
- height="20"
- top_delta="0"
- left_delta="0"
- follows="top|left"
- layout="topleft"
- name="sdt_water"
- tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
- width="155" />
- </panel>
- <button
- follows="top|left"
- layout="topleft"
- height="23"
- width="100"
- label="Reset"
- left_pad="-90"
- top_pad="4"
- tool_tip="Reset to default altitudes"
- name="btn_rst_altitudes" />
- <panel
- follows="top|left"
- height="21"
- width="205"
- layout="topleft"
- visible="true"
- left="35"
- top="30"
- name="pnl_alt1">
- <text
- type="string"
- length="1"
- follows="left"
- height="12"
- layout="topleft"
- top_pad="5"
- left_delta="0"
- width="200"
- name="txt_alt1">
- Sky [INDEX]([ALTITUDE]m)
- </text>
- <line_editor
- follows="top|right"
- enabled="false"
- top_delta="-3"
- right="-5"
- xxxleft="-160"
- height="20"
- layout="topleft"
- name="edt_invname_alt1"
- width="155">
- Unknown
- </line_editor>
- <settings_drop_target
- height="20"
- top_delta="0"
- left_delta="0"
- follows="top|left"
- layout="topleft"
- name="sdt_alt2"
- tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
- width="155" />
- </panel>
- <panel
- follows="top|left"
- height="21"
- width="205"
- layout="topleft"
- visible="true"
- left="35"
- top="50"
- name="pnl_alt2">
- <text
- type="string"
- length="1"
- follows="left|top"
- height="12"
- layout="topleft"
- top_pad="5"
- left_delta="0"
- width="200"
- name="txt_alt2">
- Sky [INDEX]([ALTITUDE]m)
- </text>
- <line_editor
- follows="top|right"
- enabled="false"
- top_delta="-3"
- right="-5"
- xxxleft="-160"
- height="20"
- layout="topleft"
- name="edt_invname_alt2"
- width="155">
- Unknown
- </line_editor>
- <settings_drop_target
- height="20"
- top_delta="0"
- left_delta="0"
- follows="top|left"
- layout="topleft"
- name="sdt_alt2"
- tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
- width="155" />
- </panel>
- <panel
- follows="top|left"
- height="21"
- width="205"
- layout="topleft"
- visible="true"
- left="35"
- top="70"
- name="pnl_alt3">
- <text
- type="string"
- length="1"
- follows="left|top"
- height="12"
- layout="topleft"
- top_pad="5"
- left_delta="0"
- width="200"
- name="txt_alt3">
- Sky [INDEX]([ALTITUDE]m)
- </text>
- <line_editor
- follows="top|right"
- enabled="false"
- top_delta="-3"
- right="-5"
- xxxleft="-160"
- height="20"
- layout="topleft"
- name="edt_invname_alt3"
- width="155">
- Unknown
- </line_editor>
- <settings_drop_target
- height="20"
- top_delta="0"
- left_delta="0"
- follows="top|left"
- layout="topleft"
- name="sdt_alt3"
- tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
- width="155" />
- </panel>
- </layout_panel>
- <layout_panel
- auto_resize="true"
- user_resize="false"
- min_height="0"
- top="5"
+ top="0"
name="pnl_environment_config"
visible="true">
<layout_stack
@@ -365,6 +76,7 @@
font="SansSerif"
halign="left"
text_color="white"
+ left="5"
top="2">Select Environment</text>
<button
follows="top|left"
@@ -413,6 +125,7 @@
follows="top|left|right"
halign="left"
text_color="white"
+ left="5"
top="2">Day Settings</text>
<text
type="string"
@@ -427,19 +140,20 @@
</text>
<slider
can_edit_text="true"
+ auto_resize="true"
decimal_digits="1"
- follows="left|top"
- height="20"
- increment="0.5"
- initial_value="4"
+ follows="top|left|right"
layout="topleft"
- left_delta="0"
- xxxright="-10"
+ increment="0.5"
+ height="20"
+ width="237"
+ left="10"
top_pad="0"
+ right="-10"
+ initial_value="4"
name="sld_day_length"
min_val="4"
- max_val="168"
- width="237" />
+ max_val="168" />
<text
type="string"
length="1"
@@ -454,17 +168,18 @@
<slider
can_edit_text="true"
decimal_digits="1"
- follows="left|top"
+ follows="top|left|right"
+ layout="topleft"
height="20"
+ width="237"
increment="0.5"
initial_value="-8"
- layout="topleft"
- left_delta="0"
+ left="10"
top_pad="0"
+ right="-10"
name="sld_day_offset"
min_val="-11.5"
- max_val="12"
- width="237" />
+ max_val="12" />
<text
type="string"
length="1"
@@ -499,6 +214,332 @@
</layout_panel>
</layout_stack>
</layout_panel>
+ <layout_panel
+ auto_resize="true"
+ user_resize="false"
+ min_height="0"
+ top="0"
+ name="pnl_environment_altitudes"
+ visible="true">
+ <!-- Three movable panels first so that they will be 'below' slider-->
+ <panel
+ follows="top|left"
+ height="26"
+ width="360"
+ layout="topleft"
+ visible="true"
+ left="1"
+ top="30"
+ name="pnl_alt1">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ height="24"
+ width="52"
+ left_delta="2"
+ top_pad="1"
+ halign="right"
+ name="txt_alt1">
+ Sky [INDEX]
+ [ALTITUDE]m
+ </text>
+ <line_editor
+ follows="left|top"
+ enabled="false"
+ top_delta="3"
+ left_pad="21"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_alt1"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_alt2"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current sky."
+ width="155" />
+ </panel>
+ <panel
+ follows="top|left"
+ height="26"
+ width="360"
+ layout="topleft"
+ visible="true"
+ left="1"
+ top="60"
+ name="pnl_alt2">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ height="24"
+ width="52"
+ left_delta="2"
+ top_pad="1"
+ halign="right"
+ name="txt_alt2">
+ Sky [INDEX]
+ [ALTITUDE]m
+ </text>
+ <line_editor
+ follows="left|top"
+ enabled="false"
+ top_delta="3"
+ left_pad="21"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_alt2"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_alt2"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current sky."
+ width="155" />
+ </panel>
+ <panel
+ follows="top|left"
+ height="26"
+ width="360"
+ layout="topleft"
+ visible="true"
+ left="1"
+ top="90"
+ name="pnl_alt3">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ height="25"
+ width="52"
+ left_delta="2"
+ top_pad="1"
+ halign="right"
+ name="txt_alt3">
+ Sky [INDEX]
+ [ALTITUDE]m
+ </text>
+ <line_editor
+ follows="left|top"
+ enabled="false"
+ top_delta="3"
+ left_pad="21"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_alt3"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_alt3"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current sky."
+ width="155" />
+ </panel>
+ <text follows="top|left"
+ font="SansSerif"
+ halign="left"
+ text_color="white"
+ left="5"
+ top="2">Sky Altitudes</text>
+ <!-- Divider icons also should be under slider to not interfer with clicks-->
+ <icon
+ color="LtGray"
+ height="2"
+ width="17"
+ image_name="Rounded_Square"
+ layout="topleft"
+ left="57"
+ top="89"
+ name="mark0"/>
+ <icon
+ color="LtGray"
+ height="2"
+ width="17"
+ image_name="Rounded_Square"
+ layout="topleft"
+ left_delta="0"
+ top_delta="69"
+ name="mark1"/>
+ <icon
+ color="LtGray"
+ height="2"
+ width="17"
+ image_name="Rounded_Square"
+ layout="topleft"
+ left_delta="0"
+ top_delta="69"
+ name="mark2"/>
+ <multi_slider
+ height="270"
+ follows="top|left"
+ orientation="vertical"
+ increment="25"
+ min_val="100"
+ max_val="4000"
+ thumb_image="Inv_SettingsSky"
+ thumb_width="17"
+ thumb_highlight_color="white"
+ decimal_digits="0"
+ draw_track="true"
+ overlap_threshold="100"
+ initial_value="0"
+ layout="topleft"
+ left="57"
+ max_sliders="3"
+ name="sld_altitudes"
+ show_text="false"
+ top="20"
+ use_triangle="false"
+ width="17">
+ <slider name="sld1"
+ value="1000"/>
+ <slider name="sld2"
+ value="2000"/>
+ <slider name="sld3"
+ value="3000"/>
+ </multi_slider>
+ <panel
+ follows="top|left"
+ height="21"
+ width="360"
+ layout="topleft"
+ visible="true"
+ left="1"
+ top_pad="10"
+ name="pnl_ground">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ height="12"
+ width="52"
+ left_delta="2"
+ top_pad="2"
+ halign="right"
+ name="txt_ground">
+ Ground
+ </text>
+ <icon
+ follows="top|left"
+ height="17"
+ width="17"
+ image_name="Inv_SettingsSky"
+ layout="topleft"
+ name="icon_ground"
+ mouse_opaque="false"
+ visible="true"
+ top_delta="-3"
+ left_pad="2"/>
+ <line_editor
+ follows="left|top"
+ enabled="false"
+ top_delta="-1"
+ left_pad="2"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_ground"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_ground"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as the ground level sky."
+ width="155" />
+ </panel>
+ <panel
+ follows="top|left"
+ height="21"
+ width="360"
+ layout="topleft"
+ visible="true"
+ left="1"
+ top_pad="10"
+ name="pnl_water">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ height="12"
+ width="52"
+ left_delta="2"
+ top_pad="2"
+ halign="right"
+ name="txt_water">
+ Water
+ </text>
+ <icon
+ follows="left|top"
+ height="17"
+ width="17"
+ image_name="Inv_SettingsWater"
+ layout="topleft"
+ name="icon_water"
+ mouse_opaque="false"
+ visible="true"
+ top_delta="-3"
+ left_pad="2"/>
+ <line_editor
+ follows="left|top"
+ enabled="false"
+ top_delta="-1"
+ left_pad="2"
+ height="20"
+ layout="topleft"
+ name="edt_invname_water"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_water"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
+ width="155" />
+ </panel>
+ <button
+ follows="top|right"
+ layout="topleft"
+ height="23"
+ width="100"
+ label="Reset"
+ right="-10"
+ top_pad="4"
+ tool_tip="Reset to default altitudes"
+ name="btn_rst_altitudes" />
+ </layout_panel>
</layout_stack>
</layout_panel>
<!--