From cd384e2d31f74223948ea70d8aa3c318d3ceeb50 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 5 Jun 2020 16:11:39 +0100 Subject: rework treeview initial toggle button col to be like expander col MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cause this assumption is baked into the vcl one making it hard to adapt remaining cases Change-Id: I75dd5264c65b1ffbf4d26c9a86f6d4d08b400d90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95622 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- desktop/source/deployment/gui/dp_gui_updatedialog.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'desktop') diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index cb161d631809..5d65f4e7c618 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -455,9 +455,7 @@ UpdateDialog::UpdateDialog( m_xDescriptions->set_size_request(nWidth, nHeight); m_xUpdates->set_size_request(nWidth, nHeight); - std::vector aWidths; - aWidths.push_back(m_xUpdates->get_checkbox_column_width()); - m_xUpdates->set_column_fixed_widths(aWidths); + m_xUpdates->enable_toggle_buttons(weld::ColumnToggleType::Check); OSL_ASSERT(updateData != nullptr); @@ -492,7 +490,7 @@ IMPL_LINK(UpdateDialog, entryToggled, const weld::TreeView::iter_col&, rRowCol, // error's can't be enabled const UpdateDialog::Index* p = reinterpret_cast(m_xUpdates->get_id(rRowCol.first).toInt64()); if (p->m_eKind == SPECIFIC_ERROR) - m_xUpdates->set_toggle(rRowCol.first, TRISTATE_FALSE, 0); + m_xUpdates->set_toggle(rRowCol.first, TRISTATE_FALSE); enableOk(); } @@ -501,8 +499,8 @@ void UpdateDialog::insertItem(UpdateDialog::Index *pEntry, bool bEnabledCheckBox { int nEntry = m_xUpdates->n_children(); m_xUpdates->append(); - m_xUpdates->set_toggle(nEntry, bEnabledCheckBox ? TRISTATE_TRUE : TRISTATE_FALSE, 0); - m_xUpdates->set_text(nEntry, pEntry->m_aName, 1); + m_xUpdates->set_toggle(nEntry, bEnabledCheckBox ? TRISTATE_TRUE : TRISTATE_FALSE); + m_xUpdates->set_text(nEntry, pEntry->m_aName, 0); m_xUpdates->set_id(nEntry, OUString::number(reinterpret_cast(pEntry))); } @@ -587,7 +585,7 @@ void UpdateDialog::enableOk() { if (!m_xChecking->get_visible()) { int nChecked = 0; for (int i = 0, nCount = m_xUpdates->n_children(); i < nCount; ++i) { - if (m_xUpdates->get_toggle(i, 0) == TRISTATE_TRUE) + if (m_xUpdates->get_toggle(i) == TRISTATE_TRUE) ++nChecked; } m_xOk->set_sensitive(nChecked != 0); @@ -987,7 +985,7 @@ IMPL_LINK_NOARG(UpdateDialog, okHandler, weld::Button&, void) UpdateDialog::Index const * p = reinterpret_cast< UpdateDialog::Index const * >( m_xUpdates->get_id(i).toInt64()); - if (p->m_eKind == ENABLED_UPDATE && m_xUpdates->get_toggle(i, 0) == TRISTATE_TRUE) { + if (p->m_eKind == ENABLED_UPDATE && m_xUpdates->get_toggle(i) == TRISTATE_TRUE) { m_updateData.push_back( m_enabledUpdates[ p->m_nIndex ] ); } } -- cgit