Skip to content

Commit 67efb49

Browse files
committed
testing new menus
1 parent 70e018f commit 67efb49

File tree

11 files changed

+76
-25
lines changed

11 files changed

+76
-25
lines changed

.github/workflows/build.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build/release
2+
3+
on: push
4+
5+
jobs:
6+
release:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
os: [macos-latest, ubuntu-latest, windows-latest]
12+
13+
steps:
14+
- name: Check out Git repository
15+
uses: actions/checkout@v1
16+
17+
- name: Install Node.js, NPM and Yarn
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 10
21+
22+
- name: Build/release Electron app
23+
uses: samuelmeuli/action-electron-builder@v1
24+
with:
25+
# GitHub token, automatically provided to the action
26+
# (No need to define this secret in the repo settings)
27+
github_token: ${{ secrets.github_token }}
28+
29+
# If the commit is tagged with a version (e.g. "v1.0.0"),
30+
# release the app after building
31+
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
32+
33+
# Maybe this works
34+
args: "--config electron-builder.config.js"

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ desktop-old/
1616
*.sublime-workspace
1717
.vscode
1818
reference-*
19+
20+
*.tgz

app.js

+21-4
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ const createWindow = (data = false, windowState = false) => {
6969
}
7070
})
7171

72-
// const menu = defaultMenu(app, shell)
73-
//
74-
// Menu.setApplicationMenu(Menu.buildFromTemplate(menu))
72+
// const menu = defaultMenu(app, shell)
73+
//
74+
// Menu.setApplicationMenu(Menu.buildFromTemplate(menu))
7575

