fix: column index desync after reorder
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 33s
Rust / build (pull_request) Successful in 48s
Python / verify (pull_request) Successful in 1m42s
Rust / fmt (pull_request) Successful in 26s
Rust / clippy (pull_request) Successful in 45s
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 33s
Rust / build (pull_request) Successful in 48s
Python / verify (pull_request) Successful in 1m42s
Rust / fmt (pull_request) Successful in 26s
Rust / clippy (pull_request) Successful in 45s
This commit is contained in:
@@ -64,109 +64,83 @@ Item {
|
||||
function onWidthChanged() {
|
||||
root.fillMissingWidths();
|
||||
}
|
||||
|
||||
function onCountChanged() {
|
||||
resizeOverlay.geometryTick++;
|
||||
root.fillMissingWidths();
|
||||
}
|
||||
|
||||
function onContentWidthChanged() {
|
||||
resizeOverlay.geometryTick++;
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: columnsData
|
||||
function onValuesChanged() {
|
||||
root.fillMissingWidths();
|
||||
resizeOverlay.geometryTick++;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: Qt.callLater(fillMissingWidths)
|
||||
Component.onDestruction: Cursor.clearOverride()
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
CustomListView {
|
||||
id: columnList
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
orientation: ListView.Horizontal
|
||||
interactive: false
|
||||
spacing: Tokens.spacing.extraSmall / 2
|
||||
|
||||
CustomListView {
|
||||
id: columnList
|
||||
|
||||
Layout.fillWidth: true
|
||||
orientation: ListView.Horizontal
|
||||
interactive: false
|
||||
spacing: parent.spacing
|
||||
implicitHeight: root.headerHeight
|
||||
|
||||
add: Transition {
|
||||
Anim {
|
||||
from: 0
|
||||
properties: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
add: Transition {
|
||||
Anim {
|
||||
from: 0
|
||||
properties: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
displaced: Transition {
|
||||
Anim {
|
||||
properties: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
Anim {
|
||||
properties: "x"
|
||||
}
|
||||
}
|
||||
displaced: Transition {
|
||||
Anim {
|
||||
properties: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
move: Transition {
|
||||
Anim {
|
||||
properties: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
Anim {
|
||||
properties: "x"
|
||||
}
|
||||
Anim {
|
||||
properties: "x"
|
||||
}
|
||||
remove: Transition {
|
||||
Anim {
|
||||
to: 0
|
||||
properties: "opacity"
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
move: Transition {
|
||||
Anim {
|
||||
properties: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
|
||||
model: DelegateModel {
|
||||
id: columnsVisual
|
||||
|
||||
delegate: ColumnHeaderCell {
|
||||
parentModel: columnsVisual
|
||||
}
|
||||
|
||||
model: ScriptModel {
|
||||
id: columnsData
|
||||
values: Config.dashboard.processColumns.values
|
||||
}
|
||||
Anim {
|
||||
properties: "x"
|
||||
}
|
||||
}
|
||||
remove: Transition {
|
||||
Anim {
|
||||
to: 0
|
||||
properties: "opacity"
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
|
||||
IconButton {
|
||||
id: addColumnBtn
|
||||
model: DelegateModel {
|
||||
id: columnsVisual
|
||||
|
||||
type: IconButton.Text
|
||||
icon: "add"
|
||||
font: Tokens.font.icon.medium
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: ProcessesColumns.hiddenColumns.length > 0
|
||||
onClicked: addMenu.expanded = true
|
||||
}
|
||||
delegate: ColumnHeaderCell {
|
||||
parentModel: columnsVisual
|
||||
}
|
||||
|
||||
Variants {
|
||||
id: hiddenColumnList
|
||||
|
||||
model: ProcessesColumns.hiddenColumns
|
||||
|
||||
HiddenColumnItem {}
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: addMenu
|
||||
|
||||
attachTo: addColumnBtn
|
||||
items: hiddenColumnList.instances
|
||||
onItemSelected: item => ProcessesColumns.addColumn(item.modelData.id)
|
||||
model: ScriptModel {
|
||||
id: columnsData
|
||||
values: Config.dashboard.processColumns.values
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,26 +152,9 @@ Item {
|
||||
property int geometryTick: 0
|
||||
property int activeGapIndex: -1
|
||||
|
||||
anchors.fill: rowLayout
|
||||
anchors.fill: columnList
|
||||
z: 10
|
||||
|
||||
Connections {
|
||||
target: columnsData
|
||||
function onValuesChanged() {
|
||||
resizeOverlay.geometryTick++;
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: columnList
|
||||
function onCountChanged() {
|
||||
resizeOverlay.geometryTick++;
|
||||
}
|
||||
function onContentWidthChanged() {
|
||||
resizeOverlay.geometryTick++;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: Qt.callLater(() => geometryTick++)
|
||||
|
||||
Repeater {
|
||||
@@ -571,8 +528,6 @@ Item {
|
||||
const rightMid = rightItem.x + rightItem.width / 2;
|
||||
if (refX > rightMid) {
|
||||
columnsVisual.items.move(myIndex, myIndex + 1);
|
||||
resizeOverlay.geometryTick++;
|
||||
Qt.callLater(() => resizeOverlay.geometryTick++);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -583,8 +538,6 @@ Item {
|
||||
const pinnedAtZero = columnList.itemAtIndex(0)?.modelData?.id === ProcessesColumns.pinnedColumnId;
|
||||
if (refX < leftMid && !(myIndex === 1 && pinnedAtZero)) {
|
||||
columnsVisual.items.move(myIndex, myIndex - 1);
|
||||
resizeOverlay.geometryTick++;
|
||||
Qt.callLater(() => resizeOverlay.geometryTick++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user