Bumps nodegui version and adds scrollview example

master
Atul R 5 years ago
parent 2075566b4f
commit 19e6503662
  1. 1156
      package-lock.json
  2. 2
      package.json
  3. 33
      src/index.tsx

1156
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -12,7 +12,7 @@
"start:watch": "nodemon -e js,ts,tsx --ignore dist/ --ignore node_modules/ --exec npm start"
},
"dependencies": {
"@nodegui/nodegui": "^0.1.9",
"@nodegui/nodegui": "^0.2.1",
"@nodegui/react-nodegui": "^0.1.9",
"react": "^16.9.0"
},

@ -4,6 +4,7 @@ import {
Text,
Window,
Image,
ScrollArea
} from "@nodegui/react-nodegui";
import path from "path";
import React from "react";
@ -11,36 +12,44 @@ import { AspectRatioMode } from "@nodegui/nodegui";
import imageUrl from "../assets/nodegui.jpg";
const distImgUrl = path.resolve(__dirname, imageUrl);
const minSize = {width: 500, height: 400};
const minSize = { width: 500, height: 400 };
const App = () => {
return (
<Window minSize={minSize} styleSheet={styleSheet}>
<View id="container">
<Text style="font-size: 15px; font-weight: bold; margin-bottom: 20px;">Hello World</Text>
<Image
style={imageStyle}
src={distImgUrl}
aspectRatioMode={AspectRatioMode.KeepAspectRatio}
/>
</View>
<ScrollArea style={`height: '100%';width: '100%';`}>
<View id="container">
<Text style="font-size: 15px; font-weight: bold; margin-bottom: 20px;">
Hello World
</Text>
<Image
style={imageStyle}
src={distImgUrl}
aspectRatioMode={AspectRatioMode.KeepAspectRatio}
/>
</View>
</ScrollArea>
</Window>
);
};
const imageStyle = `
height: "100px";
width: "100px";
height: "700px";
width: "700px";
qproperty-alignment: 'AlignHCenter';
`;
const styleSheet = `
#container {
flex: 1;
min-height: 0;
min-width: 0;
width: '900';
height: '900';
flex-direction: column;
min-height: '100%';
align-items: 'center';
justify-content: 'center';
background-color: 'grey';
}
`;

Loading…
Cancel
Save