Skip to content

Commit

Permalink
Merge pull request #910 from Capsize-Games/devastator
Browse files Browse the repository at this point in the history
image filter fixes
  • Loading branch information
w4ffl35 authored Oct 8, 2024
2 parents 5347561 + cae8ef0 commit aa12261
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
7 changes: 6 additions & 1 deletion src/airunner/widgets/canvas/custom_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def current_active_image(self) -> Image:
except PIL.UnidentifiedImageError:
return None

@current_active_image.setter
def current_active_image(self, image: Image):
self._update_current_settings("image", convert_image_to_base64(image))
self.initialize_image(image)

@image_pivot_point.setter
def image_pivot_point(self, value):
self.emit_signal(SignalCode.LAYER_UPDATE_CURRENT_SIGNAL, {
Expand Down Expand Up @@ -179,7 +184,7 @@ def on_load_image_signal(self, image_path: str):
image = self._load_image(image_path)
if self.application_settings.resize_on_paste:
image = self._resize_image(image)
self.initialize_image(image)
self.current_active_image = image

def on_apply_filter_signal(self, message):
self._apply_filter(message)
Expand Down
7 changes: 0 additions & 7 deletions src/airunner/windows/filter_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ def showEvent(self, event):
)
self.ui.content.layout().addWidget(slider_spinbox_widget)

self.ui.auto_apply.setChecked(self.image_filter.auto_apply)
self.ui.auto_apply.clicked.connect(partial(self.handle_auto_apply_toggle))

self.setWindowTitle(self.window_title)

self.preview_filter()
Expand All @@ -103,10 +100,6 @@ def filter_object(self):
self._filter = class_(**kwargs)
return self._filter

def handle_auto_apply_toggle(self):
self.image_filter.auto_apply = self.ui.auto_apply.isChecked()
self.session.commit()

def reject(self):
self.emit_signal(
SignalCode.CANVAS_CANCEL_FILTER_SIGNAL
Expand Down
13 changes: 0 additions & 13 deletions src/airunner/windows/filter_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@
<layout class="QGridLayout" name="gridLayout_2"/>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="auto_apply">
<property name="font">
<font>
<pointsize>8</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Auto Apply Filter</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
Expand Down
16 changes: 3 additions & 13 deletions src/airunner/windows/filter_window_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QAbstractButton, QApplication, QCheckBox, QDialog,
QDialogButtonBox, QFrame, QGridLayout, QSizePolicy,
QSpacerItem, QWidget)
from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox,
QFrame, QGridLayout, QSizePolicy, QSpacerItem,
QWidget)

class Ui_filter_window(object):
def setupUi(self, filter_window):
Expand Down Expand Up @@ -46,15 +46,6 @@ def setupUi(self, filter_window):

self.gridLayout.addWidget(self.content, 0, 0, 1, 2)

self.auto_apply = QCheckBox(filter_window)
self.auto_apply.setObjectName(u"auto_apply")
font1 = QFont()
font1.setPointSize(8)
font1.setBold(True)
self.auto_apply.setFont(font1)

self.gridLayout.addWidget(self.auto_apply, 1, 0, 1, 1)

self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)

self.gridLayout.addItem(self.verticalSpacer, 2, 1, 1, 1)
Expand All @@ -69,6 +60,5 @@ def setupUi(self, filter_window):

def retranslateUi(self, filter_window):
filter_window.setWindowTitle(QCoreApplication.translate("filter_window", u"Dialog", None))
self.auto_apply.setText(QCoreApplication.translate("filter_window", u"Auto Apply Filter", None))
# retranslateUi

0 comments on commit aa12261

Please sign in to comment.