From 09d5ae2e0d71c5befbf639526e2b54560591339c Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Wed, 18 Oct 2023 13:02:48 +0200 Subject: [PATCH] Improve hpainter item click If same object clicked second time, it not automatically expand. Only special classes like TGeoManager will do so --- modules/draw.mjs | 2 +- modules/gui/HierarchyPainter.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/draw.mjs b/modules/draw.mjs index 0ab3b41c9..2627d3318 100644 --- a/modules/draw.mjs +++ b/modules/draw.mjs @@ -121,7 +121,7 @@ drawFuncs = { lst: [ { name: 'TEveGeoShapeExtract', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;dflt' }, { name: nsREX+'REveGeoShapeExtract', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;dflt' }, { name: 'TGeoOverlap', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;dflt', dflt: 'dflt', ctrl: 'expand' }, - { name: 'TGeoManager', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;tracks;no_screen;dflt', dflt: 'expand', ctrl: 'dflt', noappend: true }, + { name: 'TGeoManager', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;tracks;no_screen;dflt', dflt: 'expand', ctrl: 'dflt', noappend: true, exapnd_after_draw: true }, { name: 'TGeoVolumeAssembly', sameas: clTGeoVolume, /* icon: 'img_geoassembly', */ opt: ';more;all;count' }, { name: /^TGeo/, class: () => import_geo().then(h => h.TGeoPainter), get_expand: () => import_geo().then(h => h.expandGeoObject), opt: ';more;all;axis;compa;count;projx;projz;wire;no_screen;dflt', dflt: 'dflt', ctrl: 'expand' }, { name: 'TAxis3D', icon: 'img_graph', draw: () => import_geo().then(h => h.drawAxis3D), direct: true }, diff --git a/modules/gui/HierarchyPainter.mjs b/modules/gui/HierarchyPainter.mjs index 51f6e7dd4..cf32451ad 100644 --- a/modules/gui/HierarchyPainter.mjs +++ b/modules/gui/HierarchyPainter.mjs @@ -1624,7 +1624,7 @@ class HierarchyPainter extends BasePainter { if (can_draw && can_expand && !drawopt) { // if default action specified as expand, disable drawing // if already displayed, try to expand - if (dflt_expand || (handle?.dflt === 'expand') || this.isItemDisplayed(itemname)) can_draw = false; + if (dflt_expand || (handle?.dflt === 'expand') || (handle?.exapnd_after_draw && this.isItemDisplayed(itemname))) can_draw = false; } if (can_draw && !drawopt)