83b751ac37696b83777d2fe6939e4571e7da0bd4 max Mon Jun 12 06:28:58 2023 -0700 adding little trash icons next to custom tracks for quicker disposal, refs #31504 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index f3f5b49..5c741cb 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -128,31 +128,31 @@ boolean withIdeogram = TRUE; /* Display chromosome ideogram? */ int rulerMode = tvHide; /* on, off, full */ struct hvGfx *hvgSide = NULL; // Extra pointer to a sideLabel image that can be built if needed char *rulerMenu[] = /* dropdown for ruler visibility */ { "hide", "dense", "full" }; char *protDbName; /* Name of proteome database for this genome. */ -#define MAX_CONTROL_COLUMNS 6 +#define MAX_CONTROL_COLUMNS 8 #define LOW 1 #define MEDIUM 2 #define BRIGHT 3 #define MAXCHAINS 50000000 boolean hgDebug = FALSE; /* Activate debugging code. Set to true by hgDebug=on in command line*/ int imagePixelHeight = 0; struct hash *oldVars = NULL; struct jsonElement *jsonForClient = NULL; boolean hideControls = FALSE; /* Hide all controls? */ boolean trackImgOnly = FALSE; /* caller wants just the track image and track table html */ boolean ideogramToo = FALSE; /* caller wants the ideoGram (when requesting just one track) */ /* Structure returned from resolvePosition. * We use this to to expand any tracks to full @@ -8230,60 +8230,71 @@ } 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 printTrackDelIcon(struct track *track) +/* little track icon after track name. Github uses SVG elements for all icons, apparently that is faster */ +{ + hPrintf("
", track->track); + +} + 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, "\"", """); struct dyString *dsMouseOver = dyStringCreate("%s", longLabel); struct trackDb *tdb = track->tdb; if (tdbIsSuper(tdb)) dyStringPrintf(dsMouseOver, " - this is a container track with %d subtracks of different types " "(super track)", slCount(tdb->children)); else if (tdbIsComposite(tdb)) dyStringPrintf(dsMouseOver, " - this is a container track with %d subtracks of similar types " "(composite track)", slCount(tdb->subtracks)); // Print icons before the title when any are defined hPrintIcons(track->tdb); - hPrintf("", url, dyStringCannibalize(&dsMouseOver)); + hPrintf("", url, track->groupName, track->track, dyStringCannibalize(&dsMouseOver)); freeMem(url); freeMem(longLabel); } hPrintf("%s", track->shortLabel); if (track->hasUi) hPrintf(""); + +if (sameOk(track->groupName, "user")) + printTrackDelIcon(track); + hPrintf("
"); } void printSearchHelpLink() /* print the little search help link next to the go button */ { char *url = cfgOptionDefault("searchHelpUrl","../goldenPath/help/query.html"); char *label = cfgOptionDefault("searchHelpLabel", "examples"); if (!url || isEmpty(url)) return; printf("
%s
", url, label); } static void printDatabaseInfoHtml(char* database) @@ -9347,30 +9358,31 @@ controlGridEndCell(cg); freeMem(url); } /* Add supertracks to track list, sort by priority and * determine if they have visible member tracks */ groupTrackListAddSuper(cart, group, superHash); /* Display track controls */ if (group->errMessage) { myControlGridStartCell(cg, isOpen, group->name); hPrintf("%s", group->errMessage); controlGridEndCell(cg); } + for (tr = group->trackList; tr != NULL; tr = tr->next) { struct track *track = tr->track; if (tdbIsSuperTrackChild(track->tdb)) /* don't display supertrack members */ continue; myControlGridStartCell(cg, isOpen, group->name); printTrackLink(track); if (hTrackOnChrom(track->tdb, chromName)) { if (tdbIsSuper(track->tdb)) superTrackDropDown(cart, track->tdb, superTrackHasVisibleMembers(track->tdb)); @@ -9378,30 +9390,31 @@ { /* check for option of limiting visibility to one mode */ hTvDropDownClassVisOnly(track->track, track->visibility, rTdbTreeCanPack(track->tdb), (track->visibility == tvHide) ? "hiddenText" : "normalText", trackDbSetting(track->tdb, "onlyVisibility")); } } else /* If track is not on this chrom print an informational message for the user. */ hPrintf("[No data-%s]", chromName); controlGridEndCell(cg); } + /* now finish out the table */ if (group->next != NULL) controlGridEndRow(cg); } hashFree(&superHash); endControlGrid(&cg); } if (measureTiming) printTrackTiming(); hPrintf("\n"); } if (showTrackControls) hButton("hgt.refresh", "refresh");