Skip to content

Commit

Permalink
#5565: Some tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 28, 2021
1 parent c87c44d commit da58afd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion install/ui/materialeditor.fbp
Expand Up @@ -15951,7 +15951,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Note: changes will be written to the file .....</property>
<property name="label"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
Expand Down
2 changes: 1 addition & 1 deletion install/ui/materialeditor.xrc
Expand Up @@ -2779,7 +2779,7 @@
<flag>wxALIGN_CENTER_VERTICAL</flag>
<border>5</border>
<object class="wxStaticText" name="MaterialEditorSaveNote">
<label>Note: changes will be written to the file .....</label>
<label></label>
<wrap>-1</wrap>
</object>
</object>
Expand Down
6 changes: 4 additions & 2 deletions radiant/ui/materials/editor/MaterialEditor.cpp
Expand Up @@ -1368,7 +1368,7 @@ void MaterialEditor::updateStageButtonSensitivity()
{
auto item = _stageView->GetSelection();

if (_material && item.IsOk())
if (_material && item.IsOk() && GlobalMaterialManager().materialCanBeModified(_material->getName()))
{
auto row = wxutil::TreeModel::Row(item, *_stageList);
auto index = row[STAGE_COLS().index].getInteger();
Expand All @@ -1380,6 +1380,7 @@ void MaterialEditor::updateStageButtonSensitivity()
getControl<wxButton>("MaterialEditorMoveUpStageButton")->Enable(!isGlobalStage && index > 0);
getControl<wxButton>("MaterialEditorMoveDownStageButton")->Enable(!isGlobalStage && index + 1 < layersCount);
getControl<wxButton>("MaterialEditorDuplicateStageButton")->Enable(!isGlobalStage);
getControl<wxButton>("MaterialEditorAddStageButton")->Enable();
}
else
{
Expand All @@ -1388,6 +1389,7 @@ void MaterialEditor::updateStageButtonSensitivity()
getControl<wxButton>("MaterialEditorMoveUpStageButton")->Disable();
getControl<wxButton>("MaterialEditorMoveDownStageButton")->Disable();
getControl<wxButton>("MaterialEditorDuplicateStageButton")->Disable();
getControl<wxButton>("MaterialEditorAddStageButton")->Disable();
}
}

Expand Down Expand Up @@ -1555,7 +1557,7 @@ void MaterialEditor::updateMaterialPropertiesFromMaterial()
getControl<wxPanel>("MaterialEditorStageSettingsPanel")->Enable(materialCanBeModified);

auto nameEntry = getControl<wxTextCtrl>("MaterialName");
nameEntry->Enable(_material != nullptr);
nameEntry->Enable(materialCanBeModified);
nameEntry->SetValue(_material ? _material->getName() : "");
updateMaterialNameControl();

Expand Down

0 comments on commit da58afd

Please sign in to comment.