diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-15 20:16:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-16 10:07:52 +0100 |
commit | e8ffe26c0621e5eaa94bab5d24651e9abd4ea178 (patch) | |
tree | 91abf6f4563af692e05d933d9386d894c43a3926 /svx/source | |
parent | bdf7c31defeaf91a4f35d3b3d8eba4e5fbe66937 (diff) |
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/+/110955
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/gallery2/GalleryControl.cxx | 1 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws1.cxx | 11 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws1.hxx | 1 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/effect/EffectPropertyPanel.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/inspector/InspectorTextPanel.cxx | 1 | ||||
-rw-r--r-- | svx/source/sidebar/lists/ListsPropertyPanel.cxx | 1 | ||||
-rw-r--r-- | svx/source/sidebar/media/MediaPlaybackPanel.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 1 | ||||
-rw-r--r-- | svx/source/sidebar/shapes/DefaultShapesPanel.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/styles/StylesPropertyPanel.cxx | 1 | ||||
-rw-r--r-- | svx/source/sidebar/text/TextPropertyPanel.cxx | 2 |
12 files changed, 24 insertions, 3 deletions
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 2c2d8efa64cf..295adea78d9a 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -304,12 +304,17 @@ void GalleryBrowser1::ImplExecute(std::string_view 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 d179972dc999..7a51bd0928b1 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -86,6 +86,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 43ee78a9f83a..5e210968b4a1 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -107,6 +107,8 @@ AreaPropertyPanelBase::AreaPropertyPanelBase( mpPanel = dynamic_cast<sfx2::sidebar::Panel*>(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 6c429420cf65..58d027b0cfd6 100644 --- a/svx/source/sidebar/effect/EffectPropertyPanel.cxx +++ b/svx/source/sidebar/effect/EffectPropertyPanel.cxx @@ -41,6 +41,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 7c713696320a..7b07be9997c4 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -58,6 +58,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 7e23e090fbd3..e976e9b25985 100644 --- a/svx/source/sidebar/styles/StylesPropertyPanel.cxx +++ b/svx/source/sidebar/styles/StylesPropertyPanel.cxx @@ -36,6 +36,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 4b5adca519ab..ac93e6c70e2c 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() |