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

Resolves: tdf#122484 replace gtk autocomplete with vcl-alike autoselect

Change-Id: I941e32a973cdd1bc79e3739b24fdf834aa52cb11
Reviewed-on: https://gerrit.libreoffice.org/66628
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1ebeb222
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion1">
<property name="model">liststore1</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkDialog" id="ManageBreakpointsDialog"> <object class="GtkDialog" id="ManageBreakpointsDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
......
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion1">
<property name="model">liststore1</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkTreeStore" id="liststore2"> <object class="GtkTreeStore" id="liststore2">
<columns> <columns>
<!-- column-name text --> <!-- column-name text -->
...@@ -26,14 +18,6 @@ ...@@ -26,14 +18,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion2">
<property name="model">liststore2</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkTreeStore" id="liststore3"> <object class="GtkTreeStore" id="liststore3">
<columns> <columns>
<!-- column-name text --> <!-- column-name text -->
...@@ -42,14 +26,6 @@ ...@@ -42,14 +26,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion3">
<property name="model">liststore3</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkListStore" id="liststore4"> <object class="GtkListStore" id="liststore4">
<columns> <columns>
<!-- column-name text --> <!-- column-name text -->
...@@ -428,6 +404,7 @@ ...@@ -428,6 +404,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -558,6 +535,7 @@ ...@@ -558,6 +535,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -574,6 +552,7 @@ ...@@ -574,6 +552,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -590,6 +569,7 @@ ...@@ -590,6 +569,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -615,6 +595,7 @@ ...@@ -615,6 +595,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -766,6 +747,7 @@ ...@@ -766,6 +747,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -782,6 +764,7 @@ ...@@ -782,6 +764,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -798,6 +781,7 @@ ...@@ -798,6 +781,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -973,6 +957,7 @@ ...@@ -973,6 +957,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -989,6 +974,7 @@ ...@@ -989,6 +974,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
...@@ -1005,6 +991,7 @@ ...@@ -1005,6 +991,7 @@
<child internal-child="entry"> <child internal-child="entry">
<object class="GtkEntry"> <object class="GtkEntry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
</object> </object>
</child> </child>
</object> </object>
......
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion1">
<property name="model">liststore1</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
<property name="lower">-56</property> <property name="lower">-56</property>
<property name="upper">56</property> <property name="upper">56</property>
......
...@@ -929,6 +929,7 @@ public: ...@@ -929,6 +929,7 @@ public:
virtual int get_active() const override { return m_xTreeView->get_selected_index(); } virtual int get_active() const override { return m_xTreeView->get_selected_index(); }
virtual void set_active(int pos) override virtual void set_active(int pos) override
{ {
m_xTreeView->set_cursor(pos);
m_xTreeView->select(pos); m_xTreeView->select(pos);
m_xEntry->set_text(m_xTreeView->get_selected_text()); m_xEntry->set_text(m_xTreeView->get_selected_text());
} }
......
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion1">
<property name="model">liststore1</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkDialog" id="CreateStyleDialog"> <object class="GtkDialog" id="CreateStyleDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
......
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkEntryCompletion" id="entrycompletion1">
<property name="model">liststore1</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkDialog" id="FontDialog"> <object class="GtkDialog" id="FontDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
......
...@@ -2108,6 +2108,7 @@ public: ...@@ -2108,6 +2108,7 @@ public:
{ {
SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos); SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
m_xTreeView->Select(pEntry, true); m_xTreeView->Select(pEntry, true);
m_xTreeView->MakeVisible(pEntry);
} }
enable_notify_events(); enable_notify_events();
} }
...@@ -3501,6 +3502,8 @@ IMPL_LINK(SalInstanceEntryTreeView, AutocompleteHdl, Edit&, rEdit, void) ...@@ -3501,6 +3502,8 @@ IMPL_LINK(SalInstanceEntryTreeView, AutocompleteHdl, Edit&, rEdit, void)
} }
} }
m_xTreeView->select(nPos);
if (nPos != -1) if (nPos != -1)
{ {
OUString aText = m_xTreeView->get_text(nPos); OUString aText = m_xTreeView->get_text(nPos);
......
...@@ -376,34 +376,8 @@ namespace weld ...@@ -376,34 +376,8 @@ namespace weld
m_aChangeHdl.Call(*this); m_aChangeHdl.Call(*this);
} }
void EntryTreeView::EntryModifyHdl(weld::Entry& rBox) IMPL_LINK_NOARG(EntryTreeView, ModifyHdl, weld::Entry&, void)
{ {
OUString sText(rBox.get_text());
int nExists = m_xTreeView->find_text(sText);
if (nExists != -1)
{
m_xTreeView->select(nExists);
return;
}
m_xTreeView->select(-1);
if (sText.isEmpty())
return;
int nCount = m_xTreeView->n_children();
for (int i = 0; i < nCount; ++i)
{
if (m_xTreeView->get_text(i).startsWith(sText))
{
m_xTreeView->select(i);
break;
}
}
}
IMPL_LINK(EntryTreeView, ModifyHdl, weld::Entry&, rBox, void)
{
EntryModifyHdl(rBox);
m_aChangeHdl.Call(*this); m_aChangeHdl.Call(*this);
} }
......
This diff is collapsed.
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