mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-18 20:50:48 +01:00
refactor: minor improvements
This commit is contained in:
parent
e42c424a13
commit
822af44a47
@ -94,7 +94,7 @@ else {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('change-window-title', (event, title: string) => {
|
ipcMain.on('change-window-title', (_, title: string) => {
|
||||||
if (mainWindow) mainWindow.setTitle(title);
|
if (mainWindow) mainWindow.setTitle(title);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -377,7 +377,6 @@ export default defineComponent({
|
|||||||
// fix position when the component is created and opened at the same time
|
// fix position when the component is created and opened at the same time
|
||||||
if (isOpen.value) {
|
if (isOpen.value) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
deactivate();
|
|
||||||
adjustListPosition();
|
adjustListPosition();
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
|||||||
|
|
||||||
const { getWorkspace } = workspacesStore;
|
const { getWorkspace } = workspacesStore;
|
||||||
|
|
||||||
const { trapRef } = useFocusTrap();
|
const { trapRef } = useFocusTrap({ disableAutofocus: true });
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const localRow: Ref<{[key: string]: any}> = ref({});
|
const localRow: Ref<{[key: string]: any}> = ref({});
|
||||||
@ -274,6 +274,14 @@ const wrapNumber = (num: number) => {
|
|||||||
window.addEventListener('keydown', onKey);
|
window.addEventListener('keydown', onKey);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
const inputs = Array.from(document.querySelectorAll<HTMLInputElement>('.modal-container .form-input'));
|
||||||
|
if (inputs?.length) {
|
||||||
|
const firstEnabledInput = inputs.find((el) => !el.disabled);
|
||||||
|
firstEnabledInput?.focus();
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
|
||||||
const rowObj: {[key: string]: unknown} = {};
|
const rowObj: {[key: string]: unknown} = {};
|
||||||
|
|
||||||
for (const field of props.fields) {
|
for (const field of props.fields) {
|
||||||
|
@ -36,12 +36,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onUnmounted, ref } from 'vue';
|
import { computed, onUnmounted, ref, watch } from 'vue';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { getCurrentWindow } from '@electron/remote';
|
import { getCurrentWindow } from '@electron/remote';
|
||||||
import { useConnectionsStore } from '@/stores/connections';
|
import { useConnectionsStore } from '@/stores/connections';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@ -90,6 +91,10 @@ const onResize = () => {
|
|||||||
isMaximized.value = w.value.isMaximized();
|
isMaximized.value = w.value.isMaximized();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(windowTitle, (val) => {
|
||||||
|
ipcRenderer.send('change-window-title', val);
|
||||||
|
});
|
||||||
|
|
||||||
window.addEventListener('resize', onResize);
|
window.addEventListener('resize', onResize);
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user