import { ChangeDetectionStrategy, Component } from '@angular/core';
import { AppTitle } from '@app/app/components/title.js';
import { ApiDocComponent } from '@app/app/pages/documentation/desktop-ui/api-doc.component.js';
import { CodeFrameComponent } from '@app/app/pages/documentation/desktop-ui/code-frame.component.js';
import {
ButtonComponent,
ButtonGroupComponent,
InputComponent,
ListComponent,
ListItemComponent,
ListTitleComponent,
WindowComponent,
WindowContentComponent,
WindowFooterComponent,
WindowFrameComponent,
WindowHeaderComponent,
WindowSidebarComponent,
WindowToolbarComponent,
} from '@deepkit/desktop-ui';
import { CodeHighlightComponent } from '@deepkit/ui-library';
@Component({
host: { ngSkipHydration: 'true' },
template: `
Desktop UI
Window
A window is built of multiple key components, you need for almost all of your desktop applications. The
frame, header, header toolbar, content, footer.
If you use electron, you need to make sure the electron window is rendering without borders. You do this
by setting to titleBarStyle to none. To work correctly, this library requires you to set certain window
options correctly. Following is an example:
Simple
Angular Desktop UI
This is the window content
Angular Desktop UI
This is the window content
\`"
/>
Toolbar
Angular Desktop UI
This is the window content
Angular Desktop UI
This is the window content
\`'
/>
Footer
Angular Desktop UI
This is the window content
This is the footer.
Angular Desktop UI
This is the window content
This is the footer.
\`'
/>
Sidebar
Angular Desktop UI
Form controls
Button
Button Group
This is the window content
`,
styleUrls: ['./window.scss'],
changeDetection: ChangeDetectionStrategy.Eager,
imports: [
CodeHighlightComponent,
CodeFrameComponent,
WindowComponent,
WindowHeaderComponent,
WindowComponent,
WindowHeaderComponent,
ApiDocComponent,
ListItemComponent,
ListTitleComponent,
WindowSidebarComponent,
WindowContentComponent,
ListComponent,
ButtonComponent,
ButtonGroupComponent,
WindowToolbarComponent,
WindowFooterComponent,
InputComponent,
WindowFrameComponent,
AppTitle,
],
})
export class DocDesktopUIWindowComponent {
sidebarVisible = true;
codeNewWindow = `
win = new BrowserWindow({
center: true,
width: 750,
height: 750,
vibrancy: 'window',
transparent: true, //necessary for vibrancy fix on macos
backgroundColor: "#80FFFFFF", //necessary for vibrancy fix on macos
webPreferences: {
scrollBounce: true,
allowRunningInsecureContent: false,
preload: __dirname + '/../../node_modules/@deepkit/desktop-ui/preload.js',
nativeWindowOpen: true,
},
titleBarStyle: 'hidden',
icon: path.join(assetsPath, 'icons/64x64.png')
});
`;
}