From 51e8ff65dd4b777ccf90b722dc69d508cdd2497a Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 18 Nov 2021 00:18:10 +0100 Subject: Use svg images for download and location actions in viewer --- example/static/img/download.svg | 14 ++++++++++++++ example/static/img/location.svg | 14 ++++++++++++++ example/static/style/viewer.css | 5 +++++ src/site.cc | 13 +++++++++---- 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 example/static/img/download.svg create mode 100644 example/static/img/location.svg diff --git a/example/static/img/download.svg b/example/static/img/download.svg new file mode 100644 index 0000000..edf5826 --- /dev/null +++ b/example/static/img/download.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/example/static/img/location.svg b/example/static/img/location.svg new file mode 100644 index 0000000..b08ccb0 --- /dev/null +++ b/example/static/img/location.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/example/static/style/viewer.css b/example/static/style/viewer.css index 5881f84..c158823 100644 --- a/example/static/style/viewer.css +++ b/example/static/style/viewer.css @@ -17,6 +17,11 @@ body { margin: 0 0.5em; } +#header a img { + width: auto; + height: 1.5em; +} + #header li { margin: 0 1em; } diff --git a/src/site.cc b/src/site.cc index e1111de..f8d8116 100644 --- a/src/site.cc +++ b/src/site.cc @@ -394,12 +394,17 @@ private: auto* nav = body->add_tag("div")->attr("id", "header")->add_tag("ul"); { auto* li = nav->add_tag("li"); - li->add_tag("a", "D") + li->add_tag("a") ->attr("id", "download") ->attr("download", "") - ->attr("title", "Download [Shift-D]"); - li->add_tag("a", "P")->attr("id", "location") - ->attr("title", "Show location"); + ->attr("title", "Download [Shift-D]") + ->add_tag("img") + ->attr("src", "../img/download.svg"); + li->add_tag("a") + ->attr("id", "location") + ->attr("title", "Show location") + ->add_tag("img") + ->attr("src", "../img/location.svg"); } nav->add_tag("li")->add_tag("a", "<") ->attr("id", "previous") -- cgit v1.2.3-70-g09d2