Skip to content

Commit

Permalink
Merge branch 'main' into 216-improve-wheel-scrolling-in-node-library
Browse files Browse the repository at this point in the history
  • Loading branch information
s-simoncelli authored Feb 17, 2024
2 parents 57263f1 + 6d88951 commit aa6c3a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion pywr_editor/dialogs/search/search_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __init__(
completer.setCaseSensitivity(Qt.CaseSensitivity.CaseInsensitive)
completer.setFilterMode(Qt.MatchFlag.MatchContains)
completer.setModel(model)
completer.setMaxVisibleItems(10)
completer.popup().setStyleSheet("::item{ padding: 5px }")
# noinspection PyTypeChecker
completer.connect(
completer, SIGNAL("activated(QModelIndex)"), self.open_component
Expand All @@ -60,7 +62,10 @@ def __init__(
line_edit.setStyleSheet("#search_field { font-size: 20px }")

# Description
description = QLabel("Start typing to find and open any model components")
description = QLabel(
"Start typing to find any model components. Click on an item or press ENTER"
" to open its configuration"
)
description.setStyleSheet("font-size: 11px; border: 0")

self.setObjectName("search_dialog")
Expand Down
10 changes: 5 additions & 5 deletions pywr_editor/dialogs/search/search_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, model_config: ModelConfig):
ExtensionIcon(model_config.tables.get_extension(name))
),
"comp_type": None,
"type": ItemType.TABLE,
"type": ItemType.TABLE.value,
}
)
for name in model_config.parameters.names:
Expand All @@ -49,7 +49,7 @@ def __init__(self, model_config: ModelConfig):
"name": name,
"icon": QIcon(ParameterIcon(param_obj.key)),
"comp_type": f"{param_obj.humanised_type} - parameter",
"type": ItemType.PARAMETER,
"type": ItemType.PARAMETER.value,
}
)

Expand All @@ -59,8 +59,8 @@ def __init__(self, model_config: ModelConfig):
{
"name": name,
"icon": QIcon(RecorderIcon(recorder_obj.key)),
"comp_type": f"{recorder_obj.humanised_type} - recorder", #
"type": ItemType.RECORDER,
"comp_type": f"{recorder_obj.humanised_type} - recorder",
"type": ItemType.RECORDER.value,
}
)

Expand All @@ -77,7 +77,7 @@ def __init__(self, model_config: ModelConfig):
"name": name,
"icon": QIcon(icon),
"comp_type": node_obj.humanised_type,
"type": ItemType.NODE,
"type": ItemType.NODE.value,
}
)

Expand Down

0 comments on commit aa6c3a3

Please sign in to comment.