%% beamerouterthemesplitwithminiframes.sty
%% Copyright 2018-2019 Louis Stuart
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is Louis Stuart.

\ProvidesPackage{beamerouterthemesplitwithminiframes}[2019-05-07 v1.01 Beamer supplementary outer themes]

\mode<presentation>

\setbeamertemplate{section in head/foot}{\hfill\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\hfill\color{fg!50!bg}\insertsectionhead}
\setbeamercolor{mini frame}{parent=subsection in head/foot}

\def\insertsubsectionnavigationwithminiframe#1{%
  \hbox to #1{%
    \vbox{{%
      \usebeamerfont{subsection in head/foot}\usebeamercolor[fg]{subsection in head/foot}%
      \vskip0.5625ex%
      \beamer@currentsubsection=0%
      \def\sectionentry##1##2##3##4##5{}%
      \def\beamer@subsectionentry##1##2##3##4##5{%
        \ifnum##1=\c@part\ifnum##2=\c@section%
        \def\insertpartheadnumber{##1}%
        \def\insertsectionheadnumber{##2}%
        \def\insertsubsectionheadnumber{##3}%
        \def\insertsubsectionhead{##5}%
        \par\leavevmode%
        \setbox\beamer@tempbox=\hbox{\hskip0.3cm%
          \hyperlink{Navigation##4}{\hbox{%
             \ifnum\c@subsection=##3%
               {\usebeamertemplate{subsection in head/foot}}%
             \else%
               {\usebeamertemplate{subsection in head/foot shaded}}%
             \fi\hskip0.3cm}}}%
        \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
        \box\beamer@tempbox%
        \fi\fi}%
      \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section\ifnum##2>0%
        \def\insertsubsectionhead{##5}%
        \def\insertsectionheadnumber{##1}%
        \def\insertsubsectionheadnumber{##2}%
        \def\insertpartheadnumber{##6}%
        \leavevmode\setbox\beamer@tempbox=\hbox{\beamer@link(##4){%
          \usebeamerfont{mini frame}%
          \usebeamercolor[fg]{mini frame}%
          \ifnum\c@section=##1%
            \ifnum\c@subsection=##2%
              \ifnum\c@subsectionslide=##3%
                \usebeamertemplate{mini frame}
              \else%
                \usebeamertemplate{mini frame in current subsection}
              \fi%
            \else%
              \usebeamertemplate{mini frame in other subsection}
            \fi%
          \else%
            \usebeamercolor{mini frame}%
            \usebeamertemplate{mini frame in other subsection}
          \fi%
        }}%
        \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex\wd\beamer@tempbox=\beamer@boxsize%
        \box\beamer@tempbox%
        \fi\fi\fi}%
      \dohead\vskip0.5625ex}}\hfil}}


\defbeamertemplate*{headline}{split with miniframe}
{%
  \leavevmode%
  \@tempdimb=2.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.825ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsubsectionnavigationwithminiframe{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
  \fi%
}

\mode
<all>
