Skip to content

Commit

Permalink
Refs #19533: [ARS] Improve entities width management
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso committed Oct 24, 2023
1 parent b2c9950 commit ee58d16
Showing 1 changed file with 41 additions and 10 deletions.
51 changes: 41 additions & 10 deletions qml/DomainGraphLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -456,19 +456,26 @@ Item
function resize()
{
var listViewHeight = 0
var aux_width = entity_box_width_

// iterate over each element in the list item
for (var c = 0; c < hostsList.count; c++)
{
hostsList.currentIndex = c
if (hostsList.currentItem != null)
{
listViewHeight += hostsList.currentItem.height + elements_spacing_
entity_box_width_ = Math.max(entity_box_width_, hostsList.currentItem.width)
aux_width = Math.max(aux_width, hostsList.currentItem.width)
}
}

hostsList.height = listViewHeight
hostsList.width = entity_box_width_

// update if necessary
if (aux_width > entity_box_width_)
{
entity_box_width_ = aux_width
}
}

// Host delegated item box
Expand Down Expand Up @@ -576,6 +583,7 @@ Item
function resize()
{
var listViewHeight = 0
var aux_width = entity_box_width_

// iterate over each element in the list item
for (var c = 0; c < usersList.count; c++)
Expand All @@ -584,12 +592,17 @@ Item
if (usersList.currentItem != null)
{
listViewHeight += usersList.currentItem.height + elements_spacing_
entity_box_width_ = Math.max(entity_box_width_, usersList.currentItem.width+(2*elements_spacing_))
aux_width = Math.max(aux_width, usersList.currentItem.width+(2*elements_spacing_))
}
}

usersList.height = listViewHeight + elements_spacing_
usersList.width = entity_box_width_-(2*elements_spacing_)

// update if necessary
if (aux_width > entity_box_width_)
{
entity_box_width_ = aux_width
}
}

// User delegated item box
Expand Down Expand Up @@ -698,6 +711,7 @@ Item
function resize()
{
var listViewHeight = 0
var aux_width = entity_box_width_

// iterate over each element in the list item
for (var c = 0; c < processesList.count; c++)
Expand All @@ -706,12 +720,17 @@ Item
if (processesList.currentItem != null)
{
listViewHeight += processesList.currentItem.height + elements_spacing_
entity_box_width_ = Math.max(entity_box_width_, processesList.currentItem.width+(4*elements_spacing_))
aux_width = Math.max(aux_width, processesList.currentItem.width+(4*elements_spacing_))
}
}

processesList.height = listViewHeight + elements_spacing_
processesList.width = entity_box_width_-(4*elements_spacing_)

// update if necessary
if (aux_width > entity_box_width_)
{
entity_box_width_ = aux_width
}
}

// Process delegated item box
Expand Down Expand Up @@ -820,6 +839,7 @@ Item
function resize()
{
var listViewHeight = 0
var aux_width = entity_box_width_

// iterate over each element in the list item
for (var c = 0; c < participantsList.count; c++)
Expand All @@ -828,12 +848,17 @@ Item
if (participantsList.currentItem != null)
{
listViewHeight += participantsList.currentItem.height + elements_spacing_
entity_box_width_ = Math.max(entity_box_width_, participantsList.currentItem.width+(6*elements_spacing_))
aux_width = Math.max(aux_width, participantsList.currentItem.width+(6*elements_spacing_))
}
}

participantsList.height = listViewHeight + elements_spacing_
participantsList.width = entity_box_width_-(6*elements_spacing_)

// update if necessary
if (aux_width > entity_box_width_)
{
entity_box_width_ = aux_width
}
}

// Participant delegated item box
Expand Down Expand Up @@ -940,6 +965,7 @@ Item
function resize()
{
var listViewHeight = 0
var aux_width = entity_box_width_

// iterate over each element in the list item
for (var c = 0; c < endpointsList.count; c++)
Expand All @@ -948,12 +974,17 @@ Item
if (endpointsList.currentItem != null)
{
listViewHeight += endpointsList.currentItem.height + elements_spacing_
entity_box_width_ = Math.max(entity_box_width_, endpointsList.currentItem.width+(8*elements_spacing_))
aux_width = Math.max(aux_width, endpointsList.currentItem.width+(8*elements_spacing_))
}
}

endpointsList.height = listViewHeight + elements_spacing_
endpointsList.width = entity_box_width_-(8*elements_spacing_)

// update if necessary
if (aux_width > entity_box_width_)
{
entity_box_width_ = aux_width
}
}

function record_connections()
Expand Down

0 comments on commit ee58d16

Please sign in to comment.