\mode<presentation>

% Frame title
\defbeamertemplate*{frametitle}{trex}[1][]
{
  \begin{beamercolorbox}[wd=\paperwidth,ht=0.95cm]{frametitle} 
  \begin{tikzpicture}
  \useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,1.);
  \fill[red!80!black] (0,0) rectangle(2.95,1.);
  \fill[blue!50!cyan!80!black] (3.05,0) rectangle(\the\paperwidth,1.);
   \ifx\insertframesubtitle\@empty%
      {\node[anchor=west, white,font=\large] at (3.2,0.51){\insertframetitle};}
      \else%
      {\node[anchor= west, white,font=\large] at (3.2,0.61){\insertframetitle};%
       \node[anchor= west, white,font=\small] at (3.2,0.11){\insertframesubtitle};}%
      \fi
  \end{tikzpicture}
  \end{beamercolorbox}
}

\mode<all>

