summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-27 14:58:00 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-12-23 12:33:16 +0100
commit64f096344fc018c32c2890432058c4148602659c (patch)
tree04d7ad5bc102510e934dc78b65904a9a725a095a /svx
parent60f469f585899e97f3dbc9b98b12d36d9b665eff (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 (cherry picked from commit 794d5a3bb225bbfaced4dd968734783f073ba70b) Reviewed-on: https://gerrit.libreoffice.org/84523 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-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 7ec4a5b8fb61..2d13792a6d84 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1805,7 +1805,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()
@@ -2011,7 +2014,9 @@ IMPL_LINK(ColorWindow, AutoColorClickHdl, weld::Button&, rButton, void)
{
NamedColor aNamedColor = &rButton == mxButtonAutoColor.get() ? GetAutoColor() : GetNoneColor();
+ mxColorSet->SetNoSelection();
mxRecentColorSet->SetNoSelection();
+ mpDefaultButton = &rButton;
if (mpMenuButton->get_active())
mpMenuButton->set_active(false);
@@ -2195,14 +2200,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;
}
@@ -4046,11 +4049,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()
{
}