Skip to content

Commit d08871e

Browse files
authored
2.2.2 Style Adjustments
- Changed Button Styles - Added title to the native window - Moved keybindings to an external file - Improved language chooser
2 parents 7c512eb + 24d1ce6 commit d08871e

15 files changed

Lines changed: 165 additions & 3331 deletions

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
<header>
2424
<span id="document-name">new document</span>
2525
<div id="window-buttons">
26-
<a id="pin-button"></a>
27-
<a id="min-button"></a>
28-
<a id="max-button"></a>
29-
<a id="close-button"></a>
26+
<button id="pin-button"></button>
27+
<button id="min-button"></button>
28+
<button id="max-button"></button>
29+
<button id="close-button"></button>
3030
</div>
3131
</header>
3232
<div id="content">

main.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,42 +101,31 @@ function checkLatestVersion() {
101101
});
102102
}
103103

104-
function doUpdate() {
105-
const root = path.dirname(process.execPath);
106-
let command = `${root}/${appInfo.version}/updater${getExeExtension(appInfo.os)}`;
107-
108-
if (process.platform !== 'win32') {
109-
command = `chmod +x ./${appInfo.version}/updater${getExeExtension(appInfo.os)} && ${command}`;
110-
}
111-
const child = require('child_process').spawn(command, [], { detached: true, shell: true });
112-
child.unref();
113-
}
114-
115104
function createWindow(caller = undefined, filePaths = []) {
116105
filePathsToOpen = filePaths;
117106
let { x, y, width, height, maximized } = localStore.get('window_config');
118107
let { native_frame } = userPrefStore.get('window_config');
119108

120109
// Force custom frame to remove traficlights
121-
if(process.platform === 'darwin'){
110+
if (process.platform === 'darwin') {
122111
native_frame = false;
123112
}
124113

125114
let windowConfig = {}
126-
if(native_frame){
115+
if (native_frame) {
127116
windowConfig = {
128117
frame: false,
129118
hasShadow: true,
130119
backgroundColor: '#212121',
131120
}
132-
}else{
121+
} else {
133122
windowConfig = {
134123
frame: false,
135124
transparent: true,
136125
backgroundColor: '#00000000'
137126
}
138127
}
139-
128+
140129

141130
if (caller) {
142131
x = caller.getPosition()[0] + 30;
@@ -236,6 +225,13 @@ ipcMain.on('toggle-max-unmax', (event) => {
236225
win.unmaximize();
237226
}
238227
});
228+
229+
ipcMain.on('set-title', (event, title) => {
230+
const win = BrowserWindow.fromWebContents(event.sender);
231+
win.setTitle(title);
232+
});
233+
234+
239235
ipcMain.handle('toggle-pin', (event) => {
240236
const win = BrowserWindow.fromWebContents(event.sender);
241237
const pinned = win.isAlwaysOnTop();

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.js

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@ async function main() {
2626
process.stdout.write('1. Packaging main executable...');
2727
let dir = await packager(packageOptions);
2828
dir = dir[0];
29-
/*
30-
console.log(`Electron app bundles created:\n${dir}`)
31-
fs.readdirSync(dir).forEach(file => {
32-
err = false;
33-
try{
34-
fs.accessSync(file, fs.constants.X_OK);
35-
}
36-
catch(e){
37-
err = true;
38-
}
39-
console.log(`${file} ${err ? '' : '\tx'}`);
40-
});
41-
*/
4229
process.stdout.write('\t\tOK\n');
4330

4431

@@ -51,32 +38,6 @@ async function main() {
5138
process.stdout.write('\t\tOK\n');
5239
}
5340

54-
process.stdout.write('2. Installing NPM for updater...');
55-
execSync('npm install', {
56-
cwd: './updater',
57-
});
58-
process.stdout.write('\tOK\n');
59-
60-
process.stdout.write('3. Packaging updater...');
61-
execSync('npm run package', {
62-
cwd: './updater',
63-
});
64-
process.stdout.write('\t\t\tOK\n');
65-
66-
if (process.platform === 'linux' || process.platform === 'darwin') {
67-
process.stdout.write('3.1. chmod-ing updater...');
68-
execSync(`chmod +x updater`, {
69-
cwd: './updater',
70-
});
71-
process.stdout.write('\t\tOK\n');
72-
}
73-
74-
process.stdout.write('4. Copying updater...');
75-
const updater = fs.readdirSync('./updater/').filter((fn) => fn.startsWith('updater'));
76-
fs.mkdirSync(`${dir}/${pjson.version}`);
77-
fs.copyFileSync(`./updater/${updater[0]}`, `${dir}/${pjson.version}/${updater[0]}`);
78-
process.stdout.write('\t\t\tOK\n');
79-
8041
console.log('------ FINISHED PACKAGING ------');
8142
}
8243

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monolith-code",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "minimalistic coder editor",
55
"homepage": "https://haeri.github.io/MonolithCode2/",
66
"main": "main.js",

res/img/texture.png

-135 KB
Binary file not shown.

res/keybindings.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"ctrl": {
3+
"o": {
4+
"description": "Open a file",
5+
"func": "openFile"
6+
},
7+
"b": {
8+
"description": "Build and run the current file",
9+
"func": "buildRunFile"
10+
},
11+
"s": {
12+
"description": "Save the current file",
13+
"func": "saveFile"
14+
},
15+
"n": {
16+
"description": "Open a new editor window",
17+
"func": "newWindow"
18+
},
19+
"i": {
20+
"description": "Open settings",
21+
"func": "openSettings"
22+
},
23+
"p": {
24+
"description": "Export the preview window as PDF",
25+
"func": "exportPDFFromPreview"
26+
},
27+
"t": {
28+
"description": "Open a hello world tamplate for the current language",
29+
"func": "makeLanguageTemplate"
30+
},
31+
"m": {
32+
"description": "Evaluate a mathematical equation on the selected line",
33+
"func": "evaluateMathInline"
34+
}
35+
},
36+
"ctrlshift": {
37+
"b": {
38+
"description": "Beautify the document",
39+
"func": "beautifyDocument"
40+
},
41+
"s": {
42+
"description": "Save the current document as new file",
43+
"func": "saveFileAs"
44+
}
45+
}
46+
}

res/style/bars.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
21
::-webkit-scrollbar {
32
width: 6px;
43
}
4+
55
::-webkit-scrollbar {
66
height: 6px;
77
}
8+
89
::-webkit-scrollbar-track,
910
::-webkit-scrollbar-track {
1011
background: transparent;
1112
}
13+
1214
::-webkit-scrollbar-thumb,
1315
::-webkit-scrollbar-thumb {
1416
background: #555;
1517
border-radius: 3px;
1618
transition: 0.3s;
1719
}
20+
1821
::-webkit-scrollbar-thumb:hover,
1922
::-webkit-scrollbar-thumb:hover {
2023
background: #888;
2124
}
22-
::-webkit-scrollbar-corner{
23-
background: transparent;
25+
26+
::-webkit-scrollbar-corner {
27+
background: transparent;
2428
}

0 commit comments

Comments
 (0)