include/sfx2/thumbnailview.hxx | 1 + sfx2/source/control/recentdocsview.cxx | 1 + sfx2/source/control/templatedefaultview.cxx | 1 + sfx2/source/control/thumbnailview.cxx | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-)
New commits: commit 5584980493fd599054cc5bbdb9911ae2c70cd60f Author: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> AuthorDate: Mon Nov 27 18:40:57 2023 +0200 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Mon Dec 4 20:16:06 2023 +0100 tdf#158404 Start Center: remove ability to do multiselections in Recent Documents and Templates views using Shift+arrow keys as no actions can be executed for multiple selected files. Multiselection still works as normal in Manage Templates dialog. Change-Id: I03b9e54abb7772881139763a0c97f36637d01f85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160003 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index 655aa3ba13e5..54e8440ad363 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -309,6 +309,7 @@ protected: bool mbShowTooltips : 1; bool mbDrawMnemonics : 1; bool mbSelectOnFocus : 1; + bool mbAllowMultiSelection : 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/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index 6df534788a32..f6ea1278390a 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -68,6 +68,7 @@ RecentDocsView::RecentDocsView(std::unique_ptr<weld::ScrolledWindow> xWindow, st , mpLoadRecentFile(nullptr) , m_nExecuteHdlId(nullptr) { + mbAllowMultiSelection = false; AbsoluteScreenPixelRectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen()); mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192; diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx index 909545e423ce..eef46f1817fd 100644 --- a/sfx2/source/control/templatedefaultview.cxx +++ b/sfx2/source/control/templatedefaultview.cxx @@ -25,6 +25,7 @@ TemplateDefaultView::TemplateDefaultView(std::unique_ptr<weld::ScrolledWindow> x std::unique_ptr<weld::Menu> xMenu) : TemplateLocalView(std::move(xWindow), std::move(xMenu)) { + mbAllowMultiSelection = false; AbsoluteScreenPixelRectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen()); tools::Long nItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192; ThumbnailView::setItemDimensions( nItemMaxSize, nItemMaxSize, gnTextHeight, gnItemPadding ); diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index abb9f9799e34..1ae47016935e 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -246,6 +246,7 @@ void ThumbnailView::ImplInit() mbHasVisibleItems = false; mbShowTooltips = false; mbDrawMnemonics = false; + mbAllowMultiSelection = true; maFilterFunc = ViewFilterAll(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); @@ -681,7 +682,7 @@ bool ThumbnailView::KeyInput( const KeyEvent& rKEvt ) if ( pNext ) { - if (aKeyCode.IsShift() && bValidRange) + if (aKeyCode.IsShift() && bValidRange && mbAllowMultiSelection) { std::pair<size_t,size_t> aRange; size_t nSelPos = mpStartSelRange - mFilteredItemList.begin();