diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-15 14:00:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-15 20:57:01 +0100 |
commit | 405aa1b6a226c58966d319f25e4ebf2e400d5e50 (patch) | |
tree | d1825a0e37182458aa15b8d01dbe41c17aaf02ec /svtools | |
parent | 2e29dc20b96f2d96f5b64e9ed5efb79e342b3f54 (diff) |
tdf#135641 update DataBrowser has-focus when child widget gains focus
Change-Id: Ic5e618b50c31ebeffa1b2cc59857582804874747
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109369
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 3 | ||||
-rw-r--r-- | svtools/source/brwbox/ebbcontrols.cxx | 10 | ||||
-rw-r--r-- | svtools/source/brwbox/editbrowsebox.cxx | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 592042b6fae2..72830817e192 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1686,6 +1686,9 @@ bool BrowseBox::ProcessKey( const KeyEvent& rEvt ) return nId != BROWSER_NONE; } +void BrowseBox::ChildFocusIn() +{ +} void BrowseBox::Dispatch( sal_uInt16 nId ) { diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index 5e22c9ba33c1..db614a86c31c 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -30,6 +30,7 @@ namespace svt m_xWidget->set_entry_width_chars(1); // so a smaller than default width can be used m_xWidget->connect_changed(LINK(this, ComboBoxControl, SelectHdl)); m_xWidget->connect_key_press(LINK(this, ControlBase, KeyInputHdl)); + m_xWidget->connect_focus_in(LINK(this, ControlBase, FocusInHdl)); } void ComboBoxControl::dispose() @@ -115,6 +116,7 @@ namespace svt m_xWidget->set_size_request(42, -1); // so a later narrow size request can stick m_xWidget->connect_changed(LINK(this, ListBoxControl, SelectHdl)); m_xWidget->connect_key_press(LINK(this, ControlBase, KeyInputHdl)); + m_xWidget->connect_focus_in(LINK(this, ControlBase, FocusInHdl)); } void ListBoxControl::dispose() @@ -183,6 +185,7 @@ namespace svt m_aModeState.bTriStateEnabled = true; InitControlBase(m_xBox.get()); m_xBox->connect_key_press(LINK(this, ControlBase, KeyInputHdl)); + m_xBox->connect_focus_in(LINK(this, ControlBase, FocusInHdl)); m_xBox->connect_toggled(LINK(this, CheckBoxControl, OnToggle)); } @@ -334,6 +337,7 @@ namespace svt m_pEntry->show(); m_pEntry->set_width_chars(1); // so a smaller than default width can be used m_pEntry->connect_key_press(LINK(this, ControlBase, KeyInputHdl)); + m_pEntry->connect_focus_in(LINK(this, ControlBase, FocusInHdl)); } bool ControlBase::ProcessKey(const KeyEvent& rKEvt) @@ -346,6 +350,11 @@ namespace svt return ProcessKey(rKEvt); } + IMPL_LINK_NOARG(ControlBase, FocusInHdl, weld::Widget&, void) + { + return static_cast<BrowserDataWin*>(GetParent())->GetParent()->ChildFocusIn(); + } + void EditControlBase::dispose() { m_pEntry = nullptr; @@ -608,6 +617,7 @@ namespace svt { InitControlBase(m_xWidget.get()); m_xWidget->connect_key_press(LINK(this, ControlBase, KeyInputHdl)); + m_xWidget->connect_focus_in(LINK(this, ControlBase, FocusInHdl)); // so any the natural size doesn't have an effect m_xWidget->set_size_request(1, 1); } diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 4c2559ea2742..71126b5a3f4b 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -192,7 +192,7 @@ namespace svt if (IsEditing() && Controller()->GetWindow().IsVisible()) Controller()->GetWindow().GrabFocus(); - DetermineFocus( getRealGetFocusFlags( this ) ); + DetermineFocus(getRealGetFocusFlags(this)); } @@ -413,6 +413,10 @@ namespace svt } } + void EditBrowseBox::ChildFocusIn() + { + DetermineFocus(getRealGetFocusFlags(this)); + } void EditBrowseBox::MouseButtonDown(const BrowserMouseEvent& rEvt) { @@ -645,7 +649,7 @@ namespace svt switch (rEvt.GetType()) { case MouseNotifyEvent::GETFOCUS: - DetermineFocus( getRealGetFocusFlags( this ) ); + DetermineFocus(getRealGetFocusFlags(this)); break; case MouseNotifyEvent::LOSEFOCUS: |