diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-29 01:29:49 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-29 01:29:49 +0100 |
| commit | afe41078add129c821a16f5f7fb6e667c34c153d (patch) | |
| tree | 230234f462e9528f8451f26f4f98c8ea0283077d | |
| parent | 8062c7ae4b6201b3728baae37fb04215dcc5fcd4 (diff) | |
| download | rust-afe41078add129c821a16f5f7fb6e667c34c153d.tar.gz rust-afe41078add129c821a16f5f7fb6e667c34c153d.zip | |
Add arrow to the crate select box
| -rw-r--r-- | src/librustdoc/html/layout.rs | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/down-arrow.svg | 1 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/static_files.rs | 3 |
5 files changed, 14 insertions, 1 deletions
diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index d585b737517..3a2a6f4c6b9 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -57,6 +57,9 @@ pub fn render<T: fmt::Display, S: fmt::Display>( {css_extension}\ {favicon}\ {in_header}\ + <style type=\"text/css\">\ + #crate-search{{background-image:url(\"{root_path}down-arrow{suffix}.svg\");}}\ + </style>\ </head>\ <body class=\"rustdoc {css_class}\">\ <!--[if lte IE 8]>\ diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 48da90de02a..1b99641c3e7 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -793,6 +793,8 @@ fn write_shared( static_files::BRUSH_SVG)?; write(cx.dst.join(&format!("wheel{}.svg", cx.shared.resource_suffix)), static_files::WHEEL_SVG)?; + write(cx.dst.join(&format!("down-arrow{}.svg", cx.shared.resource_suffix)), + static_files::DOWN_ARROW_SVG)?; write_minify(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)), static_files::themes::LIGHT, options.enable_minification)?; diff --git a/src/librustdoc/html/static/down-arrow.svg b/src/librustdoc/html/static/down-arrow.svg new file mode 100644 index 00000000000..a2d9a37dde0 --- /dev/null +++ b/src/librustdoc/html/static/down-arrow.svg @@ -0,0 +1 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="128px" id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" width="128px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><line style="fill:none;stroke:#2F3435;stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="111" x2="64" y1="40.5" y2="87.499"/><line style="fill:none;stroke:#2F3435;stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="64" x2="17" y1="87.499" y2="40.5"/></g></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index cbf55c12244..ff1ba9f541b 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -621,7 +621,7 @@ a { #crate-search { margin-top: 5px; padding: 6px; - padding-right: 12px; + padding-right: 19px; border: 0; border-right: 0; border-radius: 4px 0 0 4px; @@ -633,6 +633,10 @@ a { /* Removes default arrow from firefox */ text-indent: 0.01px; text-overflow: ""; + background-repeat: no-repeat; + background-color: transparent; + background-size: 16%; + background-position: calc(100% - 1px) 56%; } .search-container > .top-button { position: absolute; diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index 3baa082bd0e..93f95d8892e 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -45,6 +45,9 @@ pub static BRUSH_SVG: &'static [u8] = include_bytes!("static/brush.svg"); /// The file contents of `wheel.svg`, the icon used for the settings button. pub static WHEEL_SVG: &'static [u8] = include_bytes!("static/wheel.svg"); +/// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox. +pub static DOWN_ARROW_SVG: &'static [u8] = include_bytes!("static/down-arrow.svg"); + /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation /// output. pub static COPYRIGHT: &'static [u8] = include_bytes!("static/COPYRIGHT.txt"); |
