cui/inc/strings.hrc | 2 ++ cui/source/tabpages/tpcolor.cxx | 15 +++++++++++++++ 2 files changed, 17 insertions(+)
New commits: commit c895a6d8298a349784cd0aafff4bf518ac8d0a7d Author: Heiko Tietze <tietze.he...@gmail.com> AuthorDate: Fri May 15 10:51:10 2020 +0200 Commit: Heiko Tietze <heiko.tie...@documentfoundation.org> CommitDate: Fri May 15 11:46:52 2020 +0200 Resolves tdf#132799 - Deleting of colors unclear Tooltips added for disabled states Change-Id: Iad8bdd1c22ce6619e233a4a20b4efcc2d4c5a27c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94264 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index fb5a67ef015d..c70c46d59a39 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -395,6 +395,8 @@ #define RID_SVXSTR_COMMANDTIP NC_("RID_SVXSTR_COMMANDLABEL", "Tooltip") #define RID_SVXSTR_QRCODEDATALONG NC_("RID_SVXSTR_QRCODEDATALONG", "Text exceeds the maximum bits for Error Correction, Enter shorter text") +#define RID_SVXSTR_DELETEUSERCOLOR1 NC_("RID_SVXSTR_DELETEUSERCOLOR1", "You can only delete user-defined colors") +#define RID_SVXSTR_DELETEUSERCOLOR2 NC_("RID_SVXSTR_DELETEUSERCOLOR2", "Please select the color to delete") #endif diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 62d6d321fe1c..5933985a9b50 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -125,6 +125,7 @@ SvxColorTabPage::SvxColorTabPage(weld::Container* pPage, weld::DialogController* // disable modify buttons // Color palettes can't be modified m_xBtnDelete->set_sensitive(false); + m_xBtnDelete->set_tooltip_text( SvxResId(RID_SVXSTR_DELETEUSERCOLOR1) ); // disable preset color values m_xRGBpreset->set_sensitive(false); @@ -365,6 +366,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) m_xValSetColorList->InsertItem( nId + 1 , aCurrentColor, aName ); m_xValSetColorList->SelectItem( nId + 1 ); m_xBtnDelete->set_sensitive(false); + m_xBtnDelete->set_tooltip_text( SvxResId(RID_SVXSTR_DELETEUSERCOLOR2) ); ImpColorCountChanged(); } @@ -421,7 +423,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl, weld::Button&, void) SelectValSetHdl_Impl(m_xValSetColorList.get()); } else + { m_xBtnDelete->set_sensitive(false); + m_xBtnDelete->set_tooltip_text( SvxResId(RID_SVXSTR_DELETEUSERCOLOR2) ); + } } IMPL_LINK_NOARG(SvxColorTabPage, SelectPaletteLBHdl, weld::ComboBox&, void) @@ -454,7 +459,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectPaletteLBHdl, weld::ComboBox&, void) } } if (nPos != 0) + { m_xBtnDelete->set_sensitive(false); + m_xBtnDelete->set_tooltip_text( SvxResId(RID_SVXSTR_DELETEUSERCOLOR1) ); + } m_xValSetColorList->Resize(); } @@ -476,14 +484,21 @@ IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, ValueSet*, pValSet, void) { m_xValSetRecentList->SetNoSelection(); if (m_xSelectPalette->get_active() == 0 && m_xValSetColorList->GetSelectedItemId() != 0) + { m_xBtnDelete->set_sensitive(true); + m_xBtnDelete->set_tooltip_text(""); + } else + { m_xBtnDelete->set_sensitive(false); + m_xBtnDelete->set_tooltip_text( SvxResId(RID_SVXSTR_DELETEUSERCOLOR1) ); + } } if (pValSet == m_xValSetRecentList.get()) { m_xValSetColorList->SetNoSelection(); m_xBtnDelete->set_sensitive(false); + m_xBtnDelete->set_tooltip_text( SvxResId(RID_SVXSTR_DELETEUSERCOLOR2) ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits