diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-08-21 10:29:49 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-08-29 12:33:10 +0200 |
commit | 682c74f0dbb9bea3178e340c3f8cde69272829ad (patch) | |
tree | ccd9fcfcdd847c60c9a5d3d088eab54f2e8d0d7d /svtools/source/control/breadcrumb.cxx | |
parent | 495285ee3a00d6c14e3d5a8df2e5715fb7edb233 (diff) |
Breadcrumb: mouseover effect
Change-Id: If38d799e0fa7506416082fb15f37b12267a9b5df
Diffstat (limited to 'svtools/source/control/breadcrumb.cxx')
-rw-r--r-- | svtools/source/control/breadcrumb.cxx | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx index 306d33ffdb22..8ccbd8143c49 100644 --- a/svtools/source/control/breadcrumb.cxx +++ b/svtools/source/control/breadcrumb.cxx @@ -9,6 +9,38 @@ #include <svtools/breadcrumb.hxx> +class CustomLink : public FixedHyperlink +{ +public: + CustomLink( vcl::Window* pParent, WinBits nWinStyle ) + : FixedHyperlink( pParent, nWinStyle ) + { + vcl::Font aFont = GetControlFont( ); + aFont.SetUnderline( UNDERLINE_NONE ); + SetControlFont( aFont ); + } + +protected: + virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE + { + // changes the style if the control is enabled + if ( !rMEvt.IsLeaveWindow() && IsEnabled() ) + { + vcl::Font aFont = GetControlFont( ); + aFont.SetUnderline( UNDERLINE_SINGLE ); + SetControlFont( aFont ); + } + else + { + vcl::Font aFont = GetControlFont( ); + aFont.SetUnderline( UNDERLINE_NONE ); + SetControlFont( aFont ); + } + + FixedHyperlink::MouseMove( rMEvt ); + } +}; + Breadcrumb::Breadcrumb( vcl::Window* pParent, WinBits nWinStyle ) : VclHBox( pParent, nWinStyle ) { m_eMode = SvtBreadcrumbMode::ONLY_CURRENT_PATH; @@ -112,6 +144,7 @@ void Breadcrumb::SetURL( const OUString& rURL ) m_aLinks[i]->SetURL( sRootPath + OUString( sPath.getStr(), nEnd ) ); m_aLinks[i]->Hide(); m_aLinks[i]->Enable( true ); + m_aSeparators[i]->Hide(); nPos = nEnd; @@ -208,7 +241,7 @@ void Breadcrumb::SetMode( SvtBreadcrumbMode eMode ) void Breadcrumb::appendField() { - m_aLinks.push_back( VclPtr< FixedHyperlink >::Create( this, WB_TABSTOP ) ); + m_aLinks.push_back( VclPtr< CustomLink >::Create( this, WB_TABSTOP ) ); m_aLinks[m_aLinks.size() - 1]->Hide(); m_aLinks[m_aLinks.size() - 1]->SetClickHdl( LINK( this, Breadcrumb, ClickLinkHdl ) ); |