From d042ad67ed4db72bf0265804e26610e565f15cf2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Nov 2022 19:46:13 +0200 Subject: SL-18448 Make material editor's scroll smarter --- indra/newview/llmaterialeditor.cpp | 16 +++++++++++++++- indra/newview/llmaterialeditor.h | 1 + .../default/xui/en/floater_live_material_editor.xml | 12 ++++++------ .../skins/default/xui/en/floater_material_editor.xml | 13 +++++++------ .../newview/skins/default/xui/en/panel_gltf_material.xml | 4 ++-- 5 files changed, 31 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 792a916e6b..cf627cf992 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -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 diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h index 0ffad5f54a..dc41cc386f 100644 --- a/indra/newview/llmaterialeditor.h +++ b/indra/newview/llmaterialeditor.h @@ -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); diff --git a/indra/newview/skins/default/xui/en/floater_live_material_editor.xml b/indra/newview/skins/default/xui/en/floater_live_material_editor.xml index 317783f794..7759bc2399 100644 --- a/indra/newview/skins/default/xui/en/floater_live_material_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_live_material_editor.xml @@ -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"> + width="236" /> diff --git a/indra/newview/skins/default/xui/en/floater_material_editor.xml b/indra/newview/skins/default/xui/en/floater_material_editor.xml index 29def9bd53..1a53d7832d 100644 --- a/indra/newview/skins/default/xui/en/floater_material_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_material_editor.xml @@ -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 @@ + width="236" /> + width="89">