diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-05 16:11:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-08 20:21:35 +0200 |
commit | cd384e2d31f74223948ea70d8aa3c318d3ceeb50 (patch) | |
tree | 49ae5191c2bd4b13c3cd547951933fbc37cda0fa /cui/source/options/certpath.cxx | |
parent | c3669c8bd62ecf5eaa6b5e95289825bc11b2688a (diff) |
rework treeview initial toggle button col to be like expander col
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 <caolanm@redhat.com>
Diffstat (limited to 'cui/source/options/certpath.cxx')
-rw-r--r-- | cui/source/options/certpath.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index 3b491dadaf89..630f5e0710fe 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -29,18 +29,12 @@ CertPathDialog::CertPathDialog(weld::Window* pParent) , m_sAddDialogText(m_xBuilder->weld_label("certdir")->get_label()) , m_sManualLabel(m_xBuilder->weld_label("manual")->get_label()) { - // these are just used to get translated strings - m_xCertPathList->set_size_request(m_xCertPathList->get_approximate_digit_width() * 70, m_xCertPathList->get_height_rows(6)); - std::vector<int> aWidths; - aWidths.push_back(m_xCertPathList->get_checkbox_column_width()); - aWidths.push_back(m_xCertPathList->get_approximate_digit_width() * 20); - m_xCertPathList->set_column_fixed_widths(aWidths); - m_xCertPathList->set_toggle_columns_as_radio(); - + m_xCertPathList->enable_toggle_buttons(weld::ColumnToggleType::Radio); m_xCertPathList->connect_toggled(LINK(this, CertPathDialog, CheckHdl_Impl)); + m_xManualButton->connect_clicked( LINK( this, CertPathDialog, ManualHdl_Impl ) ); m_xOKButton->connect_clicked( LINK( this, CertPathDialog, OKHdl_Impl ) ); @@ -159,7 +153,7 @@ IMPL_LINK(CertPathDialog, CheckHdl_Impl, const weld::TreeView::iter_col&, rRowCo void CertPathDialog::HandleEntryChecked(int nRow) { - const bool bChecked = m_xCertPathList->get_toggle(nRow, 0) == TRISTATE_TRUE; + const bool bChecked = m_xCertPathList->get_toggle(nRow) == TRISTATE_TRUE; if (bChecked) { // we have radio button behavior -> so uncheck the other entries @@ -168,7 +162,7 @@ void CertPathDialog::HandleEntryChecked(int nRow) for (int i = 0; i < nCount; ++i) { if (i != nRow) - m_xCertPathList->set_toggle(i, TRISTATE_FALSE, 0); + m_xCertPathList->set_toggle(i, TRISTATE_FALSE); } } } @@ -182,12 +176,12 @@ void CertPathDialog::AddCertPath(const OUString &rProfile, const OUString &rPath //already exists, just select the original one if (sCertPath == rPath) { - const bool bWantSelected = bSelect || m_xCertPathList->get_toggle(i, 0); - m_xCertPathList->set_toggle(i, bWantSelected ? TRISTATE_TRUE : TRISTATE_FALSE, 0); + const bool bWantSelected = bSelect || m_xCertPathList->get_toggle(i); + m_xCertPathList->set_toggle(i, bWantSelected ? TRISTATE_TRUE : TRISTATE_FALSE); HandleEntryChecked(i); return; } - else if (m_xCertPathList->get_text(i, 1) == rProfile) + else if (m_xCertPathList->get_text(i, 0) == rProfile) nRow = i; } @@ -199,9 +193,9 @@ void CertPathDialog::AddCertPath(const OUString &rProfile, const OUString &rPath m_xCertPathList->append(); nRow = m_xCertPathList->n_children() - 1; } - m_xCertPathList->set_toggle(nRow, bSelect ? TRISTATE_TRUE : TRISTATE_FALSE, 0); - m_xCertPathList->set_text(nRow, rProfile, 1); - m_xCertPathList->set_text(nRow, rPath, 2); + m_xCertPathList->set_toggle(nRow, bSelect ? TRISTATE_TRUE : TRISTATE_FALSE); + m_xCertPathList->set_text(nRow, rProfile, 0); + m_xCertPathList->set_text(nRow, rPath, 1); m_xCertPathList->set_id(nRow, rPath); HandleEntryChecked(nRow); } |