diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-18 17:22:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-18 21:24:43 +0100 |
commit | 422a8c3218b484817a8723b57fe9845d6abb83f4 (patch) | |
tree | f437367d1ed111060558e05f289dc2889528408d /include | |
parent | c56e0c791a79dc414108e1b2fbf0f7eb38657f10 (diff) |
update DataBrowser has-focus when child widget loses focus
similar to tdf#135641 case, focus-out becomes an issue with
the bibliography editor if focus-in is seen on clicking in a cell,
then click in a GtkEntry and tab around in a circle. Without this
lose-focus support focus will be grabbed back to the cell of the
initial click on a circuit of the focus-cycle
Change-Id: I36288ed21dc4357c077f8dee55b55abf2457c2a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111157
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/brwbox.hxx | 1 | ||||
-rw-r--r-- | include/svtools/editbrowsebox.hxx | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index 8e7b3fc6f4dc..948650015e19 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -588,6 +588,7 @@ public: tools::Rectangle GetControlArea() const; virtual bool ProcessKey(const KeyEvent& rEvt); virtual void ChildFocusIn(); + virtual void ChildFocusOut(); 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 34696522bd78..6ff261e2e254 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -174,6 +174,7 @@ namespace svt protected: DECL_LINK(KeyInputHdl, const KeyEvent&, bool); DECL_LINK(FocusInHdl, weld::Widget&, void); + DECL_LINK(FocusOutHdl, weld::Widget&, void); }; class SVT_DLLPUBLIC EditControlBase : public ControlBase @@ -191,6 +192,7 @@ namespace svt weld::Entry& get_widget() { return *m_pEntry; } virtual void connect_changed(const Link<weld::Entry&, void>& rLink) = 0; + virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) = 0; protected: void InitEditControlBase(weld::Entry* pEntry); @@ -211,6 +213,11 @@ namespace svt m_xWidget->connect_changed(rLink); } + virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) override + { + m_xWidget->connect_focus_out(rLink); + } + protected: std::unique_ptr<weld::Entry> m_xWidget; }; @@ -696,6 +703,7 @@ namespace svt virtual void dispose() override; virtual void connect_changed(const Link<weld::Entry&, void>& rLink) override; + virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) override; weld::EntryFormatter& get_formatter(); @@ -762,6 +770,7 @@ namespace svt weld::PatternFormatter& get_formatter() { return *m_xEntryFormatter; } virtual void connect_changed(const Link<weld::Entry&, void>& rLink) override; + virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) override; virtual void dispose() override; private: @@ -995,6 +1004,7 @@ namespace svt virtual bool ProcessKey(const KeyEvent& rEvt) override; virtual void ChildFocusIn() override; + virtual void ChildFocusOut() override; css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCheckBoxCell(sal_Int32 _nRow, sal_uInt16 _nColumnPos,const TriState& eState); bool ControlHasFocus() const; |