Skip to content

Commit

Permalink
Fixed screen switching
Browse files Browse the repository at this point in the history
  • Loading branch information
NI committed Jul 29, 2020
1 parent 21fd0de commit 1c018ce
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
20 changes: 20 additions & 0 deletions ui/widgets/screen_console.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,28 @@
> .screen-console
> .console-console
> .console-loading {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
align-items: center;
}

#home-content
> .screen
> .screen-screen
> .screen-console
> .console-console
> .console-loading
> .console-loading-frame {
text-align: center;
font-size: 1em;
font-weight: lighter;
padding: 20px;
margin: 10px auto;
flex: auto;
}

#home-content
Expand All @@ -218,6 +237,7 @@
> .screen-console
> .console-console
> .console-loading
> .console-loading-frame
> .console-loading-icon {
background: url(./busy.svg) 50% no-repeat;
width: 100%;
Expand Down
19 changes: 11 additions & 8 deletions ui/widgets/screen_console.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
<h2 style="display: none;">Console</h2>

<div class="console-loading">
<div class="console-loading-icon"></div>
<div class="console-loading-message">
Initializing console ...
<div class="console-loading-frame">
<div class="console-loading-icon"></div>
<div class="console-loading-message">
Initializing console ...
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -457,8 +459,8 @@ export default {
};
},
watch: {
active() {
this.triggerActive();
active(newVal, oldVal) {
this.triggerActive(newVal);
},
change: {
handler() {
Expand Down Expand Up @@ -553,8 +555,8 @@ export default {
callbacks.warn(termTypeFaceLoadError, true);
});
},
triggerActive() {
this.active ? this.activate() : this.deactivate();
triggerActive(active) {
active ? this.activate() : this.deactivate();
},
async init() {
let self = this;
Expand Down Expand Up @@ -594,7 +596,7 @@ export default {
return;
}

self.triggerActive();
self.triggerActive(this.active);
self.runRunner();
},
async deinit() {
Expand All @@ -614,6 +616,7 @@ export default {
},
activate() {
this.term.focus();
this.fit();
},
async deactivate() {
this.term.blur();
Expand Down
4 changes: 4 additions & 0 deletions ui/widgets/screens.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
flex: auto;
}

#home-content > .screen.screen-inactive {
flex: 0 0 0;
}

#home-content > .screen > .screen-error {
display: block;
padding: 10px;
Expand Down
2 changes: 1 addition & 1 deletion ui/widgets/screens.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div
v-for="(screenInfo, idx) in screens"
:key="screenInfo.id"
:style="'visibility: ' + (screen === idx ? 'visible' : 'hidden')"
:class="{ 'screen-inactive': screen !== idx }"
class="screen"
>
<h1 style="display: none;">Main Interface</h1>
Expand Down

0 comments on commit 1c018ce

Please sign in to comment.