2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

build(win): fix webkit-app-region issue

- set multiple icon sizes
- set icon if linux
This commit is contained in:
18alantom 2021-12-07 18:40:06 +05:30
parent b7b9197024
commit c1c66bdd60
12 changed files with 40 additions and 18 deletions

BIN
build/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
build/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

BIN
build/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
build/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

BIN
build/icons/48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
build/icons/512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
build/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -29,12 +29,11 @@ nsis:
publish:
- github
linux:
icon: build/icon.icns
icon: build/icons
category: Finance
publish:
- github
target:
- snap
- deb
- AppImage
- rpm

View File

@ -21,7 +21,9 @@ const isDevelopment = process.env.NODE_ENV !== 'production';
const isMac = process.platform === 'darwin';
const isLinux = process.platform === 'linux';
const title = 'Frappe Books';
const icon = path.resolve('./build/icon.png');
const icon = isDevelopment
? path.resolve('./build/icon.png')
: path.join(__dirname, 'icons', '512x512.png');
// Global ref to prevent garbage collection.
let mainWindow;
@ -69,10 +71,16 @@ function createWindow() {
resizable: true,
};
if (isDevelopment) {
if (isDevelopment || isLinux) {
Object.assign(options, { icon });
}
if (isLinux) {
Object.assign(options, {
icon: path.join(__dirname, '/icons/512x512.png'),
});
}
mainWindow = new BrowserWindow(options);
if (process.env.WEBPACK_DEV_SERVER_URL) {
@ -171,7 +179,7 @@ ipcMain.handle(IPC_ACTIONS.GET_PRIMARY_DISPLAY_SIZE, (event) => {
ipcMain.handle(IPC_ACTIONS.GET_DIALOG_RESPONSE, async (event, options) => {
const window = event.sender.getOwnerBrowserWindow();
if (isDevelopment) {
if (isDevelopment || isLinux) {
Object.assign(options, { icon });
}
return await dialog.showMessageBox(window, options);

View File

@ -6,12 +6,14 @@
px-2
h-full
block
window-drag
flex
justify-between
flex-col
bg-gray-100
"
:class="{
'window-drag': platform !== 'Windows',
}"
>
<div class="window-no-drag">
<WindowControls v-if="platform === 'Mac'" class="px-3 mb-6" />
@ -70,7 +72,7 @@
</div>
</div>
</div>
<div class="px-5">
<div class="px-5 window-no-drag">
<button
class="pb-1 text-sm text-gray-600 hover:text-gray-800 truncate"
@click="$emit('change-db-file')"
@ -111,9 +113,12 @@ export default {
},
async mounted() {
this.companyName = await sidebarConfig.getTitle();
this.groups = sidebarConfig.groups.filter(group=>{
if(group.route === '/get-started' && frappe.SystemSettings.hideGetStarted) {
return false
this.groups = sidebarConfig.groups.filter((group) => {
if (
group.route === '/get-started' &&
frappe.SystemSettings.hideGetStarted
) {
return false;
}
return true;
});

View File

@ -1,7 +1,10 @@
<template>
<div
class="py-10 flex-1 bg-white window-drag"
:class="{ 'pointer-events-none': loadingDatabase }"
class="py-10 flex-1 bg-white"
:class="{
'pointer-events-none': loadingDatabase,
'window-drag': platform !== 'Windows',
}"
>
<div class="w-full">
<div class="px-12">
@ -189,11 +192,13 @@ export default {
},
async existingDatabase() {
this.fileSelectedFrom = 'Existing File';
const filePath = (await ipcRenderer.invoke(IPC_ACTIONS.GET_OPEN_FILEPATH, {
title: this._('Select file'),
properties: ['openFile'],
filters: [{ name: 'SQLite DB File', extensions: ['db'] }],
}))?.filePaths?.[0];
const filePath = (
await ipcRenderer.invoke(IPC_ACTIONS.GET_OPEN_FILEPATH, {
title: this._('Select file'),
properties: ['openFile'],
filters: [{ name: 'SQLite DB File', extensions: ['db'] }],
})
)?.filePaths?.[0];
this.connectToDatabase(filePath);
},
async selectFile(file) {

View File

@ -1,5 +1,10 @@
<template>
<div class="flex-1 py-10 bg-white window-drag">
<div
class="flex-1 py-10 bg-white"
:class="{
'window-drag': platform !== 'Windows',
}"
>
<div class="px-12">
<h1 class="text-2xl font-semibold">{{ _('Setup your organization') }}</h1>
</div>