% Modified Beamer Style sheet for NGNI publications
% Last edited by: Lieuwe B. Leene 2017 August
% Modified by Lieuwe Leene, June 2019

\mode<presentation>
\newcommand{\FrontLogoA}{Style/IC_blue.pdf}
\newcommand{\FrontLogoB}{Style/main_logo.pdf}
\newcommand{\FootLogoA}{Style/banner_name_white.pdf}
\newcommand{\FootLogoB}{Style/banner_icon.pdf}
\newcommand{\BaseBackground}{Style/KM1801VM2_I.png}

\newlength{\marginlength}%
\setlength{\marginlength}{0.5cm}%

%% This formats the title page
\setbeamercolor{basic}{bg=white,fg=white}
\defbeamertemplate*{title page}{ngnitheme}{

  \begin{beamercolorbox}[wd=\paperwidth]{basic}

    \hspace{\marginlength} \parbox[c]{\dimexpr (\paperwidth-2\marginlength) \relax}{ %
      \includegraphics[height=0.05\paperheight, trim={0 0 0 2.2cm}]{\FrontLogoA} %
      \hfill %
      \includegraphics[height=0.05\paperheight, trim={0 0 0 4cm}]{\FrontLogoB} %
    }
    \vspace{1.5\marginlength}  \\
    \hspace{\marginlength} \parbox[c]{\textwidth}{%
      \begin{flushleft}
        \usebeamercolor[black]{title}
        \usebeamerfont{title}\inserttitle\par
        \usebeamerfont{subtitle}\insertsubtitle\par
        \bigskip
        \usebeamerfont{author}\insertauthor\par
        \bigskip
        \usebeamerfont{institute}\insertinstitute\par
      \end{flushleft}}

  \end{beamercolorbox}
  \vskip 0pt%
}


%% This formats the the footer on every page
\defbeamertemplate*{footline}{ngnitheme}{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=5ex,dp=2.5ex]{footnote}%
  \usebeamerfont{footnote}
  \hspace{5mm} \today
  \hfill
  \insertsubtitle
  \hfill
  \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
  \inserttitlegraphic
  \end{beamercolorbox}}%
  \vskip 0pt%
}

\ifx\nosectiontoc\undefined
\AtBeginSection[]
{
\disablefooter
\begin{frame}{Outline}
	\tableofcontents[currentsection]
\end{frame}
\enablefooter{\inserttitle}
}
\fi

\newcommand{\enablefooter}[1]{
%% Put the Footer Subtitle Here
\subtitle{#1}
%% This shows some Footer graphics
\titlegraphic{\includegraphics[height=2.5ex, trim=1mm 2mm 20mm -1mm]{\FootLogoA}\includegraphics[width=2cm, angle=90, trim=-14mm -3mm 0mm 0mm]{\FootLogoB}}
}

\newcommand{\disablefooter}[0]{
	\subtitle{}
	\titlegraphic{}
}

\mode
<all>
