6743beb41fc441dc2c5c37fcd330d280d197c7b0 max Mon Oct 3 14:29:11 2022 -0700 make a few small style changes on hgTracks: removing a few buttons that are hardly used, merging the two help texts, refs #29676 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 85bc217..cb156a0 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -8080,30 +8080,65 @@ } static void printDatabaseInfoHtml(char* database) /* print database-specific piece of HTML defined in hg.conf, works also with Genark hubs */ { char *cfgPrefix = database; if (trackHubDatabase(cfgPrefix)) // hub IDs look like hub_1234_GCA_1232.2, so skip the hub_1234 part cfgPrefix = hubConnectSkipHubPrefix(cfgPrefix); char *cfgName = catTwoStrings(cfgPrefix,"_html"); char *html = cfgOption(cfgName); if (html) puts(html); } +void printShortcutButtons(struct cart *cart, bool hasCustomTracks, bool revCmplDisp, bool multiRegionButtonTop) +/* Display bottom control panel. */ +{ +if (isSearchTracksSupported(database,cart)) + { + cgiMakeButtonWithMsg(TRACK_SEARCH, TRACK_SEARCH_BUTTON,TRACK_SEARCH_HINT); + } + +hPrintf(" "); +hButtonWithMsg("hgt.hideAll", "hide all","Hide all currently visible tracks"); + +hPrintf(" "); +hPrintf("", + hasCustomTracks ? CT_MANAGE_BUTTON_LABEL : CT_ADD_BUTTON_LABEL, + hasCustomTracks ? "Manage your custom tracks" : "Add your own custom tracks"); +jsOnEventById("click", "ct_add", "document.customTrackForm.submit(); return false;"); + +hPrintf(" "); +hButtonWithMsg("hgTracksConfigPage", "configure","Configure image and track selection"); +hPrintf(" "); + +if (!multiRegionButtonTop) + { + printMultiRegionButton(); + hPrintf(" "); + } +hButtonMaybePressed("hgt.toggleRevCmplDisp", "reverse", + revCmplDisp ? "Show forward strand at this location" + : "Show reverse strand at this location", + NULL, revCmplDisp); +hPrintf(" "); + +hButtonWithOnClick("hgt.setWidth", "resize", "Resize image width to browser window size", "hgTracksSetWidth()"); +} + 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, TRUE); long thisTime = 0, lastTime = 0; @@ -8938,98 +8973,50 @@ tl.picWidth, 27); #ifndef USE_NAVIGATION_LINKS hPrintf(""); hPrintf("move start
"); hButtonWithOnClick("hgt.dinkLL", " < ", "move start position to the left", "return imageV2.navigateButtonClick(this);"); hTextVar("dinkL", cartUsualString(cart, "dinkL", "2.0"), 3); hButtonWithOnClick("hgt.dinkLR", " > ", "move start position to the right", "return imageV2.navigateButtonClick(this);"); hPrintf(""); hPrintf(" \n"); #endif//ndef USE_NAVIGATION_LINKS hPrintf(""); // allow this text to wrap hWrites("Click on a feature for details. "); hWrites("Click+shift+drag to zoom in. "); - hWrites("Click side bars for track options. "); + hWrites("Click grey side bars for track options. "); hWrites("Drag side bars or labels up or down to reorder tracks. "); hWrites("Drag tracks left or right to new position. "); hWrites("Press \"?\" for keyboard shortcuts. "); + hWrites("Use drop-down controls below and press refresh to alter tracks displayed. "); + hPrintf(""); #ifndef USE_NAVIGATION_LINKS hPrintf(" \n"); hPrintf(""); hPrintf("move end
"); hButtonWithOnClick("hgt.dinkRL", " < ", "move end position to the left", "return imageV2.navigateButtonClick(this);"); hTextVar("dinkR", cartUsualString(cart, "dinkR", "2.0"), 3); hButtonWithOnClick("hgt.dinkRR", " > ", "move end position to the right", "return imageV2.navigateButtonClick(this);"); hPrintf(""); #endif//ndef USE_NAVIGATION_LINKS hPrintf("\n"); - /* Display bottom control panel. */ - if (isSearchTracksSupported(database,cart)) - { - cgiMakeButtonWithMsg(TRACK_SEARCH, TRACK_SEARCH_BUTTON,TRACK_SEARCH_HINT); - hPrintf(" "); - } - hButtonWithMsg("hgt.reset", "default tracks","Display only default tracks"); - hPrintf(" "); - hButtonWithMsg("hgt.defaultImgOrder", "default order", - "Display current tracks in their default order"); - // if (showTrackControls) - always show "hide all", Hiram 2008-06-26 - { - hPrintf(" "); - hButtonWithMsg("hgt.hideAll", "hide all","Hide all currently visibile tracks"); - } - - hPrintf(" "); - hPrintf("", - hasCustomTracks ? CT_MANAGE_BUTTON_LABEL : CT_ADD_BUTTON_LABEL, - hasCustomTracks ? "Manage your custom tracks" : "Add your own custom tracks"); - jsOnEventById("click", "ct_add", "document.customTrackForm.submit(); return false;"); - - hPrintf(" "); - if (hubConnectTableExists()) - { - hPrintf(""); - jsOnEventById("click", "th_form", "document.trackHubForm.submit();"); - hPrintf(" "); - } - - hButtonWithMsg("hgTracksConfigPage", "configure","Configure image and track selection"); - hPrintf(" "); - - if (!multiRegionButtonTop) - { - printMultiRegionButton(); - hPrintf(" "); - } - hButtonMaybePressed("hgt.toggleRevCmplDisp", "reverse", - revCmplDisp ? "Show forward strand at this location" - : "Show reverse strand at this location", - NULL, revCmplDisp); - hPrintf(" "); - - hButtonWithOnClick("hgt.setWidth", "resize", "Resize image width to browser window size", "hgTracksSetWidth()"); - hPrintf(" "); - - hButtonWithMsg("hgt.refresh", "refresh","Refresh image"); - - hPrintf("
\n"); if( chromosomeColorsMade ) { hPrintf("Chromosome Color Key:
"); hPrintf("
\n"); } if (doPliColors) { hPrintf("gnomAD Loss-of-Function Constraint (LOEUF) Color Key:
"); hPrintf("\n"); hPrintf("\n"); hPrintf("\n"); hPrintf("\n"); hPrintf("\n"); hPrintf("\n"); @@ -9042,35 +9029,34 @@ hPrintf("
< 0.1< 0.2< 0.3< 0.4< 0.5
\n"); } if (showTrackControls) { /* Display viewing options for each track. */ /* Chuck: This is going to be wrapped in a table so that * the controls don't wrap around randomly */ hPrintf("\n", CONTROL_TABLE_WIDTH); hPrintf(""); - hPrintf("\n", MAX_CONTROL_COLUMNS - 2); + hPrintf("\n"); hPrintf(""); cg = startControlGrid(MAX_CONTROL_COLUMNS, "left"); for (group = groupList; group != NULL; group = group->next) { if (group->trackList == NULL) continue; struct trackRef *tr; /* check if group section should be displayed */
\n"); hButtonWithOnClick("hgt.collapseGroups", "collapse all", "collapse all track groups", "return vis.expandAllGroups(false)"); hPrintf("" - "Use drop-down controls below and press refresh to alter tracks " - "displayed.
" - "Tracks with lots of items will automatically be displayed in " - "more compact modes.
\n", MAX_CONTROL_COLUMNS - 2); + + printShortcutButtons(cart, hasCustomTracks, revCmplDisp, multiRegionButtonTop); + hPrintf(""); hButtonWithOnClick("hgt.expandGroups", "expand all", "expand all track groups", "return vis.expandAllGroups(true)"); hPrintf("