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("<INPUT TYPE='button' id='ct_add' VALUE='%s' title='%s'>",
+        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("<TD COLSPAN=6 ALIGN=left NOWRAP>");
     hPrintf("move start<BR>");
     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("</TD>");
     hPrintf("<td width='30'>&nbsp;</td>\n");
 #endif//ndef USE_NAVIGATION_LINKS
     hPrintf("<TD class='infoText' COLSPAN=15 style=\"white-space:normal\">"); // 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("</TD>");
 #ifndef USE_NAVIGATION_LINKS
     hPrintf("<td width='30'>&nbsp;</td>\n");
     hPrintf("<TD COLSPAN=6 ALIGN=right NOWRAP>");
     hPrintf("move end<BR>");
     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("</TD>");
 #endif//ndef USE_NAVIGATION_LINKS
     hPrintf("</TR></TABLE>\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("&nbsp;");
-    hButtonWithMsg("hgt.defaultImgOrder", "default order",
-                   "Display current tracks in their default order");
-    // if (showTrackControls)  - always show "hide all", Hiram 2008-06-26
-        {
-        hPrintf("&nbsp;");
-        hButtonWithMsg("hgt.hideAll", "hide all","Hide all currently visibile tracks");
-        }
-
-    hPrintf(" ");
-    hPrintf("<INPUT TYPE='button' id='ct_add' VALUE='%s' title='%s'>",
-            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("<INPUT TYPE='button' id='th_form' VALUE='track hubs' title='Import tracks from hubs'>");
-	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("<BR>\n");
 
     if( chromosomeColorsMade )
         {
         hPrintf("<B>Chromosome Color Key:</B><BR> ");
         hPrintf("<IMG SRC = \"../images/new_colorchrom.gif\" BORDER=1 WIDTH=596 HEIGHT=18 ><BR>\n");
         }
     if (doPliColors)
         {
         hPrintf("<B>gnomAD Loss-of-Function Constraint (LOEUF) Color Key:</B><BR> ");
         hPrintf("<table style=\"border: 1px solid black\"><tr>\n");
         hPrintf("<td style=\"background-color:rgb(244,0,2)\">&lt; 0.1</td>\n");
         hPrintf("<td style=\"background-color:rgb(240,74,3)\">&lt; 0.2</td>\n");
         hPrintf("<td style=\"background-color:rgb(233,127,5)\">&lt; 0.3</td>\n");
         hPrintf("<td style=\"background-color:rgb(224,165,8)\">&lt; 0.4</td>\n");
         hPrintf("<td style=\"background-color:rgb(210,191,13)\">&lt; 0.5</td>\n");
@@ -9042,35 +9029,34 @@
         hPrintf("</tr></table>\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("<table border=0 cellspacing=1 cellpadding=1 width=%d>\n", CONTROL_TABLE_WIDTH);
         hPrintf("<tr><td align='left'>\n");
 
         hButtonWithOnClick("hgt.collapseGroups", "collapse all", "collapse all track groups",
                            "return vis.expandAllGroups(false)");
         hPrintf("</td>");
 
-        hPrintf("<td colspan='%d' class='infoText' align='CENTER' nowrap>"
-                "Use drop-down controls below and press refresh to alter tracks "
-                "displayed.<BR>"
-                "Tracks with lots of items will automatically be displayed in "
-                "more compact modes.</td>\n", MAX_CONTROL_COLUMNS - 2);
+        hPrintf("<td colspan='%d' class='infoText' align='CENTER' nowrap>\n", MAX_CONTROL_COLUMNS - 2);
+
+        printShortcutButtons(cart, hasCustomTracks, revCmplDisp, multiRegionButtonTop);
+        hPrintf("</td>\n");
 
         hPrintf("<td align='right'>");
         hButtonWithOnClick("hgt.expandGroups", "expand all", "expand all track groups",
                            "return vis.expandAllGroups(true)");
         hPrintf("</td></tr>");
 
         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 */