Skip to content

Commit

Permalink
property editor readonly style
Browse files Browse the repository at this point in the history
  • Loading branch information
kleber-jg committed Aug 31, 2021
1 parent 8919525 commit 3fdd7e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
16 changes: 13 additions & 3 deletions TODO.todo
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ BASIC:
[ ] undo / redo
[ ] hide gizmos
[ ] toggle enabled
[ ] status bar

======================================================

Expand All @@ -72,9 +73,18 @@ ADVANCED:
[ ] custom property editors for PIXI/Phaser common types
[ ] Rectangle
[ ] Matrix
[ ] custom property editors for special fields
[ ] key
[ ] frame
[ ] color
[ ] enumerators
[ ] custom property editors for specific Phaser/PIXI types
[ ] PIXI.Sprite / Phaser.Sprite / Phaser.Image
[ ] key
[ ] frame
[ ] etc
[ ] Phaser.Graphics
[ ] fillAlpha
[ ] fillColor
[ ] etc
[ ] show them separated from the basic properties
[ ] optimization: shold I create a object pool for PropertyEditors?

Tree:
Expand Down
1 change: 1 addition & 0 deletions src/editor/properties-editors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class PropertiesEditorsClass {
{ name: 'anchor', typeHint: 'point', data: { step: 0.1 } },
{ name: 'alpha', typeHint: 'number', data: { min: 0, max: 1, step: 0.1 } },
{ name: 'visible', typeHint: 'boolean' },
{ name: 'angle', typeHint: 'number', data: { readonly: true } },
];

public findEditorFor(value: any, data: PropertyInspectionData) {
Expand Down
6 changes: 5 additions & 1 deletion src/editor/properties/editors/property-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $property-foreground: $on-background-color;
overflow: hidden;
display: inline-block;
width: 100%;
padding: 0 6px;
padding: 2px 6px;
}
}

Expand All @@ -43,6 +43,10 @@ $property-foreground: $on-background-color;
color: $property-foreground;
padding: 2px 4px;
transition: all 0.1s;

&[readonly] {
color: rgba($property-foreground, 0.5);
}
}

input[type='text'],
Expand Down

0 comments on commit 3fdd7e0

Please sign in to comment.