Skip to content

Commit

Permalink
#659 fix show/hide components palette
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Dec 16, 2024
1 parent a972616 commit ca9bdd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
19 changes: 0 additions & 19 deletions packages/project-editor/project/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2040,25 +2040,6 @@ export class Project extends EezObject {
LayoutModels.PROPERTIES_TAB_ID,
settingsController.showComponentsPaletteInProjectEditor
);

// make sure Properties tab width is not 0
const propertiesNode = this._store.layoutModels.rootEditor.getNodeById(
LayoutModels.PROPERTIES_TAB_ID
);
if (propertiesNode) {
const rect = propertiesNode.getRect();
if (rect.width == 0) {
const parent = propertiesNode.getParent();
if (parent) {
this._store.layoutModels.rootEditor.doAction(
FlexLayout.Actions.updateNodeAttributes(
parent.getId(),
{ width: 420 }
)
);
}
}
}
}

get missingExtensions() {
Expand Down
8 changes: 3 additions & 5 deletions packages/project-editor/store/layout-models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ export class LayoutModels extends AbstractLayoutModels {
children: [
{
type: "row",
weight: 0,
width: 350,
weight: 15,
children: [
{
type: "tabset",
Expand Down Expand Up @@ -433,16 +432,15 @@ export class LayoutModels extends AbstractLayoutModels {
},
{
type: "tabset",
weight: 100,
weight: 65,
enableDeleteWhenEmpty: false,
enableClose: false,
id: LayoutModels.EDITOR_MODE_EDITORS_TABSET_ID,
children: []
},
{
type: "row",
weight: 0,
width: 420,
weight: 20,
children: [
{
type: "tabset",
Expand Down

0 comments on commit ca9bdd2

Please sign in to comment.