c36618e1e842ee3cd84de927e963287868edead9 Merge parents 14bf08e b970346 max Wed Aug 25 02:16:31 2021 -0700 Merge branch 'ui-track-icons' diff --cc src/hg/hgTracks/hgTracks.c index a661d59,b3974aa..60cc987 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@@ -8010,40 -8001,80 +8010,81 @@@ } static void printMultiRegionButton() /* Print button that launches multi-region configuration pop-up */ { boolean isPressed = FALSE; if (differentString(virtModeType, "default")) isPressed = TRUE; char buf[256]; safef(buf, sizeof buf, "configure %s multi-region display mode", isPressed ? "or exit" : ""); hButtonNoSubmitMaybePressed("hgTracksConfigMultiRegionPage", "multi-region", buf, "popUpHgt.hgTracks('multi-region config'); return false;", isPressed); } + static void printTrackLink(struct track *track) + /* print a link hgTrackUi with shortLabel and various icons and mouseOvers */ + { + if (track->hasUi) + { + char *url = trackUrl(track->track, chromName); + char *longLabel = replaceChars(track->longLabel, "\"", """); + // Print an icon before the title when one is defined + hPrintPennantIcon(track->tdb); + + struct dyString *dsMouseOver = dyStringCreate("%s", longLabel); + struct trackDb *tdb = track->tdb; + + if (tdb->children) + { + dyStringPrintf(dsMouseOver, " - this is a container track with %d subtracks of different types (super track)", + slCount(tdb->children)); + } + else if (tdb->subtracks) + { + dyStringPrintf(dsMouseOver, " - this is a container track with %d subtracks of similar types (composite track)", + slCount(tdb->subtracks)); + } + + hPrintf("", url, dyStringCannibalize(&dsMouseOver)); + + freeMem(url); + freeMem(longLabel); + } + + // show the folder icon from the font-awesome collection. + // the icon collection also contains a "fa fa-folder-o" icon, which is the outline. It was decided to use only the filled out icon for now. + if (tdbIsSuper(track->tdb) || tdbIsComposite(track->tdb)) + hPrintf(""); + + hPrintf(" %s", track->shortLabel); + hPrintf("
"); + if (track->hasUi) + hPrintf("
"); + } + void doTrackForm(char *psOutput, struct tempName *ideoTn) /* Make the tracks display form with the zoom/scroll buttons and the active * image. If the ideoTn parameter is not NULL, it is filled in if the * ideogram is created. */ { struct group *group; struct track *track; char *freezeName = NULL; boolean hideAll = cgiVarExists("hgt.hideAll"); +boolean hideTracks = cgiOptionalString( "hideTracks") != NULL; boolean defaultTracks = cgiVarExists("hgt.reset"); boolean showedRuler = FALSE; boolean showTrackControls = cartUsualBoolean(cart, "trackControlsOnMain", TRUE); boolean multiRegionButtonTop = cfgOptionBooleanDefault(MULTI_REGION_CFG_BUTTON_TOP, FALSE); long thisTime = 0, lastTime = 0; basesPerPixel = ((float)virtWinBaseCount) / ((float)fullInsideWidth); zoomedToBaseLevel = (virtWinBaseCount <= fullInsideWidth / tl.mWidth); zoomedToCodonLevel = (ceil(virtWinBaseCount/3) * tl.mWidth) <= fullInsideWidth; zoomedToCodonNumberLevel = (ceil(virtWinBaseCount/3) * tl.mWidth * 5) <= fullInsideWidth; zoomedToCdsColorLevel = (virtWinBaseCount <= fullInsideWidth*3); if (psOutput != NULL) { hPrintDisable();