mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 20:54:15 +02:00
[arch] improvement -> increasing PKGBUILD editing dialog dimensions
This commit is contained in:
@@ -157,7 +157,7 @@ class TextInputComponent(ViewComponent):
|
||||
|
||||
def __init__(self, label: str, value: str = '', placeholder: str = None, tooltip: str = None, read_only: bool =False,
|
||||
id_: str = None, only_int: bool = False, max_width: int = -1, type_: TextInputType = TextInputType.SINGLE_LINE,
|
||||
capitalize_label: bool = True):
|
||||
capitalize_label: bool = True, min_width: int = -1, min_height: int = -1):
|
||||
super(TextInputComponent, self).__init__(id_=id_)
|
||||
self.label = label
|
||||
self.value = value
|
||||
@@ -168,6 +168,8 @@ class TextInputComponent(ViewComponent):
|
||||
self.max_width = max_width
|
||||
self.type = type_
|
||||
self.capitalize_label = capitalize_label
|
||||
self.min_width = min_width
|
||||
self.min_height = min_height
|
||||
|
||||
def get_value(self) -> str:
|
||||
if self.value is not None:
|
||||
|
||||
@@ -1596,7 +1596,8 @@ class ArchManager(SoftwareManager):
|
||||
with open(pkgbuild_path) as f:
|
||||
pkgbuild = f.read()
|
||||
|
||||
pkgbuild_input = TextInputComponent(label='', value=pkgbuild, type_=TextInputType.MULTIPLE_LINES)
|
||||
pkgbuild_input = TextInputComponent(label='', value=pkgbuild, type_=TextInputType.MULTIPLE_LINES,
|
||||
min_width=500, min_height=350)
|
||||
|
||||
watcher.request_confirmation(title='PKGBUILD ({})'.format(pkgname),
|
||||
body='',
|
||||
|
||||
@@ -475,6 +475,12 @@ class TextInputQt(QGroupBox):
|
||||
if model.placeholder:
|
||||
self.text_input.setPlaceholderText(model.placeholder)
|
||||
|
||||
if model.min_width >= 0:
|
||||
self.text_input.setMinimumWidth(model.min_width)
|
||||
|
||||
if model.min_height >= 0:
|
||||
self.text_input.setMinimumHeight(model.min_height)
|
||||
|
||||
if model.tooltip:
|
||||
self.text_input.setToolTip(model.tooltip)
|
||||
|
||||
@@ -799,6 +805,12 @@ class FormQt(QGroupBox):
|
||||
def _new_text_input(self, c: TextInputComponent) -> Tuple[QLabel, QLineEdit]:
|
||||
view = QLineEditObserver() if c.type == TextInputType.SINGLE_LINE else QPlainTextEditObserver()
|
||||
|
||||
if c.min_width >= 0:
|
||||
view.setMinimumWidth(c.min_width)
|
||||
|
||||
if c.min_height >= 0:
|
||||
view.setMinimumHeight(c.min_height)
|
||||
|
||||
if c.only_int:
|
||||
view.setValidator(QIntValidator())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user