Giter VIP home page Giter VIP logo

Comments (9)

Solant avatar Solant commented on May 14, 2024 2

hmm, in this case, you can try using css for top-level component

style={'background-image: url(/path/to/image.png)'}

with some more props to handle background size, you can check reference for all supported props:
https://doc.qt.io/qt-5/stylesheet-reference.html

from react-nodegui.

Solant avatar Solant commented on May 14, 2024

you can use icon property on button component
is it enough to do the trick?

from react-nodegui.

leopku avatar leopku commented on May 14, 2024

you can use icon property on button component
is it enough to do the trick?

Thanks for the reply.

Button doesn't fit my needs.
I wanna a big image as background of my app. The image should fit all of the window.

from react-nodegui.

leopku avatar leopku commented on May 14, 2024

It works.
Thanks a lot!

from react-nodegui.

leopku avatar leopku commented on May 14, 2024

background-image works in nodegui but take no effect in react-nodegui
I tested in react-nodegui-starter by:

inline style like:

style={'background-image: url(/Users/leo/Pictures/20150922224629_25mVM.jpeg)'}

style sheet like:

const styleSheet=`
  background-image: url(/Users/leo/Pictures/20150922224629_25mVM.jpeg);
`

All above methods did not work.

from react-nodegui.

a7ul avatar a7ul commented on May 14, 2024

Hi @leopku

import { Window, hot, View, Button } from "@nodegui/react-nodegui";
import React from "react";
import { QIcon } from "@nodegui/nodegui";
import nodeguiIcon from "../assets/nodegui.jpg";

const minSize = { width: 500, height: 520 };
const winIcon = new QIcon(nodeguiIcon);
class App extends React.Component {
  render() {
    return (
      <Window windowIcon={winIcon} windowTitle="Hello 👋🏽" minSize={minSize}>
        <View style={containerStyle}>
          <Button style={"background-color: blue;"} text="Hello"></Button>
        </View>
      </Window>
    );
  }
}

const containerStyle = `
  flex: 1; 
  background-image: url(/Users/atulr/Project/nodegui/react-nodegui-starter/assets/nodegui.jpg)
`;

export default hot(App);

This is the code I am using

and this is the output i get:

Screenshot 2020-02-29 at 10 56 00

from react-nodegui.

a7ul avatar a7ul commented on May 14, 2024

Can you post the link to a repo where I can see the issue ? @leopku

from react-nodegui.

leopku avatar leopku commented on May 14, 2024

Magic.
After fixing nodegui/react-nodegui-starter#89, It works now.
Thank you @master-atul and @Solant .

from react-nodegui.

leopku avatar leopku commented on May 14, 2024

It not changed after changing url(...) to a new background.
See #150, plz.

from react-nodegui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.