mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-01 15:49:09 +00:00
feat: extend PanelModal to allow for translation
This commit is contained in:
@@ -16,8 +16,8 @@ class PanelModal(QWidget):
|
||||
def __init__(
|
||||
self,
|
||||
widget,
|
||||
title: str,
|
||||
window_title: str,
|
||||
title: str = "",
|
||||
window_title: str = "",
|
||||
done_callback: Callable | None = None,
|
||||
save_callback: Callable | None = None,
|
||||
has_save: bool = False,
|
||||
@@ -36,7 +36,7 @@ class PanelModal(QWidget):
|
||||
self.title_widget.setObjectName("fieldTitle")
|
||||
self.title_widget.setWordWrap(True)
|
||||
self.title_widget.setStyleSheet("font-weight:bold;" "font-size:14px;" "padding-top: 6px")
|
||||
self.title_widget.setText(title)
|
||||
self.setTitle(title)
|
||||
self.title_widget.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
|
||||
self.button_container = QWidget()
|
||||
@@ -95,6 +95,9 @@ class PanelModal(QWidget):
|
||||
self.done_button.click()
|
||||
event.accept()
|
||||
|
||||
def setTitle(self, title: str): # noqa: N802
|
||||
self.title_widget.setText(title)
|
||||
|
||||
|
||||
class PanelWidget(QWidget):
|
||||
"""Used for widgets that go in a modal panel, ex. for editing or searching."""
|
||||
|
||||
Reference in New Issue
Block a user