mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 21:29:12 +00:00
Create, Use a Labelled Text Field for the Conversation Input Field
- This fixes the field expanding when configure screen is expanded - Allows for reusability of the labelled text field - Simplifies the logic to save settings for conversation processor
This commit is contained in:
25
src/interface/desktop/labelled_text_field.py
Normal file
25
src/interface/desktop/labelled_text_field.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# External Packages
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
# Internal Packages
|
||||
from src.utils.config import ProcessorType
|
||||
|
||||
|
||||
class LabelledTextField(QtWidgets.QWidget):
|
||||
def __init__(self, title, processor_type: ProcessorType=None, default_value: str=None):
|
||||
QtWidgets.QWidget.__init__(self)
|
||||
layout = QtWidgets.QHBoxLayout()
|
||||
self.setLayout(layout)
|
||||
self.processor_type = processor_type
|
||||
|
||||
self.label = QtWidgets.QLabel()
|
||||
self.label.setText(title)
|
||||
self.label.setFixedWidth(95)
|
||||
layout.addWidget(self.label)
|
||||
|
||||
self.input_field = QtWidgets.QLineEdit(self)
|
||||
self.input_field.setFixedWidth(250)
|
||||
self.input_field.setText(default_value)
|
||||
|
||||
layout.addWidget(self.input_field)
|
||||
layout.addStretch()
|
||||
Reference in New Issue
Block a user