diff options
-rw-r--r-- | dbaccess/source/ui/app/AppIconControl.cxx | 1 | ||||
-rw-r--r-- | include/sfx2/thumbnailview.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 22 |
3 files changed, 15 insertions, 9 deletions
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 261855982604..2a89362ec91e 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -63,6 +63,7 @@ OApplicationIconControl::OApplicationIconControl(std::unique_ptr<weld::ScrolledW , m_nMaxHeight(0) { mnVItemSpace = 6; // row spacing + mbSelectOnFocus = false; DrawMnemonics(true); } diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index f38b41c8b4b2..d320bda21155 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -325,6 +325,7 @@ protected: bool mbShowTooltips : 1; bool mbDrawMnemonics : 1; bool mbIsMultiSelectionEnabled: 1; + bool mbSelectOnFocus : 1; Color maFillColor; ///< Background color of the thumbnail view widget. Color maTextColor; ///< Text color. Color maHighlightColor; ///< Color of the highlight (background) of the hovered item. diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index ba16ed06aeb7..4ac54a950afb 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -155,6 +155,7 @@ ThumbnailView::ThumbnailView(std::unique_ptr<weld::ScrolledWindow> xWindow, std: , mnDisplayHeight(0) , mnVItemSpace(-1) , mbAllowVScrollBar(xWindow->get_vpolicy() != VclPolicyType::NEVER) + , mbSelectOnFocus(true) , mpItemAttrs(new ThumbnailItemAttributes) , mxScrolledWindow(std::move(xWindow)) , mxContextMenu(std::move(xMenu)) @@ -941,17 +942,20 @@ void ThumbnailView::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rec void ThumbnailView::GetFocus() { - // Select the first item if nothing selected - int nSelected = -1; - for (size_t i = 0, n = mItemList.size(); i < n && nSelected == -1; ++i) + if (mbSelectOnFocus) { - if (mItemList[i]->isSelected()) - nSelected = i; - } + // Select the first item if nothing selected + int nSelected = -1; + for (size_t i = 0, n = mItemList.size(); i < n && nSelected == -1; ++i) + { + if (mItemList[i]->isSelected()) + nSelected = i; + } - if (nSelected == -1 && !mItemList.empty()) - { - SelectItem(1); + if (nSelected == -1 && !mItemList.empty()) + { + SelectItem(1); + } } // Tell the accessible object that we got the focus. |