Skip to content

Commit

Permalink
Merge pull request #165 from 2xAA/2.0-ui
Browse files Browse the repository at this point in the history
2.0 ui
  • Loading branch information
2xAA committed Jun 11, 2018
2 parents d9e92fd + 722d1e9 commit 9979088
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/assets/styles/controlPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
}

.message {
display: flex;
flex-direction: column;

background-color: transparent;
height: 100%;
overflow: hidden;
Expand Down
6 changes: 4 additions & 2 deletions src/components/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
};
</script>

<style scoped>
<style>
.module-list .column.is-3.sortable-chosen.sortable-ghost {
width: 100%;
}
</style>
47 changes: 42 additions & 5 deletions src/components/StatusBar.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
<template>
<div class="status-bar tags">
<span class="tag">{{ sizeOut }}</span>
<span class="tag" @dblclick="sizeModalOpen = true">{{ sizeOut }}</span>
<span class="tag">layers: {{ allLayers.length }}</span>
<span class="tag">modules: {{ nonGalleryModules }}</span>
<span class="tag">bpm: {{ bpm }} {{ detect ? '🤖' : '' }}</span>

<b-modal :active.sync="sizeModalOpen">
<div>
<b-input
type="number"
v-model.number="width"
/>
𝗑
<b-input
type="number"
v-model.number="height"
/>
<button class="button" @click="setWindowSize">Set window size</button>
</div>
</b-modal>
</div>
</template>

Expand All @@ -14,7 +29,9 @@
name: 'statusBar',
data() {
return {
sizeModalOpen: false,
width: 0,
height: 0,
};
},
computed: {
Expand All @@ -30,6 +47,7 @@
]),
...mapGetters('windows', [
'largestWindowSize',
'largestWindowReference',
]),
sizeOut() {
return `${this.largestWindowSize.width}𝗑${this.largestWindowSize.height}px`;
Expand All @@ -42,10 +60,29 @@
},
},
methods: {
setWindowSize() {
this.resizeWindow(this.largestWindowReference(), this.width, this.height);
},
resizeWindow(window, width, height) {
if (window.outerWidth) {
window.resizeTo(
width + (window.outerWidth - window.innerWidth),
height + (window.outerHeight - window.innerHeight),
);
} else {
window.resizeTo(500, 500);
window.resizeTo(
width + (500 - document.body.offsetWidth),
height + (500 - document.body.offsetHeight),
);
}
},
},
components: {
watch: {
largestWindowSize(value) {
this.width = value.width;
this.height = value.height;
},
},
};
</script>
Expand Down

0 comments on commit 9979088

Please sign in to comment.