0.1.5 - added floating window support to store, added floating cheatsheet, few bugfixes

This commit is contained in:
Elvanos 2021-04-13 03:32:59 +02:00
parent 5bdee36e86
commit a309885308
16 changed files with 124 additions and 13 deletions

View file

@ -1,4 +1,5 @@
import { app, BrowserWindow, nativeTheme, Menu, MenuItem, shell } from 'electron'
app.commandLine.appendSwitch('disable-software-rasterizer', 'true')
try {
if (process.platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
@ -17,7 +18,6 @@ if (process.env.PROD) {
let mainWindow
function createWindow () {
app.commandLine.appendSwitch('disable-software-rasterizer', 'true')
/**
* Initial window options
*/

View file

@ -3,13 +3,15 @@
<appWindowButtons />
<router-view />
<q-window
v-model="visible"
v-model="advSearchWindowVisible"
no-resize
title="Advanced Search Cheatsheet"
:height="460"
:width="425"
:start-x="50"
:start-y="150"
:actions="['close']"
content-class="bg-gunmetal-light accent advSearchWindow"
content-class="bg-gunmetal-light text-accent advSearchWindow"
>
<div class="q-pa-md fit">
<q-markdown no-heading-anchor-links>
@ -38,7 +40,6 @@ import { summonAllPlusheForms } from "src/scripts/utilities/plusheMascot"
}
})
export default class App extends BaseClass {
visible = true
/****************************************************************/
// APP START & END SETUP
/****************************************************************/
@ -262,5 +263,12 @@ export default class App extends BaseClass {
* Hides the mascot... nooo :(
*/
hidePlushes = false
@Watch("SGET_getAdvSearchWindowVisible")
onAdvSearchWindowOpen () {
this.advSearchWindowVisible = true
}
advSearchWindowVisible = false
}
</script>

View file

@ -15,6 +15,7 @@ const OpenedDocuments = namespace("openedDocumentsModule")
const Keybinds = namespace("keybindsModule")
const Options = namespace("optionsModule")
const Dialogs = namespace("dialogsModule")
const FloatingWindows = namespace("floatingWindowsModule")
@Component
export default class BaseClass extends Vue {
@ -52,6 +53,13 @@ export default class BaseClass extends Vue {
return (input) ? input.replace(/<[^>]+>/g, "") : input
}
/****************************************************************/
// FLOATING WINDOWS
/****************************************************************/
@FloatingWindows.Getter("getAdvSearchWindowVisible") SGET_getAdvSearchWindowVisible!: string
@FloatingWindows.Mutation("setAdvSearchWindowVisible") SSET_setAdvSearchWindowVisible!: () => void
/****************************************************************/
// KEYBINDS MANAGEMENT
/****************************************************************/

View file

@ -35,6 +35,14 @@
@filter="filterExistingSelect"
@input="openExistingInput"
>
<template v-slot:append>
<q-btn round dense flat icon="mdi-help-rhombus" @click.stop.prevent="SSET_setAdvSearchWindowVisible"
>
<q-tooltip :delay="500">
Open search cheatsheet
</q-tooltip>
</q-btn>
</template>
<template v-slot:option="{ itemProps, itemEvents, opt }">
<q-item
:class="{'hasTextShadow': textShadow, 'isMinor':opt.isMinor}"

View file

@ -153,6 +153,14 @@
@filter="filterSelect"
@input="signalInput(false)"
>
<template v-slot:append>
<q-btn round dense flat icon="mdi-help-rhombus" @click.stop.prevent="SSET_setAdvSearchWindowVisible"
>
<q-tooltip :delay="500">
Open search cheatsheet
</q-tooltip>
</q-btn>
</template>
<template v-slot:selected-item="scope">
<q-chip
removable

View file

@ -148,6 +148,14 @@
@filter="filterSelect"
@input="signalInput(false)"
>
<template v-slot:append>
<q-btn round dense flat icon="mdi-help-rhombus" @click.stop.prevent="SSET_setAdvSearchWindowVisible"
>
<q-tooltip :delay="500">
Open search cheatsheet
</q-tooltip>
</q-btn>
</template>
<template v-slot:selected-item="scope">
<q-chip
v-if="scope.opt.label && scope.opt.label.length > 0"

View file

@ -32,10 +32,19 @@ html {
background-color: #fff;
}
html body {
&.q-body--prevent-scroll {
overflow-y: hidden;
position: relative !important;
padding-right: 5px;
}
}
body {
background-color: rgba($primary, 0.02);
overflow-y: scroll;
overflow-x: hidden;
top: 0 !important;
color: darken($dark, 12.5);
/* WebKit/Blink Browsers */
@ -115,6 +124,7 @@ a {
.q-window {
-webkit-app-region: no-drag;
border: none !important;
z-index: 99999 !important;
}
.advSearchWindow {
@ -347,6 +357,7 @@ a {
.q-position-engine {
overflow-y: auto !important;
-webkit-app-region: no-drag;
z-index: 999999;
}
.text-underline {

View file

@ -6,8 +6,8 @@
- `#` - Tag
- `>` - Hierarchical path
- `^` - Switch
- `^d` - `Is Dead/Gone/Destroyed`
- `^m` - `Is a minor document`
- `^d` - Is Dead/Gone/Destroyed
- `^m` - Is a minor document
- Full search
- `%` - Beginning of the full-search
- `:` - Division between the field-name and field value

View file

@ -92,7 +92,7 @@ export const exportProject = (projectName: string, Loading: any, loadingSetup: a
// @ts-ignore
await CurrentDB.dump(ws)
await CurrentDB.close()
await CurrentDB.close()
}
@ -162,7 +162,7 @@ export const importExistingProject = (vueRouter: any, Loading: any, loadingSetup
const fileContents = fs.readFileSync(`${folderPath}/${file}`, { encoding: "utf8" })
// @ts-ignore
await CurrentDB.loadIt(fileContents)
await CurrentDB.close()
await CurrentDB.close()
}

View file

@ -10,6 +10,7 @@ import openedDocumentsModule from "./module-openedDocuments"
import keybindsModule from "./module-keybinds"
import dialogsModule from "./module-dialogs"
import optionsModule from "./module-options"
import floatingWindowsModule from "./module-floatingWindows"
/*
* If not building with SSR mode, you can
@ -32,7 +33,8 @@ export default store(function ({ Vue }) {
openedDocumentsModule,
keybindsModule,
dialogsModule,
optionsModule
optionsModule,
floatingWindowsModule
// example
},

View file

@ -0,0 +1,9 @@
import { ActionTree } from "vuex"
import { StateInterface } from "../index"
import { FloatingWindowsStateInteface } from "./state"
const actions: ActionTree<FloatingWindowsStateInteface, StateInterface> = {
}
export default actions

View file

@ -0,0 +1,11 @@
import { GetterTree } from "vuex"
import { StateInterface } from "../index"
import { FloatingWindowsStateInteface } from "./state"
const getters: GetterTree<FloatingWindowsStateInteface, StateInterface> = {
getAdvSearchWindowVisible (context) {
return context.advSearchWindowVisible
}
}
export default getters

View file

@ -0,0 +1,16 @@
import { Module } from "vuex"
import { StateInterface } from "../index"
import state, { FloatingWindowsStateInteface } from "./state"
import actions from "./actions"
import getters from "./getters"
import mutations from "./mutations"
const keybindsModule: Module<FloatingWindowsStateInteface, StateInterface> = {
namespaced: true,
actions,
getters,
mutations,
state
}
export default keybindsModule

View file

@ -0,0 +1,12 @@
import { uid } from "quasar"
import { MutationTree } from "vuex"
import { FloatingWindowsStateInteface } from "./state"
const mutation: MutationTree<FloatingWindowsStateInteface> = {
setAdvSearchWindowVisible (state: FloatingWindowsStateInteface) {
state.advSearchWindowVisible = uid()
}
}
export default mutation

View file

@ -0,0 +1,12 @@
export interface FloatingWindowsStateInteface {
advSearchWindowVisible: string,
}
function state (): FloatingWindowsStateInteface {
return {
advSearchWindowVisible: ""
}
}
export default state

View file

@ -1,9 +1,5 @@
- Add advanced search cheat sheet to existing docs popup and in relationship searches in some way
- Switch field: Template (sigh... maybe???)
- Mass tag rename
- Add category for diseases/curses/etc
- Add category for Guilds/other groups
## THE GM BATCH
@ -29,6 +25,8 @@
- Add "Open all search matches" button in the Quick-search that opens a new page with a list of items
- Allow showing of document types under tags
- Add description tabs
- Add category for diseases/curses/etc
### Project settings