Skip to content

Commit

Permalink
Fix issue with text disappearing in 1-line widget #59
Browse files Browse the repository at this point in the history
can't seem to disable scroll in text edit, so replacing with line edit
  • Loading branch information
Acly committed Nov 18, 2023
1 parent 00ac67e commit 8d0102a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ai_diffusion/ui/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
QPlainTextEdit,
QGroupBox,
QLabel,
QLineEdit,
QProgressBar,
QSizePolicy,
QListWidget,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 != "")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8d0102a

Please sign in to comment.