Skip to content

Commit 23c1ee2

Browse files
committed
Extract ObjectInspector toggle into component
- use SVG instead of CSS transforms to create the icon - use layout service
1 parent 4ed4da7 commit 23c1ee2

File tree

5 files changed

+26
-17
lines changed

5 files changed

+26
-17
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<button
2+
class="object-inspector-toggle toolbar-icon-button"
3+
type="button"
4+
title="{{if this.layout.inspectorExpanded "hide" "show"}} object inspector"
5+
...attributes
6+
{{on "click" this.layout.toggleInspector}}
7+
>
8+
{{svg-jar "sidebar-toggle-trailing" width="16" height="16"}}
9+
</button>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Component from '@glimmer/component';
2+
import { inject as service } from '@ember/service';
3+
4+
export default class PropertiesGrouped extends Component {
5+
@service layout;
6+
}
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
.object-inspector-toggle.toolbar-icon-button {
2-
margin-right: 0; // .toolbar-icon-button override
32
max-height: var(--toolbar-height);
4-
padding-right: 6px; // .toolbar-icon-button override
5-
padding-left: 6px; // .toolbar-icon-button override
6-
transform: scaleX(-1);
7-
8-
// use .toolbar-icon-button active style AND flip horizontally
9-
&:active {
10-
transform: translate(1px, 1px) scaleX(-1);
11-
}
3+
padding-inline: 6px; // .toolbar-icon-button override
124
}

app/templates/application.hbs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,7 @@
4747
<div class="split-panel">
4848
<div class="split-panel-hd">
4949
<div id="toolbar"></div>
50-
<button
51-
class="object-inspector-toggle toolbar-icon-button absolute top-0 right-0"
52-
{{on "click" this.layoutService.toggleInspector}}
53-
type="button"
54-
title="{{if this.layoutService.inspectorExpanded "hide" "show"}} object inspector"
55-
>
56-
{{svg-jar "sidebar-toggle" width="16" height="16"}}
57-
</button>
50+
<ObjectInspector::Toggle class="align-end" />
5851
</div>
5952

6053
<div class="split-panel-bd" {{did-insert this.setupContentElement}}>
Lines changed: 9 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)