Skip to content

Commit

Permalink
chore: replacing a way to get listview's item
Browse files Browse the repository at this point in the history
it's useful for combobox to fillWidth  by max'width.

pms: TASK-368399
  • Loading branch information
18202781743 committed Feb 27, 2025
1 parent 5d308ae commit 38da3f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
5 changes: 1 addition & 4 deletions qt6/src/qml/ArrowListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ FocusScope {
implicitHeight: Math.min(contentHeight, maxVisibleItems * itemHeight)
implicitWidth:{
var maxWidth = DS.Style.arrowListView.width
if (!itemsView.model || !itemsView.model.hasOwnProperty("get"))
return maxWidth

for (var i = 0; i < itemsView.count; ++i) {
var item = itemsView.model.get(i)
var item = itemsView.itemAtIndex(i)
if (item && item.implicitWidth > maxWidth)
maxWidth = item.implicitWidth
}
Expand Down
13 changes: 0 additions & 13 deletions qt6/src/qml/Menu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ T.Menu {
view.currentIndex: control.currentIndex
maxVisibleItems: control.maxVisibleItems
itemHeight: DS.Style.menu.item.height

function refreshContentItemWidth()
{
for (var i = 0; i < view.count; ++i) {
var item = view.model.get(i)
if (item) {
item.width = view.width
}
}
}

onCountChanged: refreshContentItemWidth()
onWidthChanged: refreshContentItemWidth()
view.highlightFollowsCurrentItem: true
view.highlightMoveDuration: 50
view.highlightMoveVelocity: -1
Expand Down

0 comments on commit 38da3f7

Please sign in to comment.