diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-20 12:37:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-22 09:13:38 +0100 |
commit | 324e116a2e454526891b674da58d07061406f868 (patch) | |
tree | a71dd7b6bc9ed173becadb27d4bc5a2036a2a28e | |
parent | c578c327ed9b7f71959b9f300ead479224c5c15c (diff) |
add a stock index image to vcl, ala gtk-index
Change-Id: I96cd80f14d557752c19b88bb2c99298d7c3e3e0b
-rw-r--r-- | icon-themes/galaxy/vcl/res/index.png | bin | 0 -> 256 bytes | |||
-rw-r--r-- | icon-themes/hicontrast/vcl/res/index.png | bin | 0 -> 109 bytes | |||
-rw-r--r-- | icon-themes/human/vcl/res/index.png | bin | 0 -> 308 bytes | |||
-rw-r--r-- | icon-themes/industrial/vcl/res/index.png | bin | 0 -> 308 bytes | |||
-rw-r--r-- | icon-themes/oxygen/vcl/res/index.png | bin | 0 -> 308 bytes | |||
-rw-r--r-- | vcl/inc/svids.hrc | 1 | ||||
-rw-r--r-- | vcl/source/src/images.src | 5 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 18 |
8 files changed, 23 insertions, 1 deletions
diff --git a/icon-themes/galaxy/vcl/res/index.png b/icon-themes/galaxy/vcl/res/index.png Binary files differnew file mode 100644 index 000000000000..eee0edfcaa56 --- /dev/null +++ b/icon-themes/galaxy/vcl/res/index.png diff --git a/icon-themes/hicontrast/vcl/res/index.png b/icon-themes/hicontrast/vcl/res/index.png Binary files differnew file mode 100644 index 000000000000..4392542b80b7 --- /dev/null +++ b/icon-themes/hicontrast/vcl/res/index.png diff --git a/icon-themes/human/vcl/res/index.png b/icon-themes/human/vcl/res/index.png Binary files differnew file mode 100644 index 000000000000..d41d81a5e6c9 --- /dev/null +++ b/icon-themes/human/vcl/res/index.png diff --git a/icon-themes/industrial/vcl/res/index.png b/icon-themes/industrial/vcl/res/index.png Binary files differnew file mode 100644 index 000000000000..d41d81a5e6c9 --- /dev/null +++ b/icon-themes/industrial/vcl/res/index.png diff --git a/icon-themes/oxygen/vcl/res/index.png b/icon-themes/oxygen/vcl/res/index.png Binary files differnew file mode 100644 index 000000000000..d41d81a5e6c9 --- /dev/null +++ b/icon-themes/oxygen/vcl/res/index.png diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index e0a64f643cb3..5abe5bd84b51 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -41,6 +41,7 @@ #define SV_RESID_BITMAP_SCROLLMSK 1050 #define SV_RESID_BITMAP_SCROLLBMP 1051 #define SV_RESID_BITMAP_CLOSEDOC 1052 +#define SV_RESID_BITMAP_INDEX 1053 #define SV_DISCLOSURE_PLUS 1060 #define SV_DISCLOSURE_MINUS 1061 diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src index f0b58f4d82d1..061f59c6b676 100644 --- a/vcl/source/src/images.src +++ b/vcl/source/src/images.src @@ -77,6 +77,11 @@ Bitmap SV_RESID_BITMAP_CLOSEDOC File = "closedoc.png"; }; +Bitmap SV_RESID_BITMAP_INDEX +{ + File = "index.png"; +}; + Bitmap SV_RESID_BITMAP_SPLITHPIN { File = "splhpin.png"; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 735bde150d71..20a2b71de725 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -33,6 +33,14 @@ namespace { + sal_uInt16 mapStockToImageResource(OString sType) + { + sal_uInt16 nRet = 0; + if (sType == "gtk-index") + nRet = SV_RESID_BITMAP_INDEX; + return nRet; + } + SymbolType mapStockToSymbol(OString sType) { SymbolType eRet = SYMBOL_NOSYMBOL; @@ -54,6 +62,8 @@ namespace eRet = SYMBOL_HELP; else if (sType == "gtk-close") eRet = SYMBOL_CLOSE; + else if (mapStockToImageResource(sType)) + eRet = SYMBOL_IMAGE; return eRet; } } @@ -168,13 +178,19 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri PushButton *pTarget = get<PushButton>(aI->m_sID); FixedImage *pImage = get<FixedImage>(aI->m_sValue); aImagesToBeRemoved.insert(aI->m_sValue); - SymbolType eType = mapStockToSymbol(m_pParserState->m_aStockMap[aI->m_sValue]); + const OString &rImage = m_pParserState->m_aStockMap[aI->m_sValue]; + SymbolType eType = mapStockToSymbol(rImage); SAL_WARN_IF(!pTarget || !pImage || eType == SYMBOL_NOSYMBOL, "vcl", "missing elements of button/image/stock"); + if (!pTarget || eType == SYMBOL_NOSYMBOL) + continue; + //to-do, situation where image isn't a stock image if (pTarget && eType != SYMBOL_NOSYMBOL) { pTarget->SetSymbol(eType); + if (eType == SYMBOL_IMAGE) + pTarget->SetModeImage(VclResId(mapStockToImageResource(rImage))); } } |