diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-15 14:00:50 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-01-17 21:39:40 +0100 |
commit | 51c7c4ddb884703907759918f0541f9ad1f1fd98 (patch) | |
tree | ff4bafd702d16fb207608a4b9035c0aeda9cf706 | |
parent | e819872ebc1f7f005cea3916561dae03c43f8552 (diff) |
tdf#135641 update DataBrowser has-focus when child widget gains focus
Change-Id: Ic5e618b50c31ebeffa1b2cc59857582804874747
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109372
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | include/svtools/brwbox.hxx | 1 | ||||
-rw-r--r-- | include/svtools/editbrowsebox.hxx | 2 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 3 | ||||
-rw-r--r-- | svtools/source/brwbox/ebbcontrols.cxx | 7 | ||||
-rw-r--r-- | svtools/source/brwbox/editbrowsebox.cxx | 8 |
5 files changed, 19 insertions, 2 deletions
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index 0b0d3af6fb2e..47deb3af6755 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -507,6 +507,7 @@ public: bool ReserveControlArea(sal_uInt16 nWidth = USHRT_MAX); tools::Rectangle GetControlArea() const; bool ProcessKey( const KeyEvent& rEvt ); + virtual void ChildFocusIn(); void Dispatch( sal_uInt16 nId ); void SetMode( BrowserMode nMode ); BrowserMode GetMode( ) const { return m_nCurrentMode; } diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index a1a38353637e..1b9fd13aa93f 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -326,6 +326,7 @@ namespace svt virtual bool ControlHasFocus() const = 0; protected: DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + DECL_LINK(FocusInHdl, weld::Widget&, void); }; //= ComboBoxControl @@ -691,6 +692,7 @@ namespace svt virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override; css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState); + virtual void ChildFocusIn() override; bool ControlHasFocus() const; protected: // creates the accessible which wraps the active cell diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index e9e725149020..8cd05f2daa7c 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1698,6 +1698,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 c38025d0a13e..e5e404bb291f 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -35,6 +35,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() @@ -116,6 +117,11 @@ namespace svt return static_cast<BrowserDataWin*>(GetParent())->GetParent()->ProcessKey(rKEvt); } + IMPL_LINK_NOARG(ControlBase, FocusInHdl, weld::Widget&, void) + { + return static_cast<BrowserDataWin*>(GetParent())->GetParent()->ChildFocusIn(); + } + //= ListBoxControl ListBoxControl::ListBoxControl(vcl::Window* pParent) : ControlBase(pParent, "svt/ui/listcontrol.ui", "ListControl") @@ -124,6 +130,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() diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 12ef6d6fd181..83b44d07daf1 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -194,7 +194,7 @@ namespace svt if (IsEditing() && Controller()->GetWindow().IsVisible()) Controller()->GetWindow().GrabFocus(); - DetermineFocus( getRealGetFocusFlags( this ) ); + DetermineFocus(getRealGetFocusFlags(this)); } @@ -415,6 +415,10 @@ namespace svt } } + void EditBrowseBox::ChildFocusIn() + { + DetermineFocus(getRealGetFocusFlags(this)); + } void EditBrowseBox::MouseButtonDown(const BrowserMouseEvent& rEvt) { @@ -677,7 +681,7 @@ namespace svt switch (rEvt.GetType()) { case MouseNotifyEvent::GETFOCUS: - DetermineFocus( getRealGetFocusFlags( this ) ); + DetermineFocus(getRealGetFocusFlags(this)); break; case MouseNotifyEvent::LOSEFOCUS: |