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

tdf#117038 set button width to max possible content width

Change-Id: I97e7c27523d213cb06cdf87a8ed0124d1ea8d5ba
Reviewed-on: https://gerrit.libreoffice.org/57717
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c57d6bf9
...@@ -493,6 +493,14 @@ void SvxCharacterMap::init() ...@@ -493,6 +493,14 @@ void SvxCharacterMap::init()
m_xHexCodeText->connect_changed( LINK( this, SvxCharacterMap, HexCodeChangeHdl ) ); m_xHexCodeText->connect_changed( LINK( this, SvxCharacterMap, HexCodeChangeHdl ) );
m_xFavouritesBtn->connect_clicked( LINK(this, SvxCharacterMap, FavSelectHdl)); m_xFavouritesBtn->connect_clicked( LINK(this, SvxCharacterMap, FavSelectHdl));
// tdf#117038 set the buttons width to its max possible width so it doesn't
// make layout change when the label changes
m_xFavouritesBtn->set_label(CuiResId(RID_SVXSTR_REMOVE_FAVORITES));
auto nMaxWidth = m_xFavouritesBtn->get_preferred_size().Width();
m_xFavouritesBtn->set_label(CuiResId(RID_SVXSTR_ADD_FAVORITES));
nMaxWidth = std::max(nMaxWidth, m_xFavouritesBtn->get_preferred_size().Width());
m_xFavouritesBtn->set_size_request(nMaxWidth, -1);
if( SvxShowCharSet::getSelectedChar() == ' ') if( SvxShowCharSet::getSelectedChar() == ' ')
{ {
m_xOKBtn->set_sensitive(false); m_xOKBtn->set_sensitive(false);
...@@ -560,7 +568,7 @@ void SvxCharacterMap::setFavButtonState(const OUString& sTitle, const OUString& ...@@ -560,7 +568,7 @@ void SvxCharacterMap::setFavButtonState(const OUString& sTitle, const OUString&
else else
m_xFavouritesBtn->set_sensitive(true); m_xFavouritesBtn->set_sensitive(true);
if(isFavChar(sTitle, rFont)) if (isFavChar(sTitle, rFont))
{ {
m_xFavouritesBtn->set_label(CuiResId(RID_SVXSTR_REMOVE_FAVORITES)); m_xFavouritesBtn->set_label(CuiResId(RID_SVXSTR_REMOVE_FAVORITES));
} }
......
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