We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d213413 + d4ac24b commit a8bab51Copy full SHA for a8bab51
src/components/Button/index.ts
@@ -1,10 +1,11 @@
1
import { registerComponent } from "../config";
2
-import { QPushButton } from "@nodegui/nodegui";
+import { QPushButton, QIcon } from "@nodegui/nodegui";
3
import { ViewProps, setProps as setViewProps } from "../View";
4
5
interface ButtonProps extends ViewProps {
6
text?: string;
7
isFlat?: boolean;
8
+ icon?: string;
9
}
10
11
const setProps = (
@@ -18,6 +19,10 @@ const setProps = (
18
19
},
20
set isFlat(isFlat: boolean) {
21
widget.setFlat(isFlat);
22
+ },
23
+ set icon(iconUrl: string) {
24
+ const icon = new QIcon(iconUrl);
25
+ widget.setIcon(icon);
26
27
};
28
Object.assign(setter, newProps);
0 commit comments