diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-15 20:03:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-16 09:36:05 +0200 |
commit | baa55eca0b653d4f661c08f5b6593caa3b186e89 (patch) | |
tree | 6e2ad07a10d20d6bd5b09fc47729a19a82844d67 | |
parent | 11d21b3c1f7754b5d13ae9ea88da562ec74366ff (diff) |
support gtk-copy and gtk-paste stock ids
Change-Id: I0d9dc30c62bdfb5976c86bc5a08d5f030eb216e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96394
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/uiconfig/ui/spellingdialog.ui | 2 | ||||
-rw-r--r-- | vcl/inc/bitmaps.hlst | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 18 |
3 files changed, 21 insertions, 1 deletions
diff --git a/cui/uiconfig/ui/spellingdialog.ui b/cui/uiconfig/ui/spellingdialog.ui index 6e437a1145b2..7673d262e21c 100644 --- a/cui/uiconfig/ui/spellingdialog.ui +++ b/cui/uiconfig/ui/spellingdialog.ui @@ -272,7 +272,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="spellingdialog|paste">Paste</property> <property name="use_underline">True</property> - <property name="icon_name">cmd/sc_paste.png</property> + <property name="stock_id">gtk-paste</property> </object> <packing> <property name="expand">False</property> diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst index 5ce994a0c384..68f23533eae0 100644 --- a/vcl/inc/bitmaps.hlst +++ b/vcl/inc/bitmaps.hlst @@ -138,6 +138,8 @@ #define IMG_INFO "dbaccess/res/exinfo.png" #define IMG_ADD "extensions/res/scanner/plus.png" #define IMG_REMOVE "extensions/res/scanner/minus.png" +#define IMG_COPY "cmd/sc_copy.png" +#define IMG_PASTE "cmd/sc_paste.png" #define RID_BMP_TREENODE_COLLAPSED "res/plus.png" #define RID_BMP_TREENODE_EXPANDED "res/minus.png" diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index ff1f4ca9fe64..368b771068f3 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -95,6 +95,10 @@ namespace return IMG_ADD; else if (sType == "gtk-remove") return IMG_REMOVE; + else if (sType == "gtk-copy") + return IMG_COPY; + else if (sType == "gtk-paste") + return IMG_PASTE; return OUString(); } @@ -1048,6 +1052,18 @@ namespace return sIconName; } + OUString extractStockId(VclBuilder::stringmap &rMap) + { + OUString sIconName; + VclBuilder::stringmap::iterator aFind = rMap.find(OString("stock-id")); + if (aFind != rMap.end()) + { + sIconName = aFind->second; + rMap.erase(aFind); + } + return sIconName; + } + OUString getStockText(const OUString &rType) { if (rType == "gtk-ok") @@ -2216,6 +2232,8 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & pToolBox->SetQuickHelpText(nItemId, sTooltip); OUString sIconName(extractIconName(rMap)); + if (sIconName.isEmpty()) + sIconName = mapStockToImageResource(extractStockId(rMap)); if (!sIconName.isEmpty()) pToolBox->SetItemImage(nItemId, FixedImage::loadThemeImage(sIconName)); |