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.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
Ilmari Lauhakangas 2023-11-27 18:40:57 +02:00
parent bc95ece061
commit 5584980493
4 changed files with 5 additions and 1 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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 );

View file

@ -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();