mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Automatically arrange newly loaded images
This commit is contained in:
parent
0e461c29a2
commit
a6a757bf83
2 changed files with 3 additions and 2 deletions
|
|
@ -66,8 +66,6 @@ def load_images(filenames, pos, scene, worker):
|
|||
continue
|
||||
item = BeePixmapItem(img, filename)
|
||||
item.set_pos_center(pos)
|
||||
pos.setX(pos.x() + 50)
|
||||
pos.setY(pos.y() + 50)
|
||||
scene.add_item_later(item, selected=True)
|
||||
items.append(item)
|
||||
if worker.canceled:
|
||||
|
|
|
|||
|
|
@ -313,6 +313,8 @@ class BeeGraphicsView(QtWidgets.QGraphicsView, ActionsMixin):
|
|||
self,
|
||||
'Problem loading images',
|
||||
msg + errornames)
|
||||
self.scene.arrange_optimal()
|
||||
self.undo_stack.endMacro()
|
||||
|
||||
def on_action_insert_images(self):
|
||||
formats = self.get_supported_image_formats(QtGui.QImageReader)
|
||||
|
|
@ -322,6 +324,7 @@ class BeeGraphicsView(QtWidgets.QGraphicsView, ActionsMixin):
|
|||
filter=f'Images ({formats})')
|
||||
|
||||
self.scene.clearSelection()
|
||||
self.undo_stack.beginMacro('Insert Images')
|
||||
self.worker = fileio.ThreadedIO(
|
||||
fileio.load_images,
|
||||
filenames,
|
||||
|
|
|
|||
Loading…
Reference in a new issue