From 8d0102a5bf70385d0f3f08d061c1bbcd82360da5 Mon Sep 17 00:00:00 2001 From: Acly Date: Sat, 18 Nov 2023 15:12:58 +0100 Subject: [PATCH] Fix issue with text disappearing in 1-line widget #59 can't seem to disable scroll in text edit, so replacing with line edit --- ai_diffusion/ui/widget.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ai_diffusion/ui/widget.py b/ai_diffusion/ui/widget.py index 0a9bfbe2b..b040978cb 100644 --- a/ai_diffusion/ui/widget.py +++ b/ai_diffusion/ui/widget.py @@ -11,6 +11,7 @@ QPlainTextEdit, QGroupBox, QLabel, + QLineEdit, QProgressBar, QSizePolicy, QListWidget, @@ -1035,8 +1036,8 @@ def __init__(self): self.control_list = ControlListWidget(self) self.control_list.changed.connect(self.change_control) - self.text_prompt = TextPromptWidget(self) - self.text_prompt.line_count = 1 + self.text_prompt = QLineEdit(self) + self.text_prompt.setPlaceholderText("Describe the content you want to see.") self.text_prompt.textChanged.connect(self.change_prompt) self.add_control_button = ControlLayerButton(self) @@ -1081,8 +1082,8 @@ def update(self): self.strength_input.setValue(int(self.model.live.strength * 100)) self.strength_slider.setValue(int(self.model.live.strength * 100)) self.seed_input.setValue(self.model.live.seed) - if self.text_prompt.toPlainText() != self.model.prompt: - self.text_prompt.setPlainText(self.model.prompt) + if self.text_prompt.text() != self.model.prompt: + self.text_prompt.setText(self.model.prompt) self.control_list.value = self.model.control self.error_text.setText(self.model.error) self.error_text.setVisible(self.model.error != "") @@ -1116,7 +1117,7 @@ def randomize_seed(self): self.seed_input.setValue(random.randint(0, 2**31 - 1)) def change_prompt(self): - self.model.prompt = self.text_prompt.toPlainText() + self.model.prompt = self.text_prompt.text() def change_control(self): self.model.control = self.control_list.value