summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/colorwindow.hxx1
-rw-r--r--svtools/source/control/ctrlbox.cxx4
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx14
3 files changed, 11 insertions, 8 deletions
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx
index 45a5a8b30343..c3863f80ee80 100644
--- a/include/svx/colorwindow.hxx
+++ b/include/svx/colorwindow.hxx
@@ -149,6 +149,7 @@ private:
std::unique_ptr<weld::Widget> mxAutomaticSeparator;
std::unique_ptr<weld::CustomWeld> mxColorSetWin;
std::unique_ptr<weld::CustomWeld> mxRecentColorSetWin;
+ weld::Button* mpDefaultButton;
DECL_LINK(SelectHdl, SvtValueSet*, void);
DECL_LINK(SelectPaletteHdl, weld::ComboBox&, void);
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index d67c69dce9e3..61d1d9e729ac 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1597,12 +1597,12 @@ void SvtLineListBox::SelectEntry(SvxBorderLineStyle nStyle)
if (nStyle == SvxBorderLineStyle::NONE)
{
m_xLineSet->SetNoSelection();
- m_xNoneButton->set_has_default(true);
+ m_xNoneButton->grab_focus();
}
else
{
m_xLineSet->SelectItem(static_cast<sal_Int16>(nStyle) + 1);
- m_xNoneButton->set_has_default(false);
+ m_xLineSet->GrabFocus();
}
UpdatePreview();
}
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 2c2603fb4c8d..1b8d6fe09092 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1791,6 +1791,7 @@ ColorWindow::ColorWindow(std::shared_ptr<PaletteManager> const & rPaletteManager
, mxAutomaticSeparator(m_xBuilder->weld_widget("separator4"))
, mxColorSetWin(new weld::CustomWeld(*m_xBuilder, "colorset", *mxColorSet))
, mxRecentColorSetWin(new weld::CustomWeld(*m_xBuilder, "recent_colorset", *mxRecentColorSet))
+ , mpDefaultButton(nullptr)
{
mxColorSet->SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) );
mxRecentColorSet->SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) );
@@ -1988,7 +1989,7 @@ NamedColor ColorWindow::GetSelectEntryColor() const
return GetSelectEntryColor(mxColorSet.get());
if (!mxRecentColorSet->IsNoSelection())
return GetSelectEntryColor(mxRecentColorSet.get());
- if (mxButtonNoneColor->get_has_default())
+ if (mxButtonNoneColor.get() == mpDefaultButton)
return GetNoneColor();
return GetAutoColor();
}
@@ -2130,8 +2131,7 @@ void ColorWindow::SetNoSelection()
{
mxColorSet->SetNoSelection();
mxRecentColorSet->SetNoSelection();
- mxButtonAutoColor->set_has_default(false);
- mxButtonNoneColor->set_has_default(false);
+ mpDefaultButton = nullptr;
}
bool SvxColorWindow::IsNoSelection() const
@@ -2259,15 +2259,17 @@ void ColorWindow::SelectEntry(const NamedColor& rNamedColor)
const Color &rColor = rNamedColor.first;
- if (mxButtonNoneColor->get_visible() && (rColor == COL_TRANSPARENT || rColor == COL_AUTO))
+ if (mxButtonAutoColor->get_visible() && (rColor == COL_TRANSPARENT || rColor == COL_AUTO))
{
- mxButtonAutoColor->set_has_default(true);
+ mpDefaultButton = mxButtonAutoColor.get();
+ mxButtonAutoColor->grab_focus();
return;
}
if (mxButtonNoneColor->get_visible() && rColor == COL_NONE_COLOR)
{
- mxButtonNoneColor->set_has_default(true);
+ mpDefaultButton = mxButtonNoneColor.get();
+ mxButtonNoneColor->grab_focus();
return;
}