% Copyright 2007 by Till Tantau
% Copyright 2015 by Vedran Mileti\'c, Joseph Wright
% Copyright 2023-2024 by Joseph Wright, samcarter
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file LICENSE.md for more details.

\newif\ifbeamer@tree@showhooks
\beamer@tree@showhookstrue

\DeclareOptionBeamer{hooks}[true]{\csname beamer@tree@showhooks#1\endcsname}
\ProcessOptionsBeamer

\mode<presentation>

\setbeamertemplate{section in head/foot}[default]
\setbeamertemplate{subsection in head/foot}[default]

\defbeamertemplate*{headline}{tree theme}
{%
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}
    {\usebeamerfont{title in head/foot}%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}
      \insertshorttitle
    \end{beamercolorbox}}
    {\usebeamerfont{section in head/foot}%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}
      \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\usebeamertemplate{section in head/foot}}%
        \ifdim\wd\beamer@tempbox>1pt%
          \hskip2pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
          \hskip1pt%
        \fi%
      \else%  
        \hskip6pt%
      \fi%
      \usebeamertemplate{section in head/foot}
    \end{beamercolorbox}}
    {\usebeamerfont{subsection in head/foot}%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\usebeamertemplate{subsection in head/foot}}%
        \ifdim\wd\beamer@tempbox>1pt%
          \hskip9.4pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
          \hskip1pt%
        \fi%
      \else%  
        \hskip12pt%
      \fi%
      \usebeamertemplate{subsection in head/foot}
    \end{beamercolorbox}}
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
    \end{beamercolorbox}
}

  
\mode
<all>
