mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
XSegEditor: added delete button
This commit is contained in:
parent
081d8faa45
commit
6f5bccaa15
4 changed files with 23 additions and 2 deletions
|
@ -17,6 +17,7 @@ class QIconDB():
|
||||||
QIconDB.poly_type_exclude = QIcon ( str(icon_path / 'poly_type_exclude.png') )
|
QIconDB.poly_type_exclude = QIcon ( str(icon_path / 'poly_type_exclude.png') )
|
||||||
QIconDB.left = QIcon ( str(icon_path / 'left.png') )
|
QIconDB.left = QIcon ( str(icon_path / 'left.png') )
|
||||||
QIconDB.right = QIcon ( str(icon_path / 'right.png') )
|
QIconDB.right = QIcon ( str(icon_path / 'right.png') )
|
||||||
|
QIconDB.trashcan = QIcon ( str(icon_path / 'trashcan.png') )
|
||||||
QIconDB.pt_edit_mode = QIcon ( str(icon_path / 'pt_edit_mode.png') )
|
QIconDB.pt_edit_mode = QIcon ( str(icon_path / 'pt_edit_mode.png') )
|
||||||
QIconDB.view_lock_center = QIcon ( str(icon_path / 'view_lock_center.png') )
|
QIconDB.view_lock_center = QIcon ( str(icon_path / 'view_lock_center.png') )
|
||||||
QIconDB.view_baked = QIcon ( str(icon_path / 'view_baked.png') )
|
QIconDB.view_baked = QIcon ( str(icon_path / 'view_baked.png') )
|
||||||
|
|
|
@ -85,6 +85,11 @@ class QStringDB():
|
||||||
'zh' : '保存并转到下一张图片\n按住SHIFT : 加快\n按住CTRL : 跳过未标记的\n',
|
'zh' : '保存并转到下一张图片\n按住SHIFT : 加快\n按住CTRL : 跳过未标记的\n',
|
||||||
}[lang]
|
}[lang]
|
||||||
|
|
||||||
|
QStringDB.btn_delete_image_tip = { 'en' : 'Delete and Next image\n',
|
||||||
|
'ru' : 'Удалить и следующее изображение\n',
|
||||||
|
'zh' : '清除并转到下一张图片',
|
||||||
|
}[lang]
|
||||||
|
|
||||||
QStringDB.loading_tip = {'en' : 'Loading',
|
QStringDB.loading_tip = {'en' : 'Loading',
|
||||||
'ru' : 'Загрузка',
|
'ru' : 'Загрузка',
|
||||||
'zh' : '正在载入',
|
'zh' : '正在载入',
|
||||||
|
|
|
@ -1342,6 +1342,14 @@ class MainWindow(QXMainWindow):
|
||||||
self.update_cached_images()
|
self.update_cached_images()
|
||||||
self.update_preview_bar()
|
self.update_preview_bar()
|
||||||
|
|
||||||
|
def delete_current_image(self):
|
||||||
|
self.process_next_image()
|
||||||
|
|
||||||
|
img_path = self.image_paths_done.pop(-1)
|
||||||
|
Path(img_path).unlink()
|
||||||
|
self.update_cached_images()
|
||||||
|
self.update_preview_bar()
|
||||||
|
|
||||||
def initialize_ui(self):
|
def initialize_ui(self):
|
||||||
|
|
||||||
self.canvas = QCanvas()
|
self.canvas = QCanvas()
|
||||||
|
@ -1356,12 +1364,19 @@ class MainWindow(QXMainWindow):
|
||||||
btn_next_image = QXIconButton(QIconDB.right, QStringDB.btn_next_image_tip, shortcut='D', click_func=self.process_next_image)
|
btn_next_image = QXIconButton(QIconDB.right, QStringDB.btn_next_image_tip, shortcut='D', click_func=self.process_next_image)
|
||||||
btn_next_image.setIconSize(QUIConfig.preview_bar_icon_q_size)
|
btn_next_image.setIconSize(QUIConfig.preview_bar_icon_q_size)
|
||||||
|
|
||||||
|
btn_delete_image = QXIconButton(QIconDB.trashcan, QStringDB.btn_delete_image_tip, shortcut='X', click_func=self.delete_current_image)
|
||||||
|
btn_delete_image.setIconSize(QUIConfig.preview_bar_icon_q_size)
|
||||||
|
|
||||||
|
pad_image = QWidget()
|
||||||
|
pad_image.setFixedSize(QUIConfig.preview_bar_icon_q_size)
|
||||||
|
|
||||||
preview_image_bar_frame_l = QHBoxLayout()
|
preview_image_bar_frame_l = QHBoxLayout()
|
||||||
preview_image_bar_frame_l.setContentsMargins(0,0,0,0)
|
preview_image_bar_frame_l.setContentsMargins(0,0,0,0)
|
||||||
|
preview_image_bar_frame_l.addWidget ( pad_image, alignment=Qt.AlignCenter)
|
||||||
preview_image_bar_frame_l.addWidget ( btn_prev_image, alignment=Qt.AlignCenter)
|
preview_image_bar_frame_l.addWidget ( btn_prev_image, alignment=Qt.AlignCenter)
|
||||||
preview_image_bar_frame_l.addWidget ( image_bar)
|
preview_image_bar_frame_l.addWidget ( image_bar)
|
||||||
preview_image_bar_frame_l.addWidget ( btn_next_image, alignment=Qt.AlignCenter)
|
preview_image_bar_frame_l.addWidget ( btn_next_image, alignment=Qt.AlignCenter)
|
||||||
|
preview_image_bar_frame_l.addWidget ( btn_delete_image, alignment=Qt.AlignCenter)
|
||||||
|
|
||||||
preview_image_bar_frame = QFrame()
|
preview_image_bar_frame = QFrame()
|
||||||
preview_image_bar_frame.setSizePolicy ( QSizePolicy.Fixed, QSizePolicy.Fixed )
|
preview_image_bar_frame.setSizePolicy ( QSizePolicy.Fixed, QSizePolicy.Fixed )
|
||||||
|
|
BIN
XSegEditor/gfx/icons/trashcan.png
Normal file
BIN
XSegEditor/gfx/icons/trashcan.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue