Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
c70e77b5
Commit
c70e77b5
authored
Sep 14, 2020
by
Jonathan Wilkes
Browse files
Merge branch 'aggraef/purr-data-user-css'
parents
6ff531cf
6006f94e
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/dialog_prefs.html
View file @
c70e77b5
...
...
@@ -1036,9 +1036,29 @@ function autopatch_yoffset_toggle(checked) {
function
gui_prefs_callback
(
name
,
show_grid
,
save_zoom
,
browser_doc
,
browser_path
,
browser_init
,
autopatch_yoffset
)
{
var
s
=
document
.
getElementById
(
"
gui_preset
"
),
i
;
for
(
i
=
0
;
i
<
s
.
options
.
length
;
i
++
)
{
var
s
=
document
.
getElementById
(
"
gui_preset
"
);
// ag: scan the css subdir for user-defined styles
var
predefined
=
// built-in styles
[
"
c64.css
"
,
"
default.css
"
,
"
dejavu.css
"
,
"
extended.css
"
,
"
footgun.css
"
,
"
inverted.css
"
,
"
solarized.css
"
,
"
solarized_inverted.css
"
,
"
strongbad.css
"
,
"
subdued.css
"
,
"
vanilla.css
"
,
"
vanilla_inverted.css
"
];
var
fs
=
require
(
'
fs
'
);
var
base
=
process
.
platform
===
"
darwin
"
?
pdgui
.
get_lib_dir
()
:
"
.
"
;
var
files
=
fs
.
readdirSync
(
base
+
"
/css/
"
);
files
.
forEach
(
file
=>
{
var
pos
=
file
.
lastIndexOf
(
'
.
'
);
var
ext
=
file
.
substr
(
pos
);
if
(
ext
===
"
.css
"
&&
predefined
.
indexOf
(
file
)
===
-
1
)
{
var
base
=
file
.
substr
(
0
,
pos
);
var
option
=
document
.
createElement
(
"
option
"
);
option
.
text
=
base
;
s
.
add
(
option
);
}
});
for
(
var
i
=
0
;
i
<
s
.
options
.
length
;
i
++
)
{
if
(
s
.
options
[
i
].
value
.
toLowerCase
()
===
name
.
toLowerCase
())
{
s
.
selectedIndex
=
i
;
break
;
...
...
pd/nw/pdgui.js
View file @
c70e77b5
...
...
@@ -5980,7 +5980,12 @@ var skin = exports.skin = (function () {
return
dir
+
preset
+
"
.css
"
;
},
set
:
function
(
name
)
{
preset
=
name
;
// ag: if the preset doesn't exist (e.g., user preset that
// has disappeared), just stick to the default
var
base
=
process
.
platform
===
"
darwin
"
?
(
lib_dir
+
"
/
"
)
:
""
;
if
(
fs
.
existsSync
(
base
+
dir
+
name
+
"
.css
"
))
{
preset
=
name
;
}
for
(
id
in
patchwin
)
{
if
(
patchwin
.
hasOwnProperty
(
id
)
&&
patchwin
[
id
])
{
set_css
(
patchwin
[
id
].
window
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment