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 25, 2023
1 parent 300c134 commit 54cffcb
Showing 1 changed file with 41 additions and 15 deletions.
56 changes: 41 additions & 15 deletions qml/DomainGraphLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,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_
max_host_width_ = Math.max(max_host_width_, hostsList.currentItem.width)
max_host_width_ = Math.max(max_host_width_, (2*elements_spacing_)+max_user_width_)
hostsList.currentItem.width = max_host_width_
aux_width = Math.max(aux_width, hostsList.currentItem.width)
}
}

hostsList.height = listViewHeight
hostsList.width = max_host_width_

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

// Host delegated item box
Expand Down Expand Up @@ -599,6 +604,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 @@ -607,15 +613,17 @@ Item
if (usersList.currentItem != null)
{
listViewHeight += usersList.currentItem.height + elements_spacing_
max_user_width_ = Math.max(max_user_width_, usersList.currentItem.width)
max_user_width_ = Math.max(max_user_width_, max_process_width_+(2*elements_spacing_))
max_user_width_ = Math.max(max_user_width_, max_host_width_-(2*elements_spacing_))
usersList.currentItem.width = max_user_width_
aux_width = Math.max(aux_width, usersList.currentItem.width+(2*elements_spacing_))
}
}

usersList.height = listViewHeight + elements_spacing_
usersList.width = max_user_width_

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

// User delegated item box
Expand Down Expand Up @@ -730,6 +738,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 @@ -738,12 +747,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 = max_process_width_

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

// Process delegated item box
Expand Down Expand Up @@ -857,6 +871,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 @@ -865,12 +880,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 = max_participant_width_

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

// Participant delegated item box
Expand Down Expand Up @@ -983,6 +1003,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 @@ -991,12 +1012,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 = max_endpoint_width_

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

function record_connections()
Expand Down

0 comments on commit 54cffcb

Please sign in to comment.