Updated features docs
This commit is contained in:
parent
3b04978552
commit
3a8362c408
4 changed files with 36 additions and 7 deletions
|
|
@ -17,16 +17,45 @@ Applications (sometimes shortened to apps) are processes that open a window when
|
||||||
|
|
||||||
The header menu is a useful component that can be added to app windows for quick access to useful functions, like saving and opening files. The header menu can also be used to add shortcuts for functions.
|
The header menu is a useful component that can be added to app windows for quick access to useful functions, like saving and opening files. The header menu can also be used to add shortcuts for functions.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```js
|
||||||
|
// components/applications/example/Example.jsx
|
||||||
|
|
||||||
|
<HeaderMenu
|
||||||
|
options={{
|
||||||
|
"File": {
|
||||||
|
"New": () => {
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
"Save": () => {
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
"Exit": () => {
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
shortcuts={{
|
||||||
|
"File": {
|
||||||
|
"New": ["Control", "e"],
|
||||||
|
"Save": ["Control", "s"],
|
||||||
|
"Exit": ["Control", "x"],
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
## Template components
|
## Template components
|
||||||
|
|
||||||
### Webview
|
### Webview
|
||||||
|
|
||||||
The webview template can be used to turn a webpage into an application by simply setting a source property. For more information, see the [example](#turning-a-webpage-into-an-application) below.
|
The webview template can be used to turn a webpage into an application by simply setting a source property.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// src/features/applications/applications.js
|
// features/applications/applications.js
|
||||||
|
|
||||||
import { WebView } from "../../components/applications/templates/WebView.jsx";
|
import { WebView } from "../../components/applications/templates/WebView.jsx";
|
||||||
|
|
||||||
|
|
@ -45,7 +74,7 @@ export default class ApplicationsManager {
|
||||||
### Adding a new application
|
### Adding a new application
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// src/components/applications/example/Example.jsx
|
// components/applications/example/Example.jsx
|
||||||
|
|
||||||
export function Example() {
|
export function Example() {
|
||||||
return (
|
return (
|
||||||
|
|
@ -55,7 +84,7 @@ export function Example() {
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// src/features/applications/applications.js
|
// features/applications/applications.js
|
||||||
|
|
||||||
import { Example } from "../../components/applications/example/Example.jsx";
|
import { Example } from "../../components/applications/example/Example.jsx";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ See [features/applications/terminal/commands.js](../../../../src/features/applic
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// src/features/applications/terminal/commands.js
|
// features/applications/terminal/commands.js
|
||||||
|
|
||||||
new Command("cd", (args, { currentDirectory, setCurrentDirectory }) => {
|
new Command("cd", (args, { currentDirectory, setCurrentDirectory }) => {
|
||||||
const path = args[0] ?? "~"; // Default to home directory
|
const path = args[0] ?? "~"; // Default to home directory
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ The initial files added to every instance of ProzillaOS, can be found and config
|
||||||
### Component interacting with virtual drive
|
### Component interacting with virtual drive
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// src/components/applications/example/Example.jsx
|
// components/applications/example/Example.jsx
|
||||||
|
|
||||||
export function Example() {
|
export function Example() {
|
||||||
const virtualRoot = useVirtualRoot();
|
const virtualRoot = useVirtualRoot();
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ The windows components are used to view and interact with running applications.
|
||||||
|
|
||||||
- [x] Maximize (fullscreen)
|
- [x] Maximize (fullscreen)
|
||||||
- [ ] Minimize
|
- [ ] Minimize
|
||||||
- [ ] Resize
|
- [x] Resize
|
||||||
- [x] Multiple windows of the same app
|
- [x] Multiple windows of the same app
|
||||||
- [x] Draw order
|
- [x] Draw order
|
||||||
Loading…
Reference in a new issue