Merge pull request #238 from benjamin-weiss/progressbar-width

fixes #237: Allow to define the width of the progress bar
This commit is contained in:
Matthias Vogelgesang 2016-11-06 23:33:36 +01:00 committed by GitHub
commit 33e6756189
2 changed files with 11 additions and 5 deletions

View File

@ -196,9 +196,11 @@
% Template to set the title graphic in a zero-height box. (It won't % Template to set the title graphic in a zero-height box. (It won't
% change the position of other elements.) % change the position of other elements.)
% \begin{macrocode} % \begin{macrocode}
\newlength{\metropolis@titleseparator@linewidth}
\setlength{\metropolis@titleseparator@linewidth}{0.4pt}
\setbeamertemplate{title separator}{ \setbeamertemplate{title separator}{
\begin{tikzpicture} \begin{tikzpicture}
\fill[fg] (0,0) rectangle (\textwidth, 0.4pt); \fill[fg] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
\end{tikzpicture}% \end{tikzpicture}%
\par% \par%
} }
@ -328,13 +330,15 @@
% %
% \begin{macrocode} % \begin{macrocode}
\newlength{\metropolis@progressonsectionpage} \newlength{\metropolis@progressonsectionpage}
\newlength{\metropolis@progressonsectionpage@linewidth}
\setlength{\metropolis@progressonsectionpage@linewidth}{0.4pt}
\setbeamertemplate{progress bar in section page}{ \setbeamertemplate{progress bar in section page}{
\setlength{\metropolis@progressonsectionpage}{% \setlength{\metropolis@progressonsectionpage}{%
\textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}% \textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}% }%
\begin{tikzpicture} \begin{tikzpicture}
\fill[bg] (0,0) rectangle (\textwidth, 0.4pt); \fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
\fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, 0.4pt); \fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
\end{tikzpicture}% \end{tikzpicture}%
} }
% \end{macrocode} % \end{macrocode}

View File

@ -187,6 +187,8 @@
% template |progress bar in section page|. % template |progress bar in section page|.
% \begin{macrocode} % \begin{macrocode}
\newlength{\metropolis@progressinheadfoot} \newlength{\metropolis@progressinheadfoot}
\newlength{\metropolis@progressinheadfoot@linewidth}
\setlength{\metropolis@progressinheadfoot@linewidth}{0.4pt}
\setbeamertemplate{progress bar in head/foot}{ \setbeamertemplate{progress bar in head/foot}{
\nointerlineskip \nointerlineskip
\setlength{\metropolis@progressinheadfoot}{% \setlength{\metropolis@progressinheadfoot}{%
@ -194,8 +196,8 @@
}% }%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot} \begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
\begin{tikzpicture} \begin{tikzpicture}
\fill[bg] (0,0) rectangle (\paperwidth, 0.4pt); \fill[bg] (0,0) rectangle (\paperwidth, \metropolis@progressinheadfoot@linewidth);
\fill[fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt); \fill[fg] (0,0) rectangle (\metropolis@progressinheadfoot, \metropolis@progressinheadfoot@linewidth);
\end{tikzpicture}% \end{tikzpicture}%
\end{beamercolorbox} \end{beamercolorbox}
} }