[Libreoffice-commits] core.git: cui/source svx/source
Rishabh Kumar
kris.kr296 at gmail.com
Thu Jul 21 19:46:49 UTC 2016
cui/source/tabpages/tpgradnt.cxx | 2 ++
cui/source/tabpages/tphatch.cxx | 2 ++
cui/source/tabpages/tppattern.cxx | 2 ++
svx/source/tbxctrls/SvxPresetListBox.cxx | 10 ++++++++--
4 files changed, 14 insertions(+), 2 deletions(-)
New commits:
commit 6f2b129a8e327f4226314944bc86eca78e5b1797
Author: Rishabh Kumar <kris.kr296 at gmail.com>
Date: Thu Jul 21 21:57:26 2016 +0530
Minor UI changes for SvxPresetListBox
1. Reduced item icon size.
2. Add slider depending on the number of entries.
Change-Id: I1fad15861438952664c26666afe89fffa08051f6
Reviewed-on: https://gerrit.libreoffice.org/27389
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 0f3d0f5..7e9eba6 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -520,6 +520,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
Bitmap aBitmap = m_pGradientList->GetBitmapForPreview( nCount, m_pGradientLB->GetIconSize() );
m_pGradientLB->InsertItem( nId + 1, Image(aBitmap), aName );
m_pGradientLB->SelectItem( nId + 1 );
+ m_pGradientLB->Resize();
*m_pnGradientListState |= ChangeType::MODIFIED;
@@ -579,6 +580,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*
m_pGradientLB->RemoveItem( nId );
nId = m_pGradientLB->GetItemId( 0 );
m_pGradientLB->SelectItem( nId );
+ m_pGradientLB->Resize();
m_pCtlPreview->Invalidate();
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 941fe25..33eb0d3 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -584,6 +584,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
// Insert the new entry at the next ID
m_pHatchLB->InsertItem( nId + 1, Image(aBitmap), aName );
m_pHatchLB->SelectItem( nId + 1 );
+ m_pHatchLB->Resize();
*m_pnHatchingListState |= ChangeType::MODIFIED;
@@ -640,6 +641,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, v
m_pHatchLB->RemoveItem( nId );
nId = m_pHatchLB->GetItemId(0);
m_pHatchLB->SelectItem( nId );
+ m_pHatchLB->Resize();
m_pCtlPreview->Invalidate();
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 48560ce6..4b2570b 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -552,6 +552,7 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void)
Bitmap aBitmap = m_pPatternList->GetBitmapForPreview( nCount, m_pPatternLB->GetIconSize() );
m_pPatternLB->InsertItem( nId + 1, Image(aBitmap), aName );
m_pPatternLB->SelectItem( nId + 1 );
+ m_pPatternLB->Resize();
*m_pnPatternListState |= ChangeType::MODIFIED;
@@ -672,6 +673,7 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*,
m_pPatternLB->RemoveItem( nId );
nId = m_pPatternLB->GetItemId(0);
m_pPatternLB->SelectItem( nId );
+ m_pPatternLB->Resize();
m_pCtlPreview->Invalidate();
m_pCtlPixel->Invalidate();
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx
index c93f969..1f73a4c 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -32,7 +32,7 @@ SvxPresetListBox::SvxPresetListBox(vcl::Window* pParent, WinBits nWinStyle)
: ValueSet(pParent, nWinStyle),
nColCount(2),
nRowCount(5),
- aIconSize( Size(100,60) )
+ aIconSize( Size(80,60) )
{
SetEdgeBlending(true);
SetExtraSpacing(4);
@@ -45,13 +45,19 @@ VCL_BUILDER_DECL_FACTORY(SvxPresetListBox)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if(!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- nWinBits |= (WB_ITEMBORDER| WB_3DLOOK|WB_OWNERDRAWDECORATION|WB_VSCROLL);
+ nWinBits |= (WB_ITEMBORDER| WB_3DLOOK|WB_OWNERDRAWDECORATION);
rRet = VclPtr<SvxPresetListBox>::Create(pParent, nWinBits);
}
void SvxPresetListBox::Resize()
{
DrawLayout();
+ WinBits aWinBits(GetStyle());
+ if( nColCount*nRowCount < static_cast<sal_uInt16>(GetItemCount()) )
+ aWinBits |= WB_VSCROLL;
+ else
+ aWinBits &= ~WB_VSCROLL;
+ SetStyle(aWinBits);
ValueSet::Resize();
}
More information about the Libreoffice-commits
mailing list