Skip to content

Commit

Permalink
feat: drawer pane (files, git, tools, snippets) + app icon
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Feb 13, 2024
1 parent 62da923 commit 94ec21f
Show file tree
Hide file tree
Showing 45 changed files with 121 additions and 36 deletions.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file modified public/icons/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/apple-icon-167x167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1080x2340.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1125x2436.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1170x2532.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1179x2556.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1242x2208.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1242x2688.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1284x2778.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1290x2796.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1536x2048.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1620x2160.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1668x2224.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-1668x2388.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-2048x2732.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-750x1334.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-launch-828x1792.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/favicon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/icon-256x256.png
Binary file modified public/icons/icon-384x384.png
Binary file modified public/icons/icon-512x512.png
Binary file modified public/icons/ms-icon-144x144.png
2 changes: 1 addition & 1 deletion public/icons/safari-pinned-tab.svg

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src-electron/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function createWindow () {
icon: path.resolve(__dirname, 'icons/icon.png'), // tray icon
width: Math.round(width * 0.9),
height: Math.round(height * 0.9),
minWidth: 1400,
minHeight: 600,
// useContentSize: true,
center: true,
frame: true,
Expand Down
Binary file modified src-electron/icons/icon.icns
Binary file not shown.
Binary file modified src-electron/icons/icon.ico
Binary file not shown.
Binary file modified src-electron/icons/icon.png
Binary file added src/assets/draftforge-logo.png
4 changes: 4 additions & 0 deletions src/components/DrawerFiles.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template lang="pug">
q-list(padding)
q-item-label.text-caption.text-light-blue-3(header): strong Files
</template>
4 changes: 4 additions & 0 deletions src/components/DrawerGit.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template lang="pug">
q-list(padding)
q-item-label.text-caption.text-light-blue-3(header): strong Git
</template>
35 changes: 35 additions & 0 deletions src/components/DrawerPane.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template lang="pug">
q-drawer.bg-dark-4(
:model-value='state.drawerShown'
show-if-above
persistent
:width='350'
)
q-scroll-area.fit(
:horizontal-thumb-style='{ opacity: 0 }'
)
component(:is='panes[editorStore.drawerPane]')
</template>

<script setup>
import { reactive } from 'vue'
import { useEditorStore } from 'src/stores/editor'
import DrawerFiles from 'src/components/DrawerFiles.vue'
import DrawerGit from 'src/components/DrawerGit.vue'
import DrawerTools from 'src/components/DrawerTools.vue'
import DrawerSnippets from 'src/components/DrawerSnippets.vue'
const editorStore = useEditorStore()
const panes = {
DrawerFiles,
DrawerGit,
DrawerTools,
DrawerSnippets
}
const state = reactive({
drawerShown: true
})
</script>
4 changes: 4 additions & 0 deletions src/components/DrawerSnippets.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template lang="pug">
q-list(padding)
q-item-label.text-caption.text-light-blue-3(header): strong Snippets Library
</template>
16 changes: 16 additions & 0 deletions src/components/DrawerTools.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template lang="pug">
q-list(padding)
q-item-label.text-caption.text-light-blue-3(header): strong Tools
q-item(clickable @click='reindent')
q-item-section(side)
q-icon(name='mdi-page-previous-outline' size='xs' color='light-blue-4')
q-item-section
q-item-label Reindent
q-item-label.text-light-blue-3(caption) Reformat Document Indentation
</template>

<script setup>
function reindent () {
EVENT_BUS.emit('editorCommand', 'editor.action.reindentlines')
}
</script>
49 changes: 48 additions & 1 deletion src/components/MainToolbar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<template lang="pug">
q-bar.toolbar-main
.toolbar-drawer
q-btn-group(
unelevated
stretch
v-for='pane of drawerPanes'
:key='pane.key'
)
q-btn(
:icon='pane.icon'
:color='pane.key === editorStore.drawerPane ? `light-blue-7` : `light-blue-9`'
:text-color='pane.key === editorStore.drawerPane ? `white` : `light-blue-3`'
no-caps
unelevated
@click='editorStore.drawerPane = pane.key'
)
.toolbar-docs
q-btn-group(
unelevated
Expand Down Expand Up @@ -43,10 +58,34 @@ import { defineAsyncComponent } from 'vue'
import { useQuasar } from 'quasar'
import { useDocsStore } from 'src/stores/docs'
import { useEditorStore } from 'src/stores/editor'
const docsStore = useDocsStore()
const editorStore = useEditorStore()
const $q = useQuasar()
const drawerPanes = [
{
key: 'DrawerFiles',
icon: 'mdi-folder-file'
},
{
key: 'DrawerGit',
icon: 'mdi-git'
},
{
key: 'DrawerTools',
icon: 'mdi-tools'
},
{
key: 'DrawerSnippets',
icon: 'mdi-library-shelves'
}
]
// METHODS
function closeDocument (doc) {
if (doc.isModified) {
$q.dialog({
Expand Down Expand Up @@ -85,11 +124,19 @@ function newDocument () {
background: radial-gradient(ellipse at bottom, $light-blue-9, darken($light-blue-10, 5%));
border-bottom: 1px solid $light-blue-5;
}
.toolbar-drawer {
width: 330px;
padding-top: 7px;
height: 32px;
.q-btn {
margin-right: 1px;
}
}
.toolbar-docs {
height: 32px;
padding-top: 7px;
display: flex;
padding-left: 48px;
.q-btn-group {
margin-right: 8px;
Expand Down
35 changes: 2 additions & 33 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,14 @@
q-layout(view='hHh lpr fFf')
q-header
main-toolbar
//- q-drawer.bg-dark-4(
//- :model-value='true'
//- show-if-above
//- :mini='state.miniState'
//- @mouseover='state.miniState = false'
//- @mouseout='state.miniState = true'
//- mini-to-overlay
//- persistent
//- )
//- q-scroll-area.fit(
//- :horizontal-thumb-style='{ opacity: 0 }'
//- )
//- q-list(padding)
//- q-item(clickable)
//- q-item-section(side)
//- q-icon(name='mdi-library-shelves' size='xs' color='light-blue-4')
//- q-item-section
//- q-item-label Library
//- q-item-label.text-light-blue-3(caption) Quick Insert Code Snippets
//- q-separator(inset)
//- q-item(clickable)
//- q-item-section(side)
//- q-icon(name='mdi-page-previous-outline' size='xs' color='light-blue-4')
//- q-item-section
//- q-item-label Reindent
//- q-item-label.text-light-blue-3(caption) Reformat Document Indentation
drawer-pane
footer-toolbar
q-page-container
router-view
</template>

<script setup>
// import { reactive } from 'vue'
import DrawerPane from 'src/components/DrawerPane.vue'
import MainToolbar from 'components/MainToolbar.vue'
import FooterToolbar from 'components/FooterToolbar.vue'
/* eslint-disable space-before-function-paren */
// const state = reactive({
// miniState: true
// })
</script>
3 changes: 3 additions & 0 deletions src/pages/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ onMounted(async () => {
}
})
})
EVENT_BUS.on('editorCommand', cmd => {
editor.trigger('drawer', cmd)
})
async function validateContent () {
const enc = new TextEncoder()
Expand Down
3 changes: 2 additions & 1 deletion src/stores/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const useEditorStore = defineStore('editor', {
line: 1,
col: 1,
tabSize: 2,
previewPaneShown: true
previewPaneShown: true,
drawerPane: 'DrawerGit'
}),
getters: {
hasErrors: (state) => state.errors?.length > 0
Expand Down

0 comments on commit 94ec21f

Please sign in to comment.