Bycelium / PyFlow

An open-source tool for visual and modular block programming in python
GNU General Public License v3.0
1.28k stars 54 forks source link

Ctrl+N to create new objects #204

Open AlexandreSajus opened 2 years ago

AlexandreSajus commented 2 years ago

Ctrl+N could create a new block Ctrl+Shift+N could create a new window

AlexandreSajus commented 2 years ago

Ctrl+Shift+N has been dealt with (#264)

Ctrl+N is hard to implement: I tried this:

x, y = (
            current_window.view.mapToScene(QCursor.pos()).x(),
            current_window.view.mapToScene(QCursor.pos()).y(),
        )
        if self.is_not_editing(current_window):
            current_window.scene.create_block_from_file(
                "pyflow/blocks/blockfiles/empty.pfb", x, y
            )

But it had a weird offset that depends on the resolution of the monitor image