Skip to content

Commit

Permalink
Merge pull request #14 from Araxeus/v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Araxeus committed Mar 11, 2023
2 parents 713ad4a + 8c704e1 commit 16ed0d9
Show file tree
Hide file tree
Showing 12 changed files with 2,384 additions and 821 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Check Pull Request"
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3

- name: "Dependency Review"
uses: actions/dependency-review-action@v3

rome-ci:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3

- uses: rome/setup-rome@v0.4
with:
version: latest

- name: "Run rome ci ."
run: rome ci .
20 changes: 0 additions & 20 deletions .github/workflows/dependency-review.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"rome.rome"
]
}
114 changes: 70 additions & 44 deletions example/Examples.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,75 @@
/** Counter Prompt **/
prompt({
title: "Counter",
label: "Choose a number:",
value: "59",
type: "counter",
counterOptions: { minimum: -69, maximum: null, multiFire: true },
resizable: true,
height: 150,
width: 300,
customStylesheet: "dark",
}, win).then(input => { console.log(`input == ${input}`) }).catch(console.error)
prompt(
{
title: 'Counter',
label: 'Choose a number:',
value: '59',
type: 'counter',
counterOptions: { minimum: -69, maximum: null, multiFire: true },
resizable: true,
height: 150,
width: 300,
customStylesheet: 'dark',
},
win,
)
.then((input) => {
console.log(`input == ${input}`);
})
.catch(console.error);

/** Select Prompt **/
prompt({
title: "Select",
label: "Choose an option:",
type: "select",
value: "2",
selectOptions: ["thisReturn0", "thisReturn1", "imSelected", "thisReturn3"],
// selectOptions: {0: "thisReturn0", 1: "thisReturn1", 2: "imSelected" , potato: "thisReturnPotato"},
resizable: true,
height: 150,
width: 300,
customStylesheet: "dark",
}, win).then(input => { console.log(`input == ${input}`) }).catch(console.error)

prompt(
{
title: 'Select',
label: 'Choose an option:',
type: 'select',
value: '2',
selectOptions: [
'thisReturn0',
'thisReturn1',
'imSelected',
'thisReturn3',
],
// selectOptions: {0: "thisReturn0", 1: "thisReturn1", 2: "imSelected" , potato: "thisReturnPotato"},
resizable: true,
height: 150,
width: 300,
customStylesheet: 'dark',
},
win,
)
.then((input) => {
console.log(`input == ${input}`);
})
.catch(console.error);

/** Accelelerator Prompt **/
const kb = ($value, $label, $default) => { return { value: $value, label: $label, default: $default } };
prompt({
title: "Keybinds",
label: "Select keybind for each method",
type: "keybind",
value: "2",
keybindOptions: [
{ value: "volumeUp", label: "Increase Volume", default: "Shift+PageUp" },
kb("volumeDown", "Decrease Volume", "Shift+PageDown"),
kb("playPause", "Play / Pause") // (null || empty string || undefined) == no default
],
resizable: true,
customStylesheet: "dark",
}, win).then(input => {
if (input)
input.forEach(obj => console.log(obj))
else
console.log("Pressed Cancel");
})
.catch(console.error)
const kb = ($value, $label, $default) => {
return { value: $value, label: $label, default: $default };
};
prompt(
{
title: 'Keybinds',
label: 'Select keybind for each method',
type: 'keybind',
value: '2',
keybindOptions: [
{
value: 'volumeUp',
label: 'Increase Volume',
default: 'Shift+PageUp',
},
kb('volumeDown', 'Decrease Volume', 'Shift+PageDown'),
kb('playPause', 'Play / Pause'), // (null || empty string || undefined) == no default
],
resizable: true,
customStylesheet: 'dark',
},
win,
)
.then((input) => {
if (input) input.forEach((obj) => console.log(obj));
else console.log('Pressed Cancel');
})
.catch(console.error);
22 changes: 11 additions & 11 deletions example/custom-titlebar.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// this file could be used as a custom script, to use a custom titlebar

const customTitlebar = require("custom-electron-titlebar");
const customTitlebar = require('custom-electron-titlebar');

module.exports = () => {
const bar = new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex("#050505"),
minimizable: false,
maximizable: false,
menu: null
});
const mainStyle = document.querySelector("#container").style;
mainStyle.width = "100%";
mainStyle.position = "fixed";
mainStyle.border = "unset";
const bar = new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#050505'),
minimizable: false,
maximizable: false,
menu: null,
});
const mainStyle = document.querySelector('#container').style;
mainStyle.width = '100%';
mainStyle.position = 'fixed';
mainStyle.border = 'unset';
};

0 comments on commit 16ed0d9

Please sign in to comment.