Skip to content

Commit c7e14b5

Browse files
authored
Merge pull request #34 from evolus/development
Beta 2 - Development
2 parents 183891c + 242de5f commit c7e14b5

File tree

165 files changed

+4611
-2520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+4611
-2520
lines changed

.travis.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dist: trusty
66

77
env:
88
global:
9-
- NODE_VERSION=5
9+
- NODE_VERSION=6
1010
- USE_SYSTEM_FPM=true
1111
- secure: E0ghqUHn8cFewr+wYJgnLSpn/e+3RPhnoLNAYMuhpGhPtpVgmlTqb7oqHHLVOjQtfDEp495tMolYeaJZaqGAC4RnEPtn664wrgoEI+FLegNV3SJx+oFF53LmT3zZnwVhbF6J3ZwF8QLYPKad5PcCqVo8SMvMMyWD5m6TzJFJ+1caNi6wJrKkQBqHtCkKOkazp0ZXwpl1SVQl24bofCZfGn7zbmRJ0+VXvfeg1GqkF1GFqkDKc2SkGQn9VUH1d2ejahWxV3dH+VPuyqUuTlPIrv7TjUU4OH9hr3mjQPtWMOnvK0BzOQKu2B9tpAUHbuT5z74TSc7TYQjDA0zQG02h1ALll0Fm+9UOYJQZMidNNiawCDXx1a0Fu+SLWNK9KX/R3FD2ip4wVKKjl/DyTy5Nnw/BsWX4UkYijW3IuegV7a0UokISD6OJqLeo+gmmNon2ngxum+Av1veB/z9c/zZanQwx+CumeqAD7eHCbxZv+bwMAFfsoC6Bv6CtTlU+uBeu7wSUyMxVzaW8qF+MbeMboG3ht12+K6Xxdp+C26eGbkQr7YlITumy5glhd4jlCAxI+DT1uZAWPnIfdOtRWUPd78ABy9G3y98ppnlqCNPbxShI3Tgtp8mTDEpM0znVnZOXcQFzrEX7r2IsGmnIuoUf77lmdpuDTYPq6KAbAOtkjCE=
1212

@@ -15,8 +15,8 @@ language: c
1515
matrix:
1616
include:
1717
- os: linux
18-
env: CC=clang CXX=clang++ npm_config_clang=1
19-
compiler: clang
18+
#env: CC=clang CXX=clang++ npm_config_clang=1
19+
#compiler: clang
2020
- os: osx
2121

2222
cache:
@@ -31,11 +31,11 @@ addons:
3131
apt:
3232
sources:
3333
- ubuntu-toolchain-r-test
34-
- llvm-toolchain-precise-3.7
34+
#- llvm-toolchain-precise-3.7
3535
packages:
3636
- libgnome-keyring-dev
3737
- icnsutils
38-
- clang-3.7
38+
#- clang-3.7
3939
- graphicsmagick
4040
- xz-utils
4141
- rpm
@@ -48,14 +48,12 @@ before_install:
4848
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git-lfs-1.2.0/git-lfs pull; fi
4949
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y ruby-dev gcc make; fi
5050
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gem install --no-ri --no-rdoc fpm; fi
51-
# https://github.com/electron-userland/electron-builder/issues/398
52-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then security import "certs/sca.code2.crt" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign; fi
5351

5452
install:
5553
- nvm install $NODE_VERSION
5654
- npm install npm -g
5755
- npm install
58-
- npm install git+https://github.com/mbrainiac/electron-builder.git#v3.26.1.2
56+
- npm install electron-builder@4.2.6
5957
- npm prune
6058

6159
script:

ISSUE_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
* Operating system:
3+
* Pencil version:

app/app.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
const clipboard = require("electron").clipboard;
1+
const {clipboard, remote, nativeImage, shell, ipcRenderer, webFrame} = require("electron");
2+
3+
const _ = require("lodash");
4+
const rimraf = require("rimraf");
5+
const QP = require("q");
6+
27
const tmp = require("tmp");
38
const path = require("path");
49
const moment = require("moment");
510
const fs = require("fs");
611
const os = require("os");
712
const unzip = require("unzip2");
8-
const dialog = require("electron").remote.dialog;
9-
const nativeImage = require('electron').nativeImage;
1013
const pkgInfo = require("./package.json");
1114
const fontManager = require("./lib/loader").fontManager;
12-
const ipcRenderer = require('electron').ipcRenderer;
1315
const QueueHandler = require("./pencil-core/common/QueueHandler");
14-
const shell = require('electron').shell;
1516
const sharedUtil = require("./pencil-core/common/shared-util");
16-
const _ = require("lodash");
17-
const rimraf = require("rimraf");
18-
const QP = require("q");
1917

18+
const dialog = remote.dialog;
2019

2120
tmp.setGracefulCleanup();
2221

23-
var webFrame = require("electron").webFrame;
2422
webFrame.registerURLSchemeAsPrivileged("file");
2523
webFrame.registerURLSchemeAsSecure("file");
2624
webFrame.registerURLSchemeAsBypassingCSP("file");

app/css/theme.css

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ button {
3030
display: inline-flex;
3131
align-items: center;
3232
}
33+
button:focus {
34+
outline: dotted 1px rgba(0, 0, 0, 0.3);
35+
outline-offset: -0.3em;
36+
}
3337
button[disabled] {
3438
background: rgba(255, 255, 255, 0.2);
3539
cursor: default;
@@ -54,9 +58,16 @@ button > i {
5458
-webkit-font-smoothing: subpixel-antialiased;
5559
opacity: 0.7;
5660
}
57-
button > i[rotated="true"] {
61+
button > i[rotated="true"],
62+
button > i[rotated="right"] {
5863
transform: rotate(90deg);
5964
}
65+
button > i[rotated="left"] {
66+
transform: rotate(-90deg);
67+
}
68+
button > i[flipped="true"] {
69+
transform: rotate(180deg);
70+
}
6071
button > * {
6172
vertical-align: middle;
6273
}
@@ -73,43 +84,48 @@ button[mode='icon'] {
7384
hbox.ButtonGroup > button {
7485
box-shadow: none !important;
7586
}
76-
hbox.ButtonGroup > button:first-child,
77-
hbox.ButtonGroup > button + button {
87+
hbox.ButtonGroup > *:first-child:not(:last-child),
88+
hbox.ButtonGroup > * + input[type]:not(:last-child),
89+
hbox.ButtonGroup > * + *:not(:last-child) {
7890
border-top-right-radius: 0px;
7991
border-bottom-right-radius: 0px;
8092
border-right-width: 0px;
8193
}
82-
hbox.ButtonGroup > button:first-child > i,
83-
hbox.ButtonGroup > button + button > i {
94+
hbox.ButtonGroup > *:first-child > i,
95+
hbox.ButtonGroup > * + * > i {
8496
padding-right: 1px;
8597
}
86-
hbox.ButtonGroup > button + button {
98+
hbox.ButtonGroup > * + input[type],
99+
hbox.ButtonGroup > * + button {
87100
border-top-left-radius: 0px;
88101
border-bottom-left-radius: 0px;
89102
border-left-width: 0px;
90103
}
91-
hbox.ButtonGroup > button + button > i {
104+
hbox.ButtonGroup > * + * > i {
92105
padding-left: 1px;
93106
}
94-
hbox.ButtonGroup > button:last-child {
95-
border-top-right-radius: 0.3ex;
96-
border-bottom-right-radius: 0.3ex;
97-
border-right-width: 1px;
98-
}
99-
hbox.ButtonGroup > button:last-child > i {
107+
hbox.ButtonGroup > *:last-child > i {
100108
padding-right: 0px;
101109
}
102-
hbox.ButtonGroup > button[disabled] + button:not([disabled]),
103-
hbox.ButtonGroup > button:not([disabled]) + button[disabled] {
110+
hbox.ButtonGroup > *[disabled] + *:not([disabled]),
111+
hbox.ButtonGroup > *:not([disabled]) + *[disabled] {
104112
border-left-width: 1px;
105113
}
106-
hbox.ButtonGroup > button[disabled] + button:not([disabled]) > i,
107-
hbox.ButtonGroup > button:not([disabled]) + button[disabled] > i {
114+
hbox.ButtonGroup > *[disabled] + *:not([disabled]) > i,
115+
hbox.ButtonGroup > *:not([disabled]) + *[disabled] > i {
108116
padding-left: 0px;
109117
}
118+
hbox.ButtonGroup > input[type]:not(:last-child) {
119+
border-right: solid 1px rgba(0, 0, 0, 0.1); !important;
120+
}
121+
hbox.ButtonGroup > button + input[type],
122+
hbox.ButtonGroup > .AdoptedOrphan + * {
123+
border-left: solid 1px rgba(0, 0, 0, 0.1); !important;
124+
}
110125
hbox.ButtonGroup {
111126
display: inline-flex;
112127
}
128+
113129
button[selected='true'],
114130
button[checked='true'] {
115131
background: #C8C8C8;

app/css/variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@popup_border: darken(@app_bg, 5%);
99
@toolbar_spacing: 0.4em;
1010
@selected_button_bg: #C8C8C8;
11-
11+
@toolbar_gap: 0.4em;
1212
@iconify: {
1313
display: inline-block;
1414
line-height: 1em;

app/desktop.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = function () {
88
"cinamon": [{command: "dconf", params: ["read", "/org/cinnamon/desktop/interface/font-name"]},
99
{command: "gsettings", params: ["get", "org.cinnamon.desktop.interface", "font-name"]}],
1010
"gnome": [{command: "gsettings", params: ["get", "org.gnome.desktop.interface", "font-name"]}],
11+
"ubuntu": [{command: "gsettings", params: ["get", "org.gnome.desktop.interface", "font-name"]}]
1112
}
1213
var fontNameReader = function(registry, callback, index) {
1314
var child = spawn(registry.command, registry.params);
@@ -62,6 +63,9 @@ module.exports = function () {
6263
var platformHandlers = {
6364
linux: function (callback) {
6465
var d = process.env.DESKTOP_SESSION;
66+
if (/ubuntu/ig.exec(d)) {
67+
d = "ubuntu";
68+
}
6569
var fontRegistry = fontCommandRegistry[d];
6670
if (!fontRegistry) {
6771
console.error("Coud not found font command registry for ", d);
@@ -138,6 +142,9 @@ module.exports = function () {
138142
style = RegExp.$1;
139143
}
140144

145+
// TODO: use default fontsize
146+
size = 11;
147+
141148
callback({
142149
family: family,
143150
weight: weight,

app/index.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,25 @@ if (require('electron-squirrel-startup')) {
44
return;
55
}
66

7-
const electron = require("electron");
8-
const app = electron.app;
9-
const Console = require("console").Console;
7+
const {app, protocol, shell, BrowserWindow} = require("electron");
108
const pkg = require("./package.json");
119
const fs = require("fs");
1210
const path = require("path");
1311

1412
app.commandLine.appendSwitch("allow-file-access-from-files");
1513
app.commandLine.appendSwitch("allow-file-access");
1614

17-
const BrowserWindow = electron.BrowserWindow;
18-
15+
// Disable hardware acceleration by default for Linux
16+
// TODO: implement a setting for this one and requires a restart after changing that value
17+
if (process.platform.trim().toLowerCase() == "linux" && app.disableHardwareAcceleration) {
18+
console.log("Hardware acceleration disabled for Linux.");
19+
app.disableHardwareAcceleration();
20+
}
1921

20-
// logs
21-
const output = fs.createWriteStream(app.getPath("userData") + "/user.log");
22-
const errorOutput = fs.createWriteStream(app.getPath("userData") + "/error.log");
23-
const logger = new Console(output, errorOutput);
2422

2523
var handleRedirect = (e, url) => {
2624
e.preventDefault();
27-
electron.shell.openExternal(url);
25+
shell.openExternal(url);
2826
}
2927

3028
var mainWindow = null;
@@ -89,9 +87,6 @@ app.on("window-all-closed", function() {
8987
});
9088

9189
app.on('ready', function() {
92-
var protocol = require('protocol');
93-
var fs = require('fs');
94-
9590
protocol.registerBufferProtocol("ref", function(request, callback) {
9691
var path = request.url.substr(6);
9792
console.log("PATH", path);
@@ -128,7 +123,7 @@ app.on("activate", function() {
128123
});
129124

130125
process.on('uncaughtException', function (error) {
131-
logger.error(error);
126+
console.error(error);
132127
});
133128

134129
console.log("Platform: " + process.platform.trim());

app/lib/font-manager/darwin/fontmanager.node

100644100755
300 Bytes
Binary file not shown.

app/lib/font-manager/linux/fontmanager.node

100644100755
0 Bytes
Binary file not shown.
3.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)