Skip to content

Commit

Permalink
Improve hpainter item click
Browse files Browse the repository at this point in the history
If same object clicked second time, it not automatically expand.
Only special classes like TGeoManager will do so
  • Loading branch information
linev committed Oct 18, 2023
1 parent 6f3d168 commit 09d5ae2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/draw.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/HierarchyPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 09d5ae2

Please sign in to comment.