diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-15 20:03:47 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2020-06-17 12:31:49 +0200 |
commit | 34e1eb170e394b464b9686cfbc0a56fb07d85893 (patch) | |
tree | cdc9692eb4ac713872a1cf7996f6c10c9ae296d3 | |
parent | b62d73ccb04da2c4cf7f68a23742d0670ef7eb90 (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>
(cherry picked from commit baa55eca0b653d4f661c08f5b6593caa3b186e89)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96418
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.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 8410e67871a3..dd57672d8b18 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(); } @@ -1066,6 +1070,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") @@ -2384,6 +2400,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)); |