% \iffalse meta-comment -------------------------------------------------------
% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
% contributors can be found at
%
%     https://github.com/matze/mtheme/graphs/contributors
%
% and the original template was based on the HSRM theme by Benjamin Weiss.
%
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
% International License (https://creativecommons.org/licenses/by-sa/4.0/).
% ------------------------------------------------------------------------- \fi
% \iffalse
%<driver> \ProvidesFile{beamerouterthememetropolis.dtx}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthememetropolis}
    [2015/06/12 A Modern Beamer Theme]
%</package>
%<driver> \documentclass{ltxdoc}
%<driver> \usepackage{beamerouterthememetropolis}
%<driver> \begin{document}
%<driver> \DocInput{beamerouterthememetropolis.dtx}
%<driver> \end{document}
% \fi
% \CheckSum{0}
% \StopEventually{}
% \iffalse
%<*package>
% ------------------------------------------------------------------------- \fi
% \section{Implementation: \textsc{metropolis} outer theme}
%
% A |beamer| outer theme dictates the style of the frame elements traditionally
% set outside the body of each slide: the head, footline, and frame title.
%
%
%
% This customization will be removed in a future version.
%
%    \begin{macrocode}
\def\mthemetitleformat{\scshape\MakeLowercase}
%    \end{macrocode}
%
%
% \subsection{Head and footline}
%
% All good |beamer| presentations should already remove the navigation symbols,
% but \textsc{metropolis} removes them automatically (just in case).
%
%    \begin{macrocode}
\setbeamertemplate{navigation symbols}{}
%    \end{macrocode}
%
% The only element in the footline by default is the frame number. It can
% optionally be omitted or displayed as a fraction of the total frames.
%
%    \begin{macrocode}
\setbeamertemplate{footline}{%
  \begin{beamercolorbox}[%
      wd=\textwidth,
      ht=3ex,
      dp=3ex,
      leftskip=0.3cm,
      rightskip=0.3cm
    ]{footline}%
    \hfill\usebeamerfont{page number in head/foot}%
  \if@noSlideNumbers%
    %Purposefully left blank to display no slide number.%
    \else%
      \if@useTotalSlideIndicator%
      \insertframenumber/\inserttotalframenumber%
      \else%
      \insertframenumber%
      \fi%
    \fi%
  \end{beamercolorbox}%
}
%    \end{macrocode}
%
%
%
% \subsection{Frametitle}
%
% \begin{macro}{frametitle}
%
%   Template for the frame title, which is optionally underlined with a
%   progress bar.
%
%    \begin{macrocode}
\setbeamertemplate{frametitle}{%
  \nointerlineskip
  \begin{beamercolorbox}[%
      wd=\paperwidth,
      leftskip=0.3cm,
      rightskip=0.3cm,
      ht=2.5ex,
      dp=1.5ex
    ]{frametitle}
  \insertframetitle%
  \end{beamercolorbox}%
  \if@useTitleProgressBar
    \nointerlineskip
    \usebeamertemplate*{progress bar in head/foot}
  \fi
  \vspace{\@mtheme@voffset}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{progress bar in head/foot}
%
%   Template for the progress bar optionally displayed below the frame title
%   on each page. Much of this code is duplicated in the inner theme's template
%   |progress bar in section page|.
%
%    \begin{macrocode}
\RequirePackage{calc}
\newlength{\metropolis@progressinheadfoot}
\setbeamertemplate{progress bar in head/foot}{
  \setlength{\metropolis@progressinheadfoot}{%
    \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
  }%
  \begin{beamercolorbox}[wd=\paperwidth,ht=0.4pt,dp=0pt]{progress bar in head/foot}
    \begin{tikzpicture}
      \draw[bg, fill=bg] (0,0) rectangle (\paperwidth, 0.4pt);
      \draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt);
    \end{tikzpicture}%
  \end{beamercolorbox}
}
%    \end{macrocode}
% \end{macro}
%
%
%
% \iffalse
%</package>
% \fi
% \Finale
\endinput
