Kaydet (Commit) 6f070fb2 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#120169 handle [combo|list]box can-focus specially

Change-Id: I93fec026079ac37993e48fac48d937a0a20e5b0f
Reviewed-on: https://gerrit.libreoffice.org/61081Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ad6adb1b
......@@ -1530,6 +1530,18 @@ bool ComboBox::set_property(const OString &rKey, const OUString &rValue)
SetWidthInChars(rValue.toInt32());
else if (rKey == "max-width-chars")
setMaxWidthChars(rValue.toInt32());
else if (rKey == "can-focus")
{
// as far as I can see in Gtk, setting a ComboBox as can.focus means
// the focus gets stuck in it, so try here to behave like gtk does
// with the settings that work, i.e. can.focus of false doesn't
// set the hard WB_NOTABSTOP
WinBits nBits = GetStyle();
nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
if (toBool(rValue))
nBits |= WB_TABSTOP;
SetStyle(nBits);
}
else
return Control::set_property(rKey, rValue);
return true;
......
......@@ -1428,6 +1428,18 @@ bool ListBox::set_property(const OString &rKey, const OUString &rValue)
SelectEntryPos(rValue.toInt32());
else if (rKey == "max-width-chars")
setMaxWidthChars(rValue.toInt32());
else if (rKey == "can-focus")
{
// as far as I can see in Gtk, setting a ComboBox as can.focus means
// the focus gets stuck in it, so try here to behave like gtk does
// with the settings that work, i.e. can.focus of false doesn't
// set the hard WB_NOTABSTOP
WinBits nBits = GetStyle();
nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
if (toBool(rValue))
nBits |= WB_TABSTOP;
SetStyle(nBits);
}
else
return Control::set_property(rKey, rValue);
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment