File tree Expand file tree Collapse file tree 5 files changed +31
-13
lines changed Expand file tree Collapse file tree 5 files changed +31
-13
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import { ViewProps, setProps as setViewProps } from "../View";
44
55interface ButtonProps extends ViewProps {
66 text ?: string ;
7- isFlat ?: boolean ;
8- icon ?: string ;
7+ flat ?: boolean ;
8+ icon ?: QIcon ;
99}
1010
1111const setProps = (
@@ -17,11 +17,10 @@ const setProps = (
1717 set text ( buttonText : string ) {
1818 widget . setText ( buttonText ) ;
1919 } ,
20- set isFlat ( isFlat : boolean ) {
20+ set flat ( isFlat : boolean ) {
2121 widget . setFlat ( isFlat ) ;
2222 } ,
23- set icon ( iconUrl : string ) {
24- const icon = new QIcon ( iconUrl ) ;
23+ set icon ( icon : QIcon ) {
2524 widget . setIcon ( icon ) ;
2625 }
2726 } ;
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ export class ImageLabel extends QLabel {
44 originalPixmap ?: QPixmap ;
55 aspectRatioMode ?: AspectRatioMode ;
66 setPixmap = ( pixmap : QPixmap ) => {
7+ // react:✓
78 super . setPixmap ( pixmap ) ;
89 this . originalPixmap = pixmap ;
910 } ;
1011 setAspectRatioMode = ( mode : AspectRatioMode ) => {
12+ // react:✓ TODO://getter
1113 this . aspectRatioMode = mode ;
1214 } ;
1315 scalePixmap = ( width : number , height : number ) => {
Original file line number Diff line number Diff line change 1-
21import { registerComponent } from "../config" ;
3- import { QPlainTextEdit , QPlainTextEditEvents } from "@nodegui/nodegui" ;
2+ import { QPlainTextEdit } from "@nodegui/nodegui" ;
43import { ViewProps , setProps as setViewProps } from "../View" ;
54
65interface PlainTextEditProps extends ViewProps {
76 children ?: string ;
87 text ?: string ;
8+ readOnly ?: boolean ;
99}
1010
1111const setProps = (
@@ -17,6 +17,9 @@ const setProps = (
1717 set text ( text : string ) {
1818 text ? widget . setPlainText ( text ) : widget . clear ( ) ;
1919 } ,
20+ set readOnly ( isReadOnly : boolean ) {
21+ widget . setReadOnly ( isReadOnly ) ;
22+ }
2023 } ;
2124 Object . assign ( setter , newProps ) ;
2225 setViewProps ( widget , newProps , oldProps ) ;
Original file line number Diff line number Diff line change 11import { registerComponent } from "../config" ;
2- import { QProgressBar } from "@nodegui/nodegui" ;
2+ import { QProgressBar , Orientation } from "@nodegui/nodegui" ;
33import { ViewProps , setProps as setViewProps } from "../View" ;
44
5- interface ProgressBarProps extends ViewProps { }
5+ interface ProgressBarProps extends ViewProps {
6+ value ?: number ;
7+ minimum ?: number ;
8+ maximum ?: number ;
9+ orientation ?: Orientation ;
10+ }
611
712const setProps = (
813 widget : QProgressBar ,
914 newProps : ProgressBarProps ,
1015 oldProps : ProgressBarProps
1116) => {
1217 const setter : ProgressBarProps = {
13- // set text(checkboxText: string) {
14- // widget.setText(checkboxText);
15- // }
18+ set value ( val : number ) {
19+ widget . setValue ( val ) ;
20+ } ,
21+ set minimum ( min : number ) {
22+ widget . setMinimum ( min ) ;
23+ } ,
24+ set maximum ( max : number ) {
25+ widget . setMaximum ( max ) ;
26+ } ,
27+ set orientation ( orientation : Orientation ) {
28+ widget . setOrientation ( orientation ) ;
29+ }
1630 } ;
1731 Object . assign ( setter , newProps ) ;
1832 setViewProps ( widget , newProps , oldProps ) ;
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ export { Renderer } from "./renderer";
22export { View } from "./components/View" ;
33export { Window } from "./components/Window" ;
44export { Text } from "./components/Text" ;
5+ export { Image } from "./components/Image" ;
56export { Button } from "./components/Button" ;
67export { CheckBox } from "./components/CheckBox" ;
78export { LineEdit } from "./components/LineEdit" ;
89export { PlainTextEdit } from "./components/PlainTextEdit" ;
910export { ProgressBar } from "./components/ProgressBar" ;
1011export { RadioButton } from "./components/RadioButton" ;
11- export { Image } from "./components/Image" ;
1212export { useEventHandler } from "./hooks" ;
You can’t perform that action at this time.
0 commit comments