SL-18448 Make material editor's scroll smarter

meow-7.2.2
Andrey Kleshchev 2022-11-02 19:46:13 +02:00
parent 32cc9a71d0
commit d042ad67ed
5 changed files with 31 additions and 15 deletions

View File

@ -443,6 +443,20 @@ void LLMaterialEditor::onClose(bool app_quitting)
LLPreview::onClose(app_quitting);
}
void LLMaterialEditor::handleReshape(const LLRect& new_rect, bool by_user)
{
if (by_user)
{
const LLRect old_rect = getRect();
LLRect clamp_rect(new_rect);
clamp_rect.mRight = clamp_rect.mLeft + old_rect.getWidth();
LLPreview::handleReshape(clamp_rect, by_user);
}
else
{
LLPreview::handleReshape(new_rect, by_user);
}
}
LLUUID LLMaterialEditor::getBaseColorId()
{
@ -648,7 +662,7 @@ void LLMaterialEditor::resetUnsavedChanges()
void LLMaterialEditor::markChangesUnsaved(U32 dirty_flag)
{
mUnsavedChanges |= dirty_flag;
if (!mIsOverride)
if (mIsOverride)
{
// at the moment live editing (mIsOverride) applies everything 'live'
// and "unsaved_changes", save/cancel buttons don't exist there

View File

@ -167,6 +167,7 @@ public:
void onClickCloseBtn(bool app_quitting = false) override;
void onClose(bool app_quitting) override;
void handleReshape(const LLRect& new_rect, bool by_user = false) override;
LLUUID getBaseColorId();
void setBaseColorId(const LLUUID& id);

View File

@ -3,7 +3,7 @@
legacy_header_height="18"
can_resize="true"
default_tab_group="1"
height="786"
height="790"
width="256"
min_height="500"
min_width="256"
@ -14,10 +14,10 @@
title="Editing Material">
<scroll_container
name="materials_scroll"
top="14"
top="18"
left="4"
height="768"
width="247"
width="250"
follows="all"
layout="topleft"
color="DkGray2"
@ -26,12 +26,12 @@
<panel
name="panel_material"
filename="panel_gltf_material.xml"
border="false"
visible="true"
layout="topleft"
follows="left|top|right"
border="false"
top="0"
left="0"
height="768"
width="247" />
width="236" />
</scroll_container>
</floater>

View File

@ -3,7 +3,7 @@
legacy_header_height="18"
can_resize="true"
default_tab_group="1"
height="887"
height="891"
width="256"
min_height="500"
min_width="256"
@ -19,25 +19,26 @@
<scroll_container
name="materials_scroll"
top="14"
top="18"
left="4"
height="768"
width="247"
width="250"
follows="all"
layout="topleft"
color="DkGray2"
opaque="true"
border="false"
reserve_scroll_corner="false">
<panel
name="panel_material"
filename="panel_gltf_material.xml"
border="false"
visible="true"
layout="topleft"
follows="left|top|right"
border="false"
top="0"
left="0"
height="768"
width="247" />
width="236" />
</scroll_container>
<panel

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
layout="topleft"
follows="all"
follows="left|top|right"
border="false"
name="panel_gltf_material"
top="0"
@ -129,7 +129,7 @@
left_delta="0"
name="alpha mode"
top_pad="4"
width="96">
width="89">
<combo_box.item
label="Opaque"
name="None"