% Copyright (c) 2008-2010 by Giuseppe Bilotta
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% Unofficial LaTeX beamer template for the Dipartimento di Matematica e
% Informatica of the Università di Catania (DMI UniCT)
%
% Find the latest version on http://git.oblomov.eu/beamerdmi
%
% Use it with:
%
% \documentclass{beamer}
% \usetheme{dmi-unict}
%
% TODO allow customization of colos
% TODO look into ways to add some extra text after the date (e.g. conference name/topic)

\mode<presentation>

\newif\ifplain@presentation\plain@presentationfalse
\DeclareOptionBeamer{plain}{\plain@presentationtrue} % no secion list on top

\newif\ifdmi@bglogo\dmi@bglogotrue
\DeclareOptionBeamer{nobglogo}{\dmi@bglogofalse} % no background logo
\DeclareOptionBeamer{bglogo}{\dmi@bglogotrue} % put background logo
\newif\ifdmi@bglogofirst\dmi@bglogofirstfalse
\DeclareOptionBeamer{bglogofirst}{\dmi@bglogotrue\dmi@bglogofirsttrue} % only put the logo on the first page

\ProcessOptionsBeamer

\ifplain@presentation\else
\useoutertheme[subsection=false]{smoothbars}
\fi
\useinnertheme[shadow=true]{rounded}

\setbeamerfont{block title}{size={}}

\pgfdeclareimage[width=1cm]{logodmi}{dmi.png}%{DipMatCT.jpg}
\pgfdeclareimage[height=\the\paperheight]{logounict}{unict-alpha.png}%{unict.png}
\logo{\pgfuseimage{logodmi}}

% Apparently, addtobeamertemplate can't be put in an \if, so we do it this way:
\def\dobglogofirst{%
\addtobeamertemplate{background canvas}{\ifnum\thepage=1\hbox to \paperwidth{\hss\pgfuseimage{logounict}\hss}\fi}
}
\def\dobglogo{%
\addtobeamertemplate{background canvas}{\hbox to \paperwidth{\hss\pgfuseimage{logounict}\hss}}
}
\def\addbglogo{%
\ifdmi@bglogofirst
\expandafter\dobglogofirst
\else
\expandafter\dobglogo
\fi
}
\ifdmi@bglogo
\expandafter\addbglogo
\fi

\definecolor{dmi@darkgreen}{rgb}{0.08,0.31,0.07}
\definecolor{dmi@lightgreen}{rgb}{0.24,0.54,0.17}

\setbeamercolor{structure}{fg=dmi@lightgreen}

\setbeamercolor{section in toc}{parent=normal text}

\setbeamercolor*{palette primary}{fg=white,bg=dmi@lightgreen}
\setbeamercolor*{palette secondary}{fg=white,bg=dmi@lightgreen!75!dmi@darkgreen}
\setbeamercolor*{palette tertiary}{fg=white,bg=dmi@darkgreen!50!dmi@lightgreen}
\setbeamercolor*{palette quaternary}{fg=white,bg=dmi@darkgreen}

\setbeamercolor*{sidebar}{bg=dmi@lightgreen}

\setbeamercolor*{palette sidebar primary}{fg=dmi@lightgreen!10}
\setbeamercolor*{palette sidebar secondary}{fg=white}
\setbeamercolor*{palette sidebar tertiary}{fg=dmi@darkgreen!50}
\setbeamercolor*{palette sidebar quaternary}{fg=white}

\setbeamercolor*{titlelike}{parent=palette primary}

\setbeamercolor{block title}{parent=palette secondary,fg=white}
\setbeamercolor{block title alerted}{use=alerted text,fg=white,bg=alerted text.fg!75!black}
\setbeamercolor{block title example}{use=example text,fg=white,bg=example text.fg!75!black}

\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}
\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!10!bg}
\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!10!bg}


\mode
<all>
