summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-12-20 09:18:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-12-20 16:52:56 +0000
commit3c70c8e449253b4219c12ee4ef50384030a474ef (patch)
tree7cfa9a7f25b8fc8d3f878f335f358e0cea9ba3b9 /vcl/source
parent049afdad58b7b07698b6002659f075aa555688f3 (diff)
implement small-size variant stock image buttons
Change-Id: I82d5a957b5c38b8aa19e28ceb8d6850c0bf7526e
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/button.cxx8
-rw-r--r--vcl/source/control/morebtn.cxx4
-rw-r--r--vcl/source/window/builder.cxx29
-rw-r--r--vcl/source/window/printdlg.cxx6
4 files changed, 30 insertions, 17 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 85c7b3fcee92..82d037892201 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -65,8 +65,8 @@ class ImplCommonButtonData
public:
Rectangle maFocusRect;
long mnSeparatorX;
- sal_uInt16 mnButtonState;
- sal_Bool mbSmallSymbol;
+ sal_uInt16 mnButtonState;
+ bool mbSmallSymbol;
Image maImage;
ImageAlign meImageAlign;
@@ -79,7 +79,7 @@ public:
// -----------------------------------------------------------------------
ImplCommonButtonData::ImplCommonButtonData() : maFocusRect(), mnSeparatorX(0), mnButtonState(0),
-mbSmallSymbol(sal_False), maImage(), meImageAlign(IMAGEALIGN_TOP), meSymbolAlign(SYMBOLALIGN_LEFT)
+mbSmallSymbol(false), maImage(), meImageAlign(IMAGEALIGN_TOP), meSymbolAlign(SYMBOLALIGN_LEFT)
{
}
@@ -580,7 +580,7 @@ void Button::ImplSetSymbolAlign( SymbolAlign eAlign )
}
// -----------------------------------------------------------------------
-void Button::ImplSetSmallSymbol( sal_Bool bSmall )
+void Button::SetSmallSymbol(bool bSmall)
{
mpButtonData->mbSmallSymbol = bSmall;
}
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index edf124a4eb44..6109045f3426 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -53,8 +53,8 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
ShowState();
- SetSymbolAlign( SYMBOLALIGN_RIGHT );
- ImplSetSmallSymbol( sal_True );
+ SetSymbolAlign(SYMBOLALIGN_RIGHT);
+ SetSmallSymbol(true);
if ( ! ( nStyle & ( WB_RIGHT | WB_LEFT ) ) )
{
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index beb0449f9c45..52d57a1c2069 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -228,19 +228,30 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri
continue;
aImagesToBeRemoved.insert(aI->m_sValue);
- VclBuilder::stringmap::iterator aFind = m_pParserState->m_aStockMap.find(aI->m_sValue);
+ VclBuilder::StockMap::iterator aFind = m_pParserState->m_aStockMap.find(aI->m_sValue);
if (aFind == m_pParserState->m_aStockMap.end())
pTarget->SetModeImage(pImage->GetImage());
else
{
- const OString &rImage = aFind->second;
- SymbolType eType = mapStockToSymbol(rImage);
+ const stockinfo &rImageInfo = aFind->second;
+ SymbolType eType = mapStockToSymbol(rImageInfo.m_sStock);
SAL_WARN_IF(eType == SYMBOL_NOSYMBOL, "vcl", "missing stock image element for button");
if (eType == SYMBOL_NOSYMBOL)
continue;
pTarget->SetSymbol(eType);
if (eType == SYMBOL_IMAGE)
- pTarget->SetModeImage(Bitmap(VclResId(mapStockToImageResource(rImage))));
+ pTarget->SetModeImage(Bitmap(VclResId(mapStockToImageResource(rImageInfo.m_sStock))));
+ switch (rImageInfo.m_nSize)
+ {
+ case 1:
+ pTarget->SetSmallSymbol();
+ break;
+ case 4:
+ break;
+ default:
+ SAL_WARN("vcl.layout", "unsupported image size " << rImageInfo.m_nSize);
+ break;
+ }
}
}
@@ -672,8 +683,16 @@ bool VclBuilder::extractStock(const OString &id, stringmap &rMap)
VclBuilder::stringmap::iterator aFind = rMap.find(OString("stock"));
if (aFind != rMap.end())
{
- m_pParserState->m_aStockMap[id] = aFind->second;
+ stockinfo aInfo;
+ aInfo.m_sStock = aFind->second;
rMap.erase(aFind);
+ aFind = rMap.find(OString("icon-size"));
+ if (aFind != rMap.end())
+ {
+ aInfo.m_nSize = aFind->second.toInt32();
+ rMap.erase(aFind);
+ }
+ m_pParserState->m_aStockMap[id] = aInfo;
return true;
}
return false;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 0e63800f9d58..7005257ab35e 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -591,12 +591,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
mpForwardBtn->SetStyle( mpForwardBtn->GetStyle() | WB_BEVELBUTTON );
mpBackwardBtn->SetStyle( mpBackwardBtn->GetStyle() | WB_BEVELBUTTON );
- // set symbols on forward and backward button
- mpBackwardBtn->SetSymbol( SYMBOL_PREV );
- mpForwardBtn->SetSymbol( SYMBOL_NEXT );
- mpBackwardBtn->ImplSetSmallSymbol( sal_True );
- mpForwardBtn->ImplSetSmallSymbol( sal_True );
-
maPageStr = mpNumPagesText->GetText();
// init reverse print