Skip to content

Commit

Permalink
Align styles
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr committed Sep 22, 2024
1 parent 3f25918 commit 26c50fc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Compile.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-btn block color="primary" append-icon="fa-solid fa-play" @click="dialog = true">Compile</v-btn>
<v-btn block color="primary" class="mt-2 mb-4" append-icon="fa-solid fa-play" @click="dialog = true">Compile</v-btn>
<v-dialog
v-model="dialog"
width="auto"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Debounce.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-slider :max="50" :min="0" :step="1" label="Value" v-model="value" hide-details>
<v-slider :max="50" :min="0" :step="1" class="pb-2" label="Value" v-model="value" hide-details>
<template v-slot:append>
<v-text-field
v-model="value"
Expand Down
20 changes: 19 additions & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
<v-container class="pa-4" fluid style="height:85vh">
<!-- Editor actions -->
<div class="d-flex">
<v-btn class="mb-4 mr-4" variant="tonal" append-icon="fa-solid fa-file-import" @click="importKeymap">Import</v-btn>
<v-btn-group class="mb-4 mr-4" variant="tonal" density="compact" divided>
<v-btn @click="importKeymap">
<v-icon>fa-solid fa-upload</v-icon>
</v-btn>
<v-btn readonly>keymap.json</v-btn>
<v-btn @click="exportKeymap">
<v-icon>fa-solid fa-download</v-icon>
</v-btn>
</v-btn-group>
<v-spacer/>
<v-btn class="mb-4 mr-4" variant="tonal" append-icon="fa-solid fa-indent" @click="formatCode">Format</v-btn>
</div>
Expand All @@ -26,6 +34,7 @@ import { ref, shallowRef, computed } from "vue";
import { useTheme } from "vuetify";
import { useTimeoutFn } from "@vueuse/core";
import { useKeymapState } from "@/composables/useKeymapState";
import { saveAs } from 'file-saver';
const theme = useTheme();
const { keymap } = useKeymapState();
Expand Down Expand Up @@ -98,5 +107,14 @@ const importKeymap = () => {
};
i.click();
};
const exportKeymap = () => {
const km_str = JSON.stringify(keymap.value, null, 4);
console.log(km_str)
var blob = new Blob([km_str], {type: "text/plain;charset=utf-8"});
saveAs(blob, 'keymap.json');
};
</script>

4 changes: 3 additions & 1 deletion src/plugins/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default createVuetify({
},
defaults: {
VMain: {
VSwitch: { color: 'primary', density: 'compact', class: 'pl-4' }
VSwitch: { color: 'primary', density: 'compact', class: 'pl-4' },
VSelect: { density: 'compact' },
VSlider: { density: 'compact' }
}
},
theme: {
Expand Down

0 comments on commit 26c50fc

Please sign in to comment.