7676
if (data?.pkg) {
7777
win.webContents.send("patchfox:event", { event: "package:go", data })
@@ -94,6 +94,8 @@ ipcMain.on("menu:set", (event, group) => {
9494
let newMenus = []
9595
let keys = Object.keys(group)
9696

97+
console.log(JSON.stringify(menu,null,2))
98+
9799
const makeSubmenu = (subgroup) => {
98100
let toPush = []
99101
subgroup.forEach((m) => {
@@ -140,6 +142,7 @@ ipcMain.on("menu:set", (event, group) => {
140142
},
141143
],
142144
}
145+
143146
let helpMenu = newMenus.pop()
144147

145148
menu.splice(1, 0, fileMenu)
@@ -149,7 +152,21 @@ ipcMain.on("menu:set", (event, group) => {
149152

150153
menu.push(helpMenu) // insert our own help menu.
151154

152-
Menu.setApplicationMenu(Menu.buildFromTemplate(menu))
155+
let patchfoxMenuIndex = menu.findIndex(e => e.label == "Application")
156+
157+
let patchfoxMenu = menu[patchfoxMenuIndex].submenu
158+
let appMenu = menu[0].submenu
159+
160+
appMenu.splice(1,0,{type: "separator"}, ...patchfoxMenu)
161+
162+
menu[0].submenu = appMenu
163+
menu.splice(patchfoxMenuIndex, 1)
164+
165+
console.log(JSON.stringify(menu,null,2))
166+
let finalMenu = Menu.buildFromTemplate(menu)
167+
168+
Menu.setApplicationMenu(finalMenu)
169+
153170
})
154171

155172
// This method will be called when Electron has finished

docs/packages/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ These are the packages that Patchfox is loading.
66
* [KoFiIntegration](/packages/KoFiIntegration/)
77
* [blog](/packages/blog/)
88
* [books](/packages/books/)
9-
* [contacts](/packages/contacts/)
109
* [errorHandler](/packages/errorHandler/)
1110
* [calendar](/packages/calendar/)
11+
* [contacts](/packages/contacts/)
1212
* [githubIntegration](/packages/githubIntegration/)
1313
* [globalMenu](/packages/globalMenu/)
1414
* [helpMenu](/packages/helpMenu/)
@@ -21,7 +21,7 @@ These are the packages that Patchfox is loading.
2121
* [pub](/packages/pub/)
2222
* [search](/packages/search/)
2323
* [settings](/packages/settings/)
24-
* [sourcehutIntegration](/packages/sourcehutIntegration/)
2524
* [system](/packages/system/)
25+
* [sourcehutIntegration](/packages/sourcehutIntegration/)
2626
* [vote](/packages/vote/)
2727
* [zine](/packages/zine/)

docs/release_notes/2022.6.1-alpha.md docs/release_notes/2022.7.1-alpha.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Release 2022.6.1-alpha
1+
# Release 2022.7.1-alpha
22

33
This is a complete rework of Patchfox. I've outlined the challenges and decisions regarding the future of Patchfox in [Patchfox reborn as a desktop app](https://andregarzia.com/2022/05/Patchfox-reborn-as-a-desktop-app.html).
44

electron-builder.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ module.exports = {
124124
publisherName: AUTHOR,
125125
},
126126

127-
nsis: {
128-
artifactName: "${name}-${version}-windows-${arch}-nsis-installer.${ext}",
129-
oneClick: false,
130-
perMachine: false,
131-
include: path.join(__dirname, "scripts", "installer.nsh"),
132-
},
127+
// nsis: {
128+
// artifactName: "${name}-${version}-windows-${arch}-nsis-installer.${ext}",
129+
// oneClick: false,
130+
// perMachine: false,
131+
// include: path.join(__dirname, "scripts", "installer.nsh"),
132+
// },
133133

134134
// Publish options -----------------------------------------------------------
135135
publish: {

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "patchfox",
3-
"version": "2022.6.1-alpha",
3+
"version": "2022.7.1-alpha",
44
"repository": {
55
"url": "https://github.com/soapdog/patchfox"
66
},
@@ -104,10 +104,11 @@
104104
"css": "npx tailwindcss -i ./ui/assets/css/patchfox.css -o ./ui/assets/css/tailwind.css",
105105
"pack": "electron-builder --config electron-builder.config.js --dir",
106106
"dist": "electron-builder --config electron-builder.config.js",
107-
"build:windows": "electron-builder build --config electron-builder.config.js --win",
108-
"build:linux": "electron-builder build --config electron-builder.config.js --linux",
109-
"build:mac": "electron-builder build --config electron-builder.config.js --mac",
110-
"build": "run-s css docs build:*",
111-
"docs": "node scripts/copy-package-docs.js"
107+
"builder:windows": "electron-builder build --config electron-builder.config.js --win",
108+
"builder:linux": "electron-builder build --config electron-builder.config.js --linux",
109+
"builder:mac": "electron-builder build --config electron-builder.config.js --mac",
110+
"build": "run-s css docs",
111+
"docs": "node scripts/copy-package-docs.js",
112+
"localbuild": "run-s build builder:*"
112113
}
113114
}

ui/assets/css/tailwind.css

-3
Original file line numberDiff line numberDiff line change
@@ -4163,9 +4163,6 @@ div img.is-image-from-blob {
41634163
}
41644164

41654165
@media (min-width: 1024px) {
4166-
.lg\:p-10 {
4167-
padding: 2.5rem;
4168-
}
41694166
}
41704167

41714168
@media (min-width: 1280px) {

ui/packages/launcher/launcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ patchfox.package({
77
system: true,
88
view: LauncherView,
99
menu: {
10-
group: "Patchfox",
10+
group: "Application",
1111
items: [
1212
{
1313
label: "Launcher",

ui/packages/settings/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ patchfox.package({
77
icon: "icon.svg",
88
view,
99
menu: {
10-
group: "Patchfox",
10+
group: "Application",
1111
label: "Settings",
1212
items: [
1313
{

ui/packages/system/system.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ patchfox.package({
1414
httpAuth: HttpAuth,
1515
menu: [
1616
{
17-
group: "Patchfox",
17+
group: "Application",
1818
label: "System",
1919
items: [
2020
{

0 commit comments

Comments
 (0)