From 97a1d170b5f45c6cf9fc2c56dc4526d0e3f8423a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 15 Feb 2021 20:16:44 +0000 Subject: tdf#140387 grab focus to first panel widget on panel gaining focus otherwise focus is getting lost in these currently mixed vcl+gtk widget panels. Change-Id: I6488ddfc98afdedb55bb3217f3877e96258dd65a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110956 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos --- chart2/source/controller/sidebar/ChartAxisPanel.cxx | 2 ++ chart2/source/controller/sidebar/ChartElementsPanel.cxx | 2 ++ chart2/source/controller/sidebar/ChartErrorBarPanel.cxx | 2 ++ chart2/source/controller/sidebar/ChartSeriesPanel.cxx | 2 ++ chart2/source/controller/sidebar/ChartTypePanel.cxx | 2 ++ include/sfx2/sidebar/PanelLayout.hxx | 2 ++ sc/source/ui/formdlg/dwfunctr.cxx | 2 ++ sc/source/ui/navipi/navipi.cxx | 2 ++ sc/source/ui/sidebar/AlignmentPropertyPanel.cxx | 1 + sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx | 1 + sd/source/ui/animations/CustomAnimationPane.cxx | 1 + sd/source/ui/dlg/navigatr.cxx | 2 ++ sd/source/ui/sidebar/LayoutMenu.cxx | 1 + sd/source/ui/sidebar/MasterPagesSelector.cxx | 2 ++ sd/source/ui/table/TableDesignPane.hxx | 7 +++++++ sfx2/source/dialog/templdlg.cxx | 1 + sfx2/source/sidebar/PanelLayout.cxx | 9 +++++++++ svx/source/gallery2/GalleryControl.cxx | 1 + svx/source/gallery2/galbrws1.cxx | 11 ++++++++--- svx/source/gallery2/galbrws1.hxx | 1 + svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 2 ++ svx/source/sidebar/effect/EffectPropertyPanel.cxx | 2 ++ svx/source/sidebar/inspector/InspectorTextPanel.cxx | 1 + svx/source/sidebar/lists/ListsPropertyPanel.cxx | 1 + svx/source/sidebar/media/MediaPlaybackPanel.cxx | 2 ++ svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 1 + svx/source/sidebar/shapes/DefaultShapesPanel.cxx | 2 ++ svx/source/sidebar/styles/StylesPropertyPanel.cxx | 1 + svx/source/sidebar/text/TextPropertyPanel.cxx | 2 ++ sw/source/uibase/sidebar/StylePresetsPanel.cxx | 2 ++ sw/source/uibase/sidebar/TableEditPanel.cxx | 2 ++ sw/source/uibase/sidebar/ThemePanel.cxx | 2 ++ sw/source/uibase/sidebar/WrapPropertyPanel.cxx | 2 ++ sw/source/uibase/utlui/navipi.cxx | 2 ++ 34 files changed, 75 insertions(+), 3 deletions(-) diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx index 63807f37c9ec..c1d9a4e62871 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx @@ -219,6 +219,8 @@ ChartAxisPanel::ChartAxisPanel( , mbModelValid(true) { Initialize(); + + m_pInitialFocusWidget = mxCBShowLabel.get(); } ChartAxisPanel::~ChartAxisPanel() diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx index 27b96dc74007..b14705cc8080 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx @@ -336,6 +336,8 @@ ChartElementsPanel::ChartElementsPanel( maTextSubTitle = mxTextSubTitle->get_label(); Initialize(); + + m_pInitialFocusWidget = mxCBTitle.get(); } ChartElementsPanel::~ChartElementsPanel() diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx index cb768d34dd15..b435520c5968 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx @@ -249,6 +249,8 @@ ChartErrorBarPanel::ChartErrorBarPanel( , mbModelValid(true) { Initialize(); + + m_pInitialFocusWidget = mxRBPosAndNeg.get(); } ChartErrorBarPanel::~ChartErrorBarPanel() diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index 8a0c0d787db3..727aabbc2458 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -297,6 +297,8 @@ ChartSeriesPanel::ChartSeriesPanel( , mbModelValid(true) { Initialize(); + + m_pInitialFocusWidget = mxCBLabel.get(); } ChartSeriesPanel::~ChartSeriesPanel() diff --git a/chart2/source/controller/sidebar/ChartTypePanel.cxx b/chart2/source/controller/sidebar/ChartTypePanel.cxx index 74a8e7bd0983..a0e38bdb393a 100644 --- a/chart2/source/controller/sidebar/ChartTypePanel.cxx +++ b/chart2/source/controller/sidebar/ChartTypePanel.cxx @@ -119,6 +119,8 @@ ChartTypePanel::ChartTypePanel(vcl::Window* pParent, m_pSortByXValuesResourceGroup->setChangeListener(this); Initialize(); + + m_pInitialFocusWidget = m_xMainTypeList.get(); } ChartTypePanel::~ChartTypePanel() { disposeOnce(); } diff --git a/include/sfx2/sidebar/PanelLayout.hxx b/include/sfx2/sidebar/PanelLayout.hxx index e8ee96ae8f44..0e9e56875ff1 100644 --- a/include/sfx2/sidebar/PanelLayout.hxx +++ b/include/sfx2/sidebar/PanelLayout.hxx @@ -25,6 +25,7 @@ protected: std::unique_ptr m_xBuilder; VclPtr m_xVclContentArea; std::unique_ptr m_xContainer; + weld::Widget* m_pInitialFocusWidget; private: Idle m_aPanelLayoutIdle; @@ -40,6 +41,7 @@ public: virtual void dispose() override; virtual Size GetOptimalSize() const override; + virtual void GetFocus() override; virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) override; virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; virtual bool EventNotify(NotifyEvent& rNEvt) override; diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 436fcff51708..e5adb6859be2 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -70,6 +70,8 @@ ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Referenceset_active(0); SelComboHdl(*xCatBox); + + m_pInitialFocusWidget = xCatBox.get(); } /************************************************************************* diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 64b12b05902f..eb998e878e75 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -417,6 +417,8 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent) SetListMode(eNavMode); aExpandedSize = GetOptimalSize(); + + m_pInitialFocusWidget = m_xEdCol.get(); } void ScNavigatorDlg::UpdateSheetLimits() diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index daae9593b20f..c5714959b958 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -78,6 +78,7 @@ AlignmentPropertyPanel::AlignmentPropertyPanel( , mpBindings(pBindings) { Initialize(); + m_pInitialFocusWidget = &mxMFLeftIndent->get_widget(); } AlignmentPropertyPanel::~AlignmentPropertyPanel() diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx index 12fc841dc6a1..bd7069e34d26 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx @@ -54,6 +54,7 @@ NumberFormatPropertyPanel::NumberFormatPropertyPanel( , mpBindings(pBindings) { Initialize(); + m_pInitialFocusWidget = mxLbCategory.get(); } NumberFormatPropertyPanel::~NumberFormatPropertyPanel() diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index b58ca838b709..678dd2a14101 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -154,6 +154,7 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase, , maLateInitTimer() { initialize(); + m_pInitialFocusWidget = &mxCustomAnimationList->get_widget(); } void CustomAnimationPane::initialize() diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 6f431d713307..2df7c321b759 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -91,6 +91,8 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings) mxLbDocs->connect_changed(LINK(this, SdNavigatorWin, SelectDocumentHdl)); SetDragImage(); + + m_pInitialFocusWidget = mxToolbox.get(); } void SdNavigatorWin::SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdateRequest) diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 57835e1b848f..487102fc0c55 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -172,6 +172,7 @@ LayoutMenu::LayoutMenu ( #ifdef DEBUG SetText(OUString("sd:LayoutMenu")); #endif + m_pInitialFocusWidget = mxLayoutValueSet->GetDrawingArea(); } void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell ) diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 3e176707fd06..d3dc37c48d39 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -86,6 +86,8 @@ MasterPagesSelector::MasterPagesSelector ( Link aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener)); mpContainer->AddChangeListener(aChangeListener); + + m_pInitialFocusWidget = mxPreviewValueSet->GetDrawingArea(); } MasterPagesSelector::~MasterPagesSelector() diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx index 27f2b164d755..d03a3260303a 100644 --- a/sd/source/ui/table/TableDesignPane.hxx +++ b/sd/source/ui/table/TableDesignPane.hxx @@ -83,6 +83,12 @@ private: DECL_LINK(implValueSetHdl, ValueSet*, void); DECL_LINK(implCheckBoxHdl, weld::ToggleButton&, void); +public: + weld::Widget* GetInitialFocusWidget() + { + return m_xValueSet->GetDrawingArea(); + } + private: ViewShellBase& mrBase; @@ -105,6 +111,7 @@ public: "modules/simpress/ui/tabledesignpanel.ui", css::uno::Reference()) , m_xImpl(new TableDesignWidget(*m_xBuilder, rBase)) { + m_pInitialFocusWidget = m_xImpl->GetInitialFocusWidget(); } virtual void dispose() override { diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index d9577bc852e3..a281f2b5dd46 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -373,6 +373,7 @@ SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Wi , pImpl(new SfxTemplateDialog_Impl(pBindings, this)) { OSL_ASSERT(pBindings!=nullptr); + m_pInitialFocusWidget = pImpl->m_xActionTbL.get(); } SfxTemplatePanelControl::~SfxTemplatePanelControl() diff --git a/sfx2/source/sidebar/PanelLayout.cxx b/sfx2/source/sidebar/PanelLayout.cxx index c419403bdf79..0e37e2278a73 100644 --- a/sfx2/source/sidebar/PanelLayout.cxx +++ b/sfx2/source/sidebar/PanelLayout.cxx @@ -18,6 +18,7 @@ using namespace sfx2::sidebar; PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference &rFrame) : Control(pParent) + , m_pInitialFocusWidget(nullptr) , m_bInClose(false) , mxFrame(rFrame) { @@ -34,6 +35,13 @@ PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUStrin m_xContainer = m_xBuilder->weld_container(rID); } +void PanelLayout::GetFocus() +{ + Control::GetFocus(); + if (m_pInitialFocusWidget) + m_pInitialFocusWidget->grab_focus(); +} + PanelLayout::~PanelLayout() { disposeOnce(); @@ -42,6 +50,7 @@ PanelLayout::~PanelLayout() void PanelLayout::dispose() { m_bInClose = true; + m_pInitialFocusWidget = nullptr; m_aPanelLayoutIdle.Stop(); m_xContainer.reset(); m_xBuilder.reset(); diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx index a25d178d4ad7..7ecbffaa90bf 100644 --- a/svx/source/gallery2/GalleryControl.cxx +++ b/svx/source/gallery2/GalleryControl.cxx @@ -36,6 +36,7 @@ GalleryControl::GalleryControl(vcl::Window* pParent) , mxBrowser2(new GalleryBrowser2(*m_xBuilder, mpGallery)) { mxBrowser1->SelectTheme(0); + m_pInitialFocusWidget = mxBrowser1->GetInitialFocusWidget(); } GalleryControl::~GalleryControl() diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 6cf14753e524..cd3a54db21e3 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -308,12 +308,17 @@ void GalleryBrowser1::ImplExecute(const OString &rIdent) } } -void GalleryBrowser1::GrabFocus() +weld::Widget* GalleryBrowser1::GetInitialFocusWidget() { if (mxNewTheme->get_sensitive()) - mxNewTheme->grab_focus(); + return mxNewTheme.get(); else - mxThemes->grab_focus(); + return mxThemes.get(); +} + +void GalleryBrowser1::GrabFocus() +{ + GetInitialFocusWidget()->grab_focus(); } void GalleryBrowser1::Notify( SfxBroadcaster&, const SfxHint& rHint ) diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx index 222237a72a74..f22e9f96609d 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -85,6 +85,7 @@ public: void SelectTheme( sal_uInt16 nThemePos ) { mxThemes->select( nThemePos ); SelectThemeHdl( *mxThemes ); } OUString GetSelectedTheme() const { return mxThemes->get_selected_text(); } + weld::Widget* GetInitialFocusWidget(); void GrabFocus(); }; diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 30c199144e8b..224d674b5c3d 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -107,6 +107,8 @@ AreaPropertyPanelBase::AreaPropertyPanelBase( mpPanel = dynamic_cast(pParent); Initialize(); + + m_pInitialFocusWidget = mxLbFillType.get(); } AreaPropertyPanelBase::~AreaPropertyPanelBase() diff --git a/svx/source/sidebar/effect/EffectPropertyPanel.cxx b/svx/source/sidebar/effect/EffectPropertyPanel.cxx index 6e0ade4095cd..6b43c0d52cce 100644 --- a/svx/source/sidebar/effect/EffectPropertyPanel.cxx +++ b/svx/source/sidebar/effect/EffectPropertyPanel.cxx @@ -43,6 +43,8 @@ EffectPropertyPanel::EffectPropertyPanel(vcl::Window* pParent, , mxSoftEdgeRadius(m_xBuilder->weld_metric_spin_button("SB_SOFTEDGE_RADIUS", FieldUnit::POINT)) { Initialize(); + + m_pInitialFocusWidget = &mxGlowRadius->get_widget(); } EffectPropertyPanel::~EffectPropertyPanel() { disposeOnce(); } diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 13714e22bfde..9b13a90dec87 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -57,6 +57,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, aWidths.push_back(fWidth * 34); aWidths.push_back(fWidth * 34); mpListBoxStyles->set_column_fixed_widths(aWidths); + m_pInitialFocusWidget = mpListBoxStyles.get(); } static bool GetPropertyValues(const OUString& rPropName, const uno::Any& rAny, OUString& rString) diff --git a/svx/source/sidebar/lists/ListsPropertyPanel.cxx b/svx/source/sidebar/lists/ListsPropertyPanel.cxx index 2b579b4979b1..a28cbf777a09 100644 --- a/svx/source/sidebar/lists/ListsPropertyPanel.cxx +++ b/svx/source/sidebar/lists/ListsPropertyPanel.cxx @@ -46,6 +46,7 @@ ListsPropertyPanel::ListsPropertyPanel(vcl::Window* pParent, , mxTBxOutline(m_xBuilder->weld_toolbar("outline")) , mxOutlineDispatcher(new ToolbarUnoDispatcher(*mxTBxOutline, *m_xBuilder, rxFrame)) { + m_pInitialFocusWidget = mxTBxNumBullet.get(); } ListsPropertyPanel::~ListsPropertyPanel() { disposeOnce(); } diff --git a/svx/source/sidebar/media/MediaPlaybackPanel.cxx b/svx/source/sidebar/media/MediaPlaybackPanel.cxx index 2b2cd5d10ab8..78a56e4405e5 100644 --- a/svx/source/sidebar/media/MediaPlaybackPanel.cxx +++ b/svx/source/sidebar/media/MediaPlaybackPanel.cxx @@ -46,6 +46,8 @@ MediaPlaybackPanel::MediaPlaybackPanel ( mxZoomListBox = m_xBuilder->weld_combo_box("zoombox"); Initialize(); + + m_pInitialFocusWidget = mxTimeEdit.get(); } VclPtr< vcl::Window > MediaPlaybackPanel::Create( diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index b246b7fea273..ab97dc60c8c0 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -449,6 +449,7 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent, initial(); m_aMetricCtl.RequestUpdate(); + m_pInitialFocusWidget = mxTBxHorzAlign.get(); } void ParaPropertyPanel::limitMetricWidths() diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx index 9295d9b5ade4..3d52ae23fb0d 100644 --- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx +++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx @@ -53,6 +53,8 @@ DefaultShapesPanel::DefaultShapesPanel ( , mxFrame(rxFrame) { Initialize(); + + m_pInitialFocusWidget = mxLineArrowSet->GetDrawingArea(); } VclPtr< vcl::Window > DefaultShapesPanel::Create( diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.cxx b/svx/source/sidebar/styles/StylesPropertyPanel.cxx index a583e0603f67..4957d965c416 100644 --- a/svx/source/sidebar/styles/StylesPropertyPanel.cxx +++ b/svx/source/sidebar/styles/StylesPropertyPanel.cxx @@ -28,6 +28,7 @@ StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno: , m_xStyle(m_xBuilder->weld_toolbar("style")) , m_xStyleDispatch(new ToolbarUnoDispatcher(*m_xStyle, *m_xBuilder, rxFrame)) { + m_pInitialFocusWidget = m_xFontStyle.get(); } StylesPropertyPanel::~StylesPropertyPanel() diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index 89292ea03bc1..a637e1c3fe8c 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -70,6 +70,8 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref pViewShell && pViewShell->isLOKMobilePhone()) isMobilePhone = true; mxSpacingBar->set_visible(!isMobilePhone); + + m_pInitialFocusWidget = mxFont.get(); } TextPropertyPanel::~TextPropertyPanel() diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index f24bf135c706..12e400b939b9 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -152,6 +152,8 @@ StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent, mxValueSet->SetDoubleClickHdl(LINK(this, StylePresetsPanel, DoubleClickHdl)); RefreshList(); + + m_pInitialFocusWidget = mxValueSet->GetDrawingArea(); } void StylePresetsPanel::RefreshList() diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx index de053ddaa837..de91b0e37737 100644 --- a/sw/source/uibase/sidebar/TableEditPanel.cxx +++ b/sw/source/uibase/sidebar/TableEditPanel.cxx @@ -138,6 +138,8 @@ TableEditPanel::TableEditPanel(vcl::Window* pParent, if (comphelper::LibreOfficeKit::isActive()) m_xMisc->set_item_visible(".uno:InsertFormula", false); + + m_pInitialFocusWidget = &m_xRowHeightEdit->get_widget(); } TableEditPanel::~TableEditPanel() { disposeOnce(); } diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx index f4c4951f6546..a25b08806d91 100644 --- a/sw/source/uibase/sidebar/ThemePanel.cxx +++ b/sw/source/uibase/sidebar/ThemePanel.cxx @@ -447,6 +447,8 @@ ThemePanel::ThemePanel(vcl::Window* pParent, if (!aColorSets.empty()) mxValueSetColors->SelectItem(1); // ItemId 1, position 0 + + m_pInitialFocusWidget = mxListBoxFonts.get(); } ThemePanel::~ThemePanel() diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx index bc64fd8b7724..08c6405f7a31 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx @@ -79,6 +79,8 @@ WrapPropertyPanel::WrapPropertyPanel( SpacingListBox::Fill(IsInch(eMetric) ? SpacingType::SPACING_INCH : SpacingType::SPACING_CM, *mxSpacingLB); Initialize(); + + m_pInitialFocusWidget = mxWrapOptions.get(); } WrapPropertyPanel::~WrapPropertyPanel() diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index e5e139cba20f..4961c99deaaa 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -648,6 +648,8 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent, m_xDocListBox->set_accessible_name(m_aStatusArr[3]); m_aExpandedSize = GetOptimalSize(); + + m_pInitialFocusWidget = m_xContent1ToolBox.get(); } SwNavigationPI::~SwNavigationPI() -- cgit