]> git.donarmstrong.com Git - lilypond.git/commitdiff
Web: tweak the second-level navigation bar first button
authorJohn Mandereau <john.mandereau@gmail.com>
Sun, 10 Jan 2010 23:45:17 +0000 (00:45 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Sun, 10 Jan 2010 23:51:07 +0000 (00:51 +0100)
Make this button behave the same way as all others w.r.t. active state
and hovering.  Reorder style definitions for the second-level
navigation bar in the CSS file by the way.

Documentation/css/lilypond-web.css
Documentation/lilypond-texi2html.init

index 207897a319fc7ca37d770c29271d0b57a174626f..25d90befd13f8fba15e74287f445889f574f8d50 100644 (file)
@@ -248,18 +248,14 @@ div#tocframe {
   background: #fad58c url(../pictures/color4-bg.png) repeat-x top left;
 }
 
-#tocframe .toc .toc li.toc_current a,
-#tocframe .toc .toc li.toc_current a:hover {
-  color: #000;
-  text-decoration: underline;
+#tocframe .toc .toc li.colorDefault a {
+  background: #8cbc6c url(../pictures/nav-bg-2.png) repeat-x top left;
+  color: #fff;
 }
 
-/* having this useless style makes the perl init file easier */
-#tocframe .toc .toc li.colorDefault a,
 #tocframe .toc .toc li.colorDefault a:hover {
-  background: #8cbc6c url(../pictures/nav-active-2.png) repeat-x top left;
+  background: #8cbc6c url(../pictures/nav-hover-2.png) repeat-x top left;
   color: #fff;
-  text-decoration: underline;
 }
 
 #tocframe .toc .toc li.color1 a:hover {
@@ -278,6 +274,19 @@ div#tocframe {
   background: #fbe69d url(../pictures/color4-hover.png) repeat-x top left;
 }
 
+#tocframe .toc .toc li.toc_current a,
+#tocframe .toc .toc li.toc_current a:hover {
+  color: #000;
+  text-decoration: underline;
+}
+
+#tocframe .toc .toc li.colorDefault.toc_current a,
+#tocframe .toc .toc li.colorDefault.toc_current a:hover {
+  background: #8cbc6c url(../pictures/nav-active-2.png) repeat-x top left;
+  color: #fff;
+  text-decoration: underline;
+}
+
 #tocframe .toc .toc li.color1.toc_current a,
 #tocframe .toc .toc li.color1.toc_current a:hover {
   background: #beee9e url(../pictures/color1-active.png) repeat-x top left;
index 666aa015ac12de151f932d070fcad037d0c50d25..938d77fde84084314e30b87397334cc757bc2314 100644 (file)
@@ -1064,7 +1064,7 @@ push @Texi2HTML::Config::command_handler_process, \&lilypond_init_toc_depth;
 # -) the parent is a numbered element at top-level toplevel (i.e. show numbered
 #    and unnumbered 2nd-level children of numbered nodes)
 # -) the child element is a numbered node below level maxlevel
-sub generate_ly_toc_entries($$$$)
+sub generate_ly_toc_entries($$$$$)
 {
   my $element = shift;
   my $element_path = shift;
@@ -1073,6 +1073,7 @@ sub generate_ly_toc_entries($$$$)
     $maxlevel = 1;
   }
   my $child_count = shift;
+  my $current_element = shift;
   # Skip undefined sections, plus all sections generated by index splitting
   return() if (not defined($element) or exists($element->{'index_page'}));
   my @result = ();
@@ -1113,7 +1114,7 @@ sub generate_ly_toc_entries($$$$)
       my $below_maxlevel = $c->{'toc_level'} le $maxlevel;
       if ($force_children or ($is_numbered_child and $below_maxlevel)) {
         my @child_res =
-           generate_ly_toc_entries($c, $element_path, $maxlevel, $sub_child_count);
+           generate_ly_toc_entries($c, $element_path, $maxlevel, $sub_child_count, $current_element);
         push (@child_result, @child_res);
        $sub_child_count += 1;
       }
@@ -1123,7 +1124,9 @@ sub generate_ly_toc_entries($$$$)
     if (@child_result) {
       push (@result, "\n$ind<ul$NO_BULLET_LIST_ATTRIBUTE>\n");
       if ($web_manual) {
-        push (@result, "$ind<li class=\"colorDefault toc_current\">" .
+        push (@result, "$ind<li class=\"colorDefault" .
+             ($element->{'text'} eq $current_element->{'text'} ?
+              ' toc_current">' : '">') .
              &$anchor ($element->{'tocid'},
                        "$element->{'file'}#$element->{'target'}",
                        $element->{'text'}) . "</li>\n");
@@ -1177,7 +1180,7 @@ sub lilypond_generate_page_toc_body($)
     }
     my $children = $current_element->{'section_childs'};
     foreach ( @$children ) {
-      push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth, 0));
+      push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth, 0, $element));
     }
     # search box
     local $/=undef;