summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-15 20:16:44 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-02-17 10:59:40 +0100
commit97a1d170b5f45c6cf9fc2c56dc4526d0e3f8423a (patch)
treea288c3c26e70e13863bc6d241a22ae4002cb3454 /svx
parent640951c1ac64ff0f7ab2c033c9a2f00ccf0363dc (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/+/110956 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/GalleryControl.cxx1
-rw-r--r--svx/source/gallery2/galbrws1.cxx11
-rw-r--r--svx/source/gallery2/galbrws1.hxx1
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx2
-rw-r--r--svx/source/sidebar/effect/EffectPropertyPanel.cxx2
-rw-r--r--svx/source/sidebar/inspector/InspectorTextPanel.cxx1
-rw-r--r--svx/source/sidebar/lists/ListsPropertyPanel.cxx1
-rw-r--r--svx/source/sidebar/media/MediaPlaybackPanel.cxx2
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx1
-rw-r--r--svx/source/sidebar/shapes/DefaultShapesPanel.cxx2
-rw-r--r--svx/source/sidebar/styles/StylesPropertyPanel.cxx1
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx2
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 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<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 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()