-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] GraphEditor: Move ChoiceParam control to its own file
Start modularization of attribute controls for better readability and maintenance. Make Choice control independent from the MeshroomUI API.
- Loading branch information
Showing
2 changed files
with
43 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
|
||
import MaterialIcons | ||
import Controls | ||
|
||
/** | ||
* A combobox-type control with a single current `value` and a list of possible `values`. | ||
* Provides filtering capabilities and support for custom values (i.e: `value` not in `values`). | ||
*/ | ||
RowLayout { | ||
id: root | ||
|
||
required property var value | ||
required property var values | ||
|
||
signal editingFinished(var value) | ||
|
||
FilterComboBox { | ||
id: comboBox | ||
|
||
Layout.fillWidth: true | ||
sourceModel: root.values | ||
inputValue: root.value | ||
onEditingFinished: value => root.editingFinished(value) | ||
} | ||
|
||
MaterialLabel { | ||
visible: !comboBox.validValue | ||
text: MaterialIcons.warning | ||
ToolTip.text: "Custom value detected" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters