summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-15 14:00:50 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-01-17 21:39:14 +0100
commit3812a2678c8aeba6ea980e3df5ee63792a217199 (patch)
treef8bb62922b0e9d1fced3f994c3125854b1632576 /svtools
parentc53b908663f7f9c3c8884961dae2b8699cc32db3 (diff)
tdf#135641 update DataBrowser has-focus when child widget gains focus
Change-Id: Ic5e618b50c31ebeffa1b2cc59857582804874747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109349 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox2.cxx3
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx10
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx8
3 files changed, 19 insertions, 2 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index d2e9f4e04237..5424edfb0cf2 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1687,6 +1687,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 6557552fc7d5..32c29784ce7b 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -31,6 +31,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,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()
@@ -184,6 +186,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));
}
@@ -335,6 +338,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)
@@ -347,6 +351,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;
@@ -609,6 +618,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: