diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-06-19 14:38:54 +0530 |
---|---|---|
committer | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-06-23 07:09:13 +0000 |
commit | 596065ff05165f5b59cfcfdcee09166931455e19 (patch) | |
tree | 9bcdab619182f085aa00611caa493e244794c6bf /sfx2/source/dialog | |
parent | 2c1056d679187a702bad3a2ba5dcb6b068e1aa5e (diff) |
GSoC tdf#87697 START CENTER: Indicate selected thumbnailview
Added new "Active" state to PushButton class
Active state used in MenuToggleButton class.
Active => Pressed + Flyover
When hovered in Active state, Active => Flyover only
Change-Id: Iece1550b6d742a7ab3c9f4c7516ec855e1a1b6ef
Reviewed-on: https://gerrit.libreoffice.org/26470
Reviewed-by: Akshay Deep <akshaydeepiitr@gmail.com>
Tested-by: Akshay Deep <akshaydeepiitr@gmail.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.hxx | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 9c054d56f633..ef27a2dc02f2 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -256,6 +256,7 @@ void BackingWindow::initControls() mpAllRecentThumbnails->mnFileTypes |= TYPE_OTHER; mpAllRecentThumbnails->Reload(); mpAllRecentThumbnails->ShowTooltips( true ); + mpRecentButton->SetActive(true); //initialize Template view mpLocalView->SetStyle( mpLocalView->GetStyle() | WB_VSCROLL); @@ -345,7 +346,7 @@ void BackingWindow::setupButton( PushButton* pButton ) pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); } -void BackingWindow::setupButton( MenuButton* pButton ) +void BackingWindow::setupButton( MenuToggleButton* pButton ) { vcl::Font aFont(pButton->GetSettings().GetStyleSettings().GetPushButtonFont()); aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier)); @@ -595,6 +596,9 @@ IMPL_LINK_TYPED( BackingWindow, ClickHdl, Button*, pButton, void ) mpLocalView->Hide(); mpAllRecentThumbnails->Show(); mpAllRecentThumbnails->GrabFocus(); + mpRecentButton->SetActive(true); + mpTemplateButton->SetActive(false); + mpTemplateButton->Invalidate(); } else if( pButton == mpTemplateButton ) { @@ -604,6 +608,9 @@ IMPL_LINK_TYPED( BackingWindow, ClickHdl, Button*, pButton, void ) mpLocalView->Show(); mpLocalView->reload(); mpLocalView->GrabFocus(); + mpRecentButton->SetActive(false); + mpRecentButton->Invalidate(); + mpTemplateButton->SetActive(true); } } @@ -654,6 +661,9 @@ IMPL_LINK_TYPED( BackingWindow, MenuSelectHdl, MenuButton*, pButton, void ) mpLocalView->Show(); mpLocalView->reload(); mpLocalView->GrabFocus(); + mpRecentButton->SetActive(false); + mpTemplateButton->SetActive(true); + mpRecentButton->Invalidate(); } } diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index 4c80c9f5ba31..499d8b3dc367 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -59,9 +59,9 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer css::uno::Reference<css::datatransfer::dnd::XDropTargetListener> mxDropTargetListener; VclPtr<PushButton> mpOpenButton; - VclPtr<MenuButton> mpRecentButton; + VclPtr<MenuToggleButton> mpRecentButton; VclPtr<PushButton> mpRemoteButton; - VclPtr<MenuButton> mpTemplateButton; + VclPtr<MenuToggleButton> mpTemplateButton; VclPtr<FixedText> mpCreateLabel; @@ -93,7 +93,7 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer std::unique_ptr<svt::AcceleratorExecute> mpAccExec; void setupButton(PushButton* pButton); - void setupButton(MenuButton* pButton); + void setupButton(MenuToggleButton* pButton); void dispatchURL(const OUString& i_rURL, const OUString& i_rTarget = OUString("_default"), |