Skip to content

Feat: Misc Update #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions Editor/Qml/EComboBox.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic

ComboBox {
id: root
model: model

implicitWidth: 100
implicitHeight: 30

indicator: Canvas {
id: canvas
x: root.width - width - root.rightPadding
y: root.topPadding + (root.availableHeight - height) / 2
width: 10
height: 6
contextType: "2d"

Connections {
target: root
function onPressedChanged() { canvas.requestPaint(); }
}

onPaint: {
context.reset();
context.moveTo(0, 0);
context.lineTo(width, 0);
context.lineTo(width / 2, height);
context.closePath();
context.fillStyle = ETheme.fontColor
context.fill();
}
}

contentItem: Text {
leftPadding: 10
rightPadding: root.indicator.width + root.spacing

text: root.displayText
font.pixelSize: ETheme.contentFontSize
font.family: ETheme.fontFamily
color: ETheme.fontColor
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}

background: Rectangle {
width: root.width
height: root.height
radius: 5
color: ETheme.primaryBgColor
}

popup: Popup {
y: root.height - 1
width: root.width
height: Math.min(contentItem.implicitHeight, root.Window.height - topMargin - bottomMargin)
padding: 1

contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: root.popup.visible ? root.delegateModel : null
currentIndex: root.highlightedIndex

ScrollIndicator.vertical: ScrollIndicator { }
}

background: Rectangle {
radius: 5
color: ETheme.primaryBgColor
}
}
}
24 changes: 24 additions & 0 deletions Editor/Qml/EWidgetSamples.qml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,30 @@ Rectangle {
}
}
}

RowLayout {
Layout.leftMargin: 5
Layout.topMargin: 15
EText {
text: 'ComboBox'
style: EText.Style.Title1
}
}

ColumnLayout {
Layout.margins: 5

RowLayout {
EComboBox {
model: ['a', 'b', 'c']
}

EText {
Layout.leftMargin: 5
text: 'Default'
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion ThirdParty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Setup3rdPackage(
VERSION ${QT_VERSION}
HASH
Windows e2a573a53b6de88c0ce768868bd5a8258d432ad71c45a407afa55243b051668f
Darwin 2fadcb1f07e5f11d4345e7d5631f35f8f4a8033c35901fb20a22c2feb7486e57
Darwin b2ac69968f52c5174749e602ce567f4aa429d131921aa11e5577fa46759cf05b
PREFIX
Windows $<SOURCE_DIR>/6.5.2/msvc2019_64
Darwin $<SOURCE_DIR>/6.5.2/macos
Expand Down
Loading