File tree 5 files changed +31
-13
lines changed
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";
4
4
5
5
interface ButtonProps extends ViewProps {
6
6
text ?: string ;
7
- isFlat ?: boolean ;
8
- icon ?: string ;
7
+ flat ?: boolean ;
8
+ icon ?: QIcon ;
9
9
}
10
10
11
11
const setProps = (
@@ -17,11 +17,10 @@ const setProps = (
17
17
set text ( buttonText : string ) {
18
18
widget . setText ( buttonText ) ;
19
19
} ,
20
- set isFlat ( isFlat : boolean ) {
20
+ set flat ( isFlat : boolean ) {
21
21
widget . setFlat ( isFlat ) ;
22
22
} ,
23
- set icon ( iconUrl : string ) {
24
- const icon = new QIcon ( iconUrl ) ;
23
+ set icon ( icon : QIcon ) {
25
24
widget . setIcon ( icon ) ;
26
25
}
27
26
} ;
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ export class ImageLabel extends QLabel {
4
4
originalPixmap ?: QPixmap ;
5
5
aspectRatioMode ?: AspectRatioMode ;
6
6
setPixmap = ( pixmap : QPixmap ) => {
7
+ // react:✓
7
8
super . setPixmap ( pixmap ) ;
8
9
this . originalPixmap = pixmap ;
9
10
} ;
10
11
setAspectRatioMode = ( mode : AspectRatioMode ) => {
12
+ // react:✓ TODO://getter
11
13
this . aspectRatioMode = mode ;
12
14
} ;
13
15
scalePixmap = ( width : number , height : number ) => {
Original file line number Diff line number Diff line change 1
-
2
1
import { registerComponent } from "../config" ;
3
- import { QPlainTextEdit , QPlainTextEditEvents } from "@nodegui/nodegui" ;
2
+ import { QPlainTextEdit } from "@nodegui/nodegui" ;
4
3
import { ViewProps , setProps as setViewProps } from "../View" ;
5
4
6
5
interface PlainTextEditProps extends ViewProps {
7
6
children ?: string ;
8
7
text ?: string ;
8
+ readOnly ?: boolean ;
9
9
}
10
10
11
11
const setProps = (
@@ -17,6 +17,9 @@ const setProps = (
17
17
set text ( text : string ) {
18
18
text ? widget . setPlainText ( text ) : widget . clear ( ) ;
19
19
} ,
20
+ set readOnly ( isReadOnly : boolean ) {
21
+ widget . setReadOnly ( isReadOnly ) ;
22
+ }
20
23
} ;
21
24
Object . assign ( setter , newProps ) ;
22
25
setViewProps ( widget , newProps , oldProps ) ;
Original file line number Diff line number Diff line change 1
1
import { registerComponent } from "../config" ;
2
- import { QProgressBar } from "@nodegui/nodegui" ;
2
+ import { QProgressBar , Orientation } from "@nodegui/nodegui" ;
3
3
import { ViewProps , setProps as setViewProps } from "../View" ;
4
4
5
- interface ProgressBarProps extends ViewProps { }
5
+ interface ProgressBarProps extends ViewProps {
6
+ value ?: number ;
7
+ minimum ?: number ;
8
+ maximum ?: number ;
9
+ orientation ?: Orientation ;
10
+ }
6
11
7
12
const setProps = (
8
13
widget : QProgressBar ,
9
14
newProps : ProgressBarProps ,
10
15
oldProps : ProgressBarProps
11
16
) => {
12
17
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
+ }
16
30
} ;
17
31
Object . assign ( setter , newProps ) ;
18
32
setViewProps ( widget , newProps , oldProps ) ;
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ export { Renderer } from "./renderer";
2
2
export { View } from "./components/View" ;
3
3
export { Window } from "./components/Window" ;
4
4
export { Text } from "./components/Text" ;
5
+ export { Image } from "./components/Image" ;
5
6
export { Button } from "./components/Button" ;
6
7
export { CheckBox } from "./components/CheckBox" ;
7
8
export { LineEdit } from "./components/LineEdit" ;
8
9
export { PlainTextEdit } from "./components/PlainTextEdit" ;
9
10
export { ProgressBar } from "./components/ProgressBar" ;
10
11
export { RadioButton } from "./components/RadioButton" ;
11
- export { Image } from "./components/Image" ;
12
12
export { useEventHandler } from "./hooks" ;
You can’t perform that action at this time.
0 commit comments