Skip to content

Commit ba152b1

Browse files
committed
Bumps version and adds more props to view
1 parent d2a80fb commit ba152b1

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nodegui/react-desktop",
3-
"version": "0.0.5-alpha",
3+
"version": "0.0.6",
44
"description": "React Native for building cross platform desktop applications",
55
"main": "dist/src/index.js",
66
"files": [

src/components/Image/ImageLabel.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ export class ImageLabel extends QLabel {
99
};
1010
setAspectRatioMode = (mode: AspectRatioMode) => {
1111
this.aspectRatioMode = mode;
12-
// const size = this.size();
13-
// this.scalePixmap(size.width, size.height);
1412
};
1513
scalePixmap = (width: number, height: number) => {
1614
if (this.originalPixmap) {

src/components/View/index.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { QWidget, NodeWidget } from "@nodegui/nodegui";
1+
import {
2+
QWidget,
3+
NodeWidget,
4+
WidgetAttribute,
5+
WindowType
6+
} from "@nodegui/nodegui";
27
import { registerComponent } from "../config";
38

49
export interface ListenerMap {
@@ -13,6 +18,9 @@ export interface ViewProps {
1318
on?: ListenerMap;
1419
mouseTracking?: boolean;
1520
enabled?: boolean;
21+
attributes?: WidgetAttribute[];
22+
windowFlags?: WindowType[];
23+
windowOpacity?: Number;
1624
}
1725

1826
export const setProps = (
@@ -60,6 +68,29 @@ export const setProps = (
6068
widget.addEventListener(eventType, newEvtListener);
6169
}
6270
);
71+
},
72+
set attributes(attributes: WidgetAttribute[]) {
73+
const oldAttributes = oldProps.attributes || [];
74+
const newAttributes = attributes || [];
75+
oldAttributes.forEach(eachOldAttribute => {
76+
widget.setAttribute(eachOldAttribute, false);
77+
});
78+
newAttributes.forEach(eachNewAttribute => {
79+
widget.setAttribute(eachNewAttribute, true);
80+
});
81+
},
82+
set windowFlags(windowTypes: WindowType[]) {
83+
const oldFlags = oldProps.windowFlags || [];
84+
const newFlags = windowTypes || [];
85+
oldFlags.forEach(eachOldFlag => {
86+
widget.setWindowFlag(eachOldFlag, false);
87+
});
88+
newFlags.forEach(eachNewWindowFlag => {
89+
widget.setWindowFlag(eachNewWindowFlag, true);
90+
});
91+
},
92+
set windowOpacity(opacity: Number) {
93+
widget.setWindowOpacity(opacity);
6394
}
6495
};
6596
Object.assign(setter, newProps);

0 commit comments

Comments
 (0)