summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-27 14:58:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-28 13:31:44 +0100
commit794d5a3bb225bbfaced4dd968734783f073ba70b (patch)
tree3cf7e9224e3bc8b0345bfc44e5958e45c4186f61 /svx/source
parent270d134752568158ddad9cd8c783879203684a06 (diff)
don't put focus into unmapped windows
defer until the color selectors are activated to grab focus, otherwise esc doesn't work to close a dialog under gtk3 until focus is put into some visible widget Change-Id: I297c2738c4103024bbefd70bbcb5d72b8429dd3e Reviewed-on: https://gerrit.libreoffice.org/83917 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit e55a1dc163165cb79fc9113101d16ee8d3db7298) Reviewed-on: https://gerrit.libreoffice.org/83966
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 4e6e10e84138..7fc12c76a47d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1872,7 +1872,10 @@ ColorWindow::ColorWindow(std::shared_ptr<PaletteManager> const & rPaletteManager
IMPL_LINK_NOARG(ColorWindow, FocusHdl, weld::Widget&, void)
{
- mxColorSet->GrabFocus();
+ if (mxColorSet->IsNoSelection() && mpDefaultButton)
+ mpDefaultButton->grab_focus();
+ else
+ mxColorSet->GrabFocus();
}
void SvxColorWindow::ShowNoneButton()
@@ -2078,7 +2081,9 @@ IMPL_LINK(ColorWindow, AutoColorClickHdl, weld::Button&, rButton, void)
{
NamedColor aNamedColor = &rButton == mxButtonAutoColor.get() ? GetAutoColor() : GetNoneColor();
+ mxColorSet->SetNoSelection();
mxRecentColorSet->SetNoSelection();
+ mpDefaultButton = &rButton;
if (maMenuButton.get_active())
maMenuButton.set_active(false);
@@ -2262,14 +2267,12 @@ void ColorWindow::SelectEntry(const NamedColor& rNamedColor)
if (mxButtonAutoColor->get_visible() && (rColor == COL_TRANSPARENT || rColor == COL_AUTO))
{
mpDefaultButton = mxButtonAutoColor.get();
- mxButtonAutoColor->grab_focus();
return;
}
if (mxButtonNoneColor->get_visible() && rColor == COL_NONE_COLOR)
{
mpDefaultButton = mxButtonNoneColor.get();
- mxButtonNoneColor->grab_focus();
return;
}
@@ -4114,11 +4117,18 @@ ColorListBox::ColorListBox(std::unique_ptr<weld::MenuButton> pControl, weld::Win
, m_nSlotId(0)
, m_bShowNoneButton(false)
{
+ m_xButton->connect_toggled(LINK(this, ColorListBox, ToggleHdl));
m_aSelectedColor = GetAutoColor(m_nSlotId);
LockWidthRequest();
ShowPreview(m_aSelectedColor);
}
+IMPL_LINK(ColorListBox, ToggleHdl, weld::ToggleButton&, rButton, void)
+{
+ if (rButton.get_active())
+ getColorWindow()->FocusHdl(*m_xButton);
+}
+
ColorListBox::~ColorListBox()
{
}