summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-11 19:59:44 +0000
committerSzymon Kłos <szymon.klos@collabora.com>2021-05-25 12:12:25 +0200
commit5fb5090883a7265a6b8939781c9cfee9100b3276 (patch)
treef3fcfafa417015a1af2237049623794eb0ca3855
parentrename SfxChildWindowContext::GetFloatingWindow to what it does (diff)
downloadcore-5fb5090883a7265a6b8939781c9cfee9100b3276.tar.gz
core-5fb5090883a7265a6b8939781c9cfee9100b3276.zip
replace stock button images
Change-Id: I9be83856c0dd15552a042f009464c279bf239848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109199 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rwxr-xr-x.git-hooks/pre-commit8
-rwxr-xr-xbin/ui-converter-skeleton.py196
-rw-r--r--chart2/uiconfig/ui/columnfragment.ui2
-rw-r--r--chart2/uiconfig/ui/dlg_InsertErrorBars.ui12
-rw-r--r--chart2/uiconfig/ui/imagefragment.ui2
-rw-r--r--chart2/uiconfig/ui/tp_DataSource.ui4
-rw-r--r--chart2/uiconfig/ui/tp_ErrorBars.ui6
-rw-r--r--chart2/uiconfig/ui/tp_Trendline.ui12
-rw-r--r--cui/uiconfig/ui/aboutdialog.ui4
-rw-r--r--cui/uiconfig/ui/comment.ui4
-rw-r--r--cui/uiconfig/ui/hyphenate.ui4
-rw-r--r--cui/uiconfig/ui/menuassignpage.ui8
-rw-r--r--cui/uiconfig/ui/movemenu.ui4
-rw-r--r--cui/uiconfig/ui/spellingdialog.ui2
-rw-r--r--cui/uiconfig/ui/textanimtabpage.ui8
-rw-r--r--cui/uiconfig/ui/thesaurus.ui2
-rw-r--r--cui/uiconfig/ui/toolbarmodedialog.ui4
-rw-r--r--fpicker/uiconfig/ui/explorerfiledialog.ui4
-rw-r--r--include/vcl/builder.hxx16
-rw-r--r--reportdesign/uiconfig/dbreport/ui/conditionwin.ui4
-rw-r--r--sc/uiconfig/scalc/ui/conditionaliconset.ui2
-rw-r--r--sc/uiconfig/scalc/ui/sheetprintpage.ui2
-rw-r--r--sd/uiconfig/simpress/ui/customanimationeffecttab.ui2
-rw-r--r--sd/uiconfig/simpress/ui/dockinganimation.ui10
-rw-r--r--sfx2/uiconfig/ui/decktitlebar.ui2
-rw-r--r--sfx2/uiconfig/ui/documentinfopage.ui2
-rw-r--r--sfx2/uiconfig/ui/infobar.ui2
-rw-r--r--svtools/uiconfig/ui/fixedimagecontrol.ui2
-rw-r--r--svtools/uiconfig/ui/placeedit.ui2
-rw-r--r--svtools/uiconfig/ui/tabbuttons.ui139
-rw-r--r--svtools/uiconfig/ui/tabbuttonsmirrored.ui139
-rw-r--r--svx/uiconfig/ui/grafctrlbox.ui2
-rw-r--r--svx/uiconfig/ui/navigationbar.ui10
-rw-r--r--sw/uiconfig/swriter/ui/addressblockdialog.ui12
-rw-r--r--sw/uiconfig/swriter/ui/cardmediumpage.ui2
-rw-r--r--sw/uiconfig/swriter/ui/columnpage.ui4
-rw-r--r--sw/uiconfig/swriter/ui/customizeaddrlistdialog.ui4
-rw-r--r--sw/uiconfig/swriter/ui/editfielddialog.ui4
-rw-r--r--sw/uiconfig/swriter/ui/envaddresspage.ui2
-rw-r--r--sw/uiconfig/swriter/ui/indexentry.ui12
-rw-r--r--sw/uiconfig/swriter/ui/insertfootnote.ui4
-rw-r--r--sw/uiconfig/swriter/ui/insertscript.ui4
-rw-r--r--sw/uiconfig/swriter/ui/mmaddressblockpage.ui4
-rw-r--r--sw/uiconfig/swriter/ui/mmsalutationpage.ui4
-rw-r--r--sw/uiconfig/swriter/ui/outlinebutton.ui59
-rw-r--r--sw/uiconfig/swriter/ui/tablecolumnpage.ui4
-rw-r--r--sw/uiconfig/swriter/ui/testmailsettings.ui8
-rw-r--r--sw/uiconfig/swriter/ui/tokenwidget.ui4
-rw-r--r--vcl/inc/bitmaps.hlst2
-rw-r--r--vcl/source/window/builder.cxx230
-rw-r--r--vcl/uiconfig/ui/aboutbox.ui2
-rw-r--r--vcl/uiconfig/ui/printdialog.ui10
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx10
53 files changed, 746 insertions, 261 deletions
diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
index fd0cfeea2e62..bc9b723d039d 100755
--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -101,6 +101,14 @@ sub check_whitespaces($)
{
bad_line("use tooltip_text instead of tooltip_markup", $_, "ui");
}
+ if (/<property name="stock[-_]id"/ )
+ {
+ bad_line("use an icon-name listed at https://developer.gnome.org/gtk3/stable/gtk3-Stock-Items.html", $_, "ui");
+ }
+ if (/<property name="stock"/ )
+ {
+ bad_line("use an icon-name listed at https://developer.gnome.org/gtk3/stable/gtk3-Stock-Items.html", $_, "ui");
+ }
if ((/translatable="yes"/) and not(/context=/))
{
bad_line("translatable .ui file line without context", $_, "ui");
diff --git a/bin/ui-converter-skeleton.py b/bin/ui-converter-skeleton.py
new file mode 100755
index 000000000000..c9d6cc0daa1a
--- /dev/null
+++ b/bin/ui-converter-skeleton.py
@@ -0,0 +1,196 @@
+#!/bin/python
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# this should parse a .ui and overwrite it with the same content
+# for a in `git ls-files "*.ui"`; do bin/ui-converter-skeleton.py $a; done
+
+import lxml.etree as etree
+import sys
+
+def add_truncate_multiline(current):
+ use_truncate_multiline = False
+ istarget = current.get('class') == "GtkEntry" or current.get('class') == "GtkSpinButton"
+ insertpos = 0
+ for child in current:
+ add_truncate_multiline(child)
+ insertpos = insertpos + 1;
+ if not istarget:
+ continue
+ if child.tag == "property":
+ attributes = child.attrib
+ if attributes.get("name") == "truncate_multiline" or attributes.get("name") == "truncate-multiline":
+ use_truncate_multiline = True
+
+ if istarget and not use_truncate_multiline:
+ truncate_multiline = etree.Element("property")
+ attributes = truncate_multiline.attrib
+ attributes["name"] = "truncate-multiline"
+ truncate_multiline.text = "True"
+ current.insert(insertpos - 1, truncate_multiline)
+
+def do_replace_button_use_stock(current, use_stock, use_underline, label, insertpos):
+ if not use_underline:
+ underline = etree.Element("property")
+ attributes = underline.attrib
+ attributes["name"] = "use-underline"
+ underline.text = "True"
+ current.insert(insertpos - 1, underline)
+ current.remove(use_stock)
+ attributes = label.attrib
+ attributes["translatable"] = "yes"
+ attributes["context"] = "stock"
+ if label.text == 'gtk-add':
+ label.text = "_Add"
+ elif label.text == 'gtk-apply':
+ label.text = "_Apply"
+ elif label.text == 'gtk-cancel':
+ label.text = "_Cancel"
+ elif label.text == 'gtk-close':
+ label.text = "_Close"
+ elif label.text == 'gtk-delete':
+ label.text = "_Delete"
+ elif label.text == 'gtk-edit':
+ label.text = "_Edit"
+ elif label.text == 'gtk-help':
+ label.text = "_Help"
+ elif label.text == 'gtk-new':
+ label.text = "_New"
+ elif label.text == 'gtk-no':
+ label.text = "_No"
+ elif label.text == 'gtk-ok':
+ label.text = "_OK"
+ elif label.text == 'gtk-remove':
+ label.text = "_Remove"
+ elif label.text == 'gtk-revert-to-saved':
+ label.text = "_Reset"
+ elif label.text == 'gtk-yes':
+ label.text = "_yes"
+ else:
+ raise("unknown label")
+
+def replace_button_use_stock(current):
+ use_underline = False
+ use_stock = None
+ label = None
+ isbutton = current.get('class') == "GtkButton"
+ insertpos = 0
+ for child in current:
+ replace_button_use_stock(child)
+ insertpos = insertpos + 1;
+ if not isbutton:
+ continue
+ if child.tag == "property":
+ attributes = child.attrib
+ if attributes.get("name") == "use_underline" or attributes.get("name") == "use-underline":
+ use_underline = True
+ if attributes.get("name") == "use_stock" or attributes.get("name") == "use-stock":
+ use_stock = child
+ if attributes.get("name") == "label":
+ label = child
+
+ if isbutton and use_stock != None:
+ do_replace_button_use_stock(current, use_stock, use_underline, label, insertpos)
+
+def do_replace_image_stock(current, stock):
+ attributes = stock.attrib
+ attributes["name"] = "icon-name"
+ if stock.text == 'gtk-add':
+ stock.text = "list-add"
+ elif stock.text == 'gtk-remove':
+ stock.text = "list-remove"
+ elif stock.text == 'gtk-paste':
+ stock.text = "edit-paste"
+ elif stock.text == 'gtk-index':
+ stock.text = "vcl/res/index.png"
+ elif stock.text == 'gtk-refresh':
+ stock.text = "view-refresh"
+ elif stock.text == 'gtk-dialog-error':
+ stock.text = "dialog-error"
+ elif stock.text == 'gtk-apply':
+ stock.text = "sw/res/sc20558.png"
+ elif stock.text == 'gtk-missing-image':
+ stock.text = "missing-image"
+ elif stock.text == 'gtk-copy':
+ stock.text = "edit-copy"
+ elif stock.text == 'gtk-go-back':
+ stock.text = "go-previous"
+ elif stock.text == 'gtk-go-forward':
+ stock.text = "go-next"
+ elif stock.text == 'gtk-go-down':
+ stock.text = "go-down"
+ elif stock.text == 'gtk-go-up':
+ stock.text = "go-up"
+ elif stock.text == 'gtk-goto-first':
+ stock.text = "go-first"
+ elif stock.text == 'gtk-goto-last':
+ stock.text = "go-last"
+ elif stock.text == 'gtk-new':
+ stock.text = "document-new"
+ elif stock.text == 'gtk-media-stop':
+ stock.text = "media-playback-stop"
+ elif stock.text == 'gtk-media-play':
+ stock.text = "media-playback-start"
+ elif stock.text == 'gtk-media-next':
+ stock.text = "media-skip-forward"
+ elif stock.text == 'gtk-media-previous':
+ stock.text = "media-skip-backward"
+ elif stock.text == 'gtk-close':
+ stock.text = "window-close"
+ elif stock.text == 'gtk-help':
+ stock.text = "help-browser"
+ else:
+ raise("unknown stock name")
+
+def replace_image_stock(current):
+ stock = None
+ isimage = current.get('class') == "GtkImage"
+ for child in current:
+ replace_image_stock(child)
+ if not isimage:
+ continue
+ if child.tag == "property":
+ attributes = child.attrib
+ if attributes.get("name") == "stock":
+ stock = child
+
+ if isimage and stock != None:
+ do_replace_image_stock(current, stock)
+
+with open(sys.argv[1], encoding="utf-8") as f:
+ header = f.readline()
+ firstline = f.readline()
+ # the comment after the xml declaration goes missing unless we provide a
+ # custom doctype with tostring that contains the comment as a line after
+ # the true doctype
+ if firstline.startswith("<!--"):
+ header = header + firstline
+ f.seek(0)
+ # remove_blank_text so pretty-printed input doesn't disrupt pretty-printed
+ # output if nodes are added or removed
+ parser = etree.XMLParser(remove_blank_text=True)
+ tree = etree.parse(f, parser)
+ # make sure <property name="label" translatable="no"></property> stays like that
+ # and doesn't change to <property name="label" translatable="no"/>
+ for status_elem in tree.xpath("//property[@name='label' and string() = '']"):
+ status_elem.text = ""
+ root = tree.getroot()
+
+# do some targeted conversion here
+# tdf#138848 Copy-and-Paste in input box should not append an ENTER character
+if not sys.argv[1].endswith('/multiline.ui'): # let this one alone not truncate multiline pastes
+ add_truncate_multiline(root)
+replace_button_use_stock(root)
+replace_image_stock(root)
+
+with open(sys.argv[1], 'wb') as o:
+ # without encoding='unicode' (and the matching encode("utf8")) we get &#XXXX replacements for non-ascii characters
+ # which we don't want to see changed in the output
+ o.write(etree.tostring(root, pretty_print=True, method='xml', encoding='unicode', doctype=header[0:-1]).encode("utf8"))
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/chart2/uiconfig/ui/columnfragment.ui b/chart2/uiconfig/ui/columnfragment.ui
index f020427d2924..4f6be9d81def 100644
--- a/chart2/uiconfig/ui/columnfragment.ui
+++ b/chart2/uiconfig/ui/columnfragment.ui
@@ -9,7 +9,7 @@
<object class="GtkImage" id="image">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/chart2/uiconfig/ui/dlg_InsertErrorBars.ui b/chart2/uiconfig/ui/dlg_InsertErrorBars.ui
index d7e1abbaea67..da680c43cf87 100644
--- a/chart2/uiconfig/ui/dlg_InsertErrorBars.ui
+++ b/chart2/uiconfig/ui/dlg_InsertErrorBars.ui
@@ -47,7 +47,7 @@
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="use_stock">True</property>
+ <property name="use_icon-name">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -61,7 +61,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_stock">True</property>
+ <property name="use_icon-name">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -75,7 +75,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_stock">True</property>
+ <property name="use_icon-name">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -371,7 +371,7 @@
<object class="GtkImage" id="FI_BOTH">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -382,7 +382,7 @@
<object class="GtkImage" id="FI_POSITIVE">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -393,7 +393,7 @@
<object class="GtkImage" id="FI_NEGATIVE">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/chart2/uiconfig/ui/imagefragment.ui b/chart2/uiconfig/ui/imagefragment.ui
index 97cd5985eb86..ab83099fdcf4 100644
--- a/chart2/uiconfig/ui/imagefragment.ui
+++ b/chart2/uiconfig/ui/imagefragment.ui
@@ -10,7 +10,7 @@
<object class="GtkImage" id="image">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">True</property>
diff --git a/chart2/uiconfig/ui/tp_DataSource.ui b/chart2/uiconfig/ui/tp_DataSource.ui
index 1e2843127df4..635314c07e95 100644
--- a/chart2/uiconfig/ui/tp_DataSource.ui
+++ b/chart2/uiconfig/ui/tp_DataSource.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkImage" id="imageIMB_RANGE_CAT">
<property name="visible">True</property>
diff --git a/chart2/uiconfig/ui/tp_ErrorBars.ui b/chart2/uiconfig/ui/tp_ErrorBars.ui
index 8ec2f4cc4da1..b4015eb3659c 100644
--- a/chart2/uiconfig/ui/tp_ErrorBars.ui
+++ b/chart2/uiconfig/ui/tp_ErrorBars.ui
@@ -311,7 +311,7 @@
<object class="GtkImage" id="FI_BOTH">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -322,7 +322,7 @@
<object class="GtkImage" id="FI_POSITIVE">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -333,7 +333,7 @@
<object class="GtkImage" id="FI_NEGATIVE">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/chart2/uiconfig/ui/tp_Trendline.ui b/chart2/uiconfig/ui/tp_Trendline.ui
index 9f1ac16775b2..7e5b97d8f457 100644
--- a/chart2/uiconfig/ui/tp_Trendline.ui
+++ b/chart2/uiconfig/ui/tp_Trendline.ui
@@ -292,7 +292,7 @@
<object class="GtkImage" id="imageLinear">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -303,7 +303,7 @@
<object class="GtkImage" id="imageLogarithmic">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -314,7 +314,7 @@
<object class="GtkImage" id="imageExponential">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -325,7 +325,7 @@
<object class="GtkImage" id="imagePower">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -336,7 +336,7 @@
<object class="GtkImage" id="imagePolynomial">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -347,7 +347,7 @@
<object class="GtkImage" id="imageMovingAverage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">2</property>
diff --git a/cui/uiconfig/ui/aboutdialog.ui b/cui/uiconfig/ui/aboutdialog.ui
index 219ad8020ab9..3a5a1836352c 100644
--- a/cui/uiconfig/ui/aboutdialog.ui
+++ b/cui/uiconfig/ui/aboutdialog.ui
@@ -4,8 +4,8 @@
<requires lib="gtk+" version="3.20"/>
<object class="GtkImage" id="imCopy">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-copy</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">edit-copy</property>
</object>
<object class="GtkDialog" id="AboutDialog">
<property name="can_focus">False</property>
diff --git a/cui/uiconfig/ui/comment.ui b/cui/uiconfig/ui/comment.ui
index c507ff68f919..a661db58071d 100644
--- a/cui/uiconfig/ui/comment.ui
+++ b/cui/uiconfig/ui/comment.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkDialog" id="CommentDialog">
<property name="can_focus">False</property>
diff --git a/cui/uiconfig/ui/hyphenate.ui b/cui/uiconfig/ui/hyphenate.ui
index fea574f9472e..538a0b6f5e04 100644
--- a/cui/uiconfig/ui/hyphenate.ui
+++ b/cui/uiconfig/ui/hyphenate.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkDialog" id="HyphenateDialog">
<property name="can_focus">False</property>
diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui
index 4d24ca2e5899..fed6b6225d75 100644
--- a/cui/uiconfig/ui/menuassignpage.ui
+++ b/cui/uiconfig/ui/menuassignpage.ui
@@ -5,23 +5,23 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="image7">
diff --git a/cui/uiconfig/ui/movemenu.ui b/cui/uiconfig/ui/movemenu.ui
index c01b114436aa..9316a1bb2e5c 100644
--- a/cui/uiconfig/ui/movemenu.ui
+++ b/cui/uiconfig/ui/movemenu.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkTreeStore" id="liststore1">
<columns>
diff --git a/cui/uiconfig/ui/spellingdialog.ui b/cui/uiconfig/ui/spellingdialog.ui
index 83a838eb0d6e..72fcc80a35ff 100644
--- a/cui/uiconfig/ui/spellingdialog.ui
+++ b/cui/uiconfig/ui/spellingdialog.ui
@@ -296,7 +296,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="stock_id">gtk-paste</property>
+ <property name="icon-name">edit-paste</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/cui/uiconfig/ui/textanimtabpage.ui b/cui/uiconfig/ui/textanimtabpage.ui
index 37a4c30150ab..2dd4b524e696 100644
--- a/cui/uiconfig/ui/textanimtabpage.ui
+++ b/cui/uiconfig/ui/textanimtabpage.ui
@@ -20,22 +20,22 @@
<object class="GtkImage" id="imageDOWN">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkImage" id="imageLEFT">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="imageRIGHT">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkImage" id="imageUP">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkBox" id="TextAnimation">
<property name="visible">True</property>
diff --git a/cui/uiconfig/ui/thesaurus.ui b/cui/uiconfig/ui/thesaurus.ui
index 611a16b35ea3..91603c38485b 100644
--- a/cui/uiconfig/ui/thesaurus.ui
+++ b/cui/uiconfig/ui/thesaurus.ui
@@ -5,7 +5,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkTreeStore" id="liststore3">
<columns>
diff --git a/cui/uiconfig/ui/toolbarmodedialog.ui b/cui/uiconfig/ui/toolbarmodedialog.ui
index 43496294fde9..84f0d84aa071 100644
--- a/cui/uiconfig/ui/toolbarmodedialog.ui
+++ b/cui/uiconfig/ui/toolbarmodedialog.ui
@@ -5,7 +5,7 @@
<object class="GtkImage" id="imgApply">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="stock">gtk-apply</property>
+ <property name="icon-name">sw/res/sc20558.png</property>
</object>
<object class="GtkDialog" id="ToolbarmodeDialog">
<property name="can-focus">False</property>
@@ -317,7 +317,7 @@
<property name="halign">center</property>
<property name="valign">start</property>
<property name="vexpand">True</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/fpicker/uiconfig/ui/explorerfiledialog.ui b/fpicker/uiconfig/ui/explorerfiledialog.ui
index dc8e7ea08f97..c9effe4e636d 100644
--- a/fpicker/uiconfig/ui/explorerfiledialog.ui
+++ b/fpicker/uiconfig/ui/explorerfiledialog.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-add</property>
+ <property name="icon-name">list-add</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-remove</property>
+ <property name="icon-name">list-remove</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 6e9c9505fde9..2054ef5c3105 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -109,6 +109,8 @@ public:
/// Pre-loads all modules containing UI information
static void preload();
+ static SymbolType mapStockToSymbol(std::u16string_view icon_name);
+
private:
VclBuilder(const VclBuilder&) = delete;
VclBuilder& operator=(const VclBuilder&) = delete;
@@ -237,14 +239,7 @@ private:
static void mungeAdjustment(ScrollBar &rTarget, const Adjustment &rAdjustment);
static void mungeAdjustment(Slider &rTarget, const Adjustment &rAdjustment);
- struct stockinfo
- {
- OUString m_sStock;
- int m_nSize;
- stockinfo() : m_nSize(4) {}
- };
-
- typedef std::map<OString, stockinfo> StockMap;
+ typedef std::map<OString, int> ImageSizeMap;
struct SizeGroup
{
@@ -274,7 +269,7 @@ private:
std::map<OString, Adjustment> m_aAdjustments;
std::vector<ButtonImageWidgetMap> m_aButtonImageWidgetMaps;
- StockMap m_aStockMap;
+ ImageSizeMap m_aImageSizeMap;
std::vector<ButtonMenuMap> m_aButtonMenuMaps;
@@ -338,12 +333,13 @@ private:
void connectNumericFormatterAdjustment(const OString &id, const OUString &rAdjustment);
void connectFormattedFormatterAdjustment(const OString &id, const OUString &rAdjustment);
+ static int getImageSize(const stringmap &rMap);
+
void extractGroup(const OString &id, stringmap &rVec);
void extractModel(const OString &id, stringmap &rVec);
void extractBuffer(const OString &id, stringmap &rVec);
static bool extractAdjustmentToMap(const OString &id, stringmap &rVec, std::vector<WidgetAdjustmentMap>& rAdjustmentMap);
void extractButtonImage(const OString &id, stringmap &rMap, bool bRadio);
- void extractStock(const OString &id, stringmap &rMap);
void extractMnemonicWidget(const OString &id, stringmap &rMap);
// either pParent or pAtkProps must be set, pParent for a child of a widget, pAtkProps for
diff --git a/reportdesign/uiconfig/dbreport/ui/conditionwin.ui b/reportdesign/uiconfig/dbreport/ui/conditionwin.ui
index 33490b108ca9..6ad60616f028 100644
--- a/reportdesign/uiconfig/dbreport/ui/conditionwin.ui
+++ b/reportdesign/uiconfig/dbreport/ui/conditionwin.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkBox" id="ConditionWin">
<property name="visible">True</property>
diff --git a/sc/uiconfig/scalc/ui/conditionaliconset.ui b/sc/uiconfig/scalc/ui/conditionaliconset.ui
index 861ddb3304c9..bf129a2c914c 100644
--- a/sc/uiconfig/scalc/ui/conditionaliconset.ui
+++ b/sc/uiconfig/scalc/ui/conditionaliconset.ui
@@ -60,7 +60,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/sc/uiconfig/scalc/ui/sheetprintpage.ui b/sc/uiconfig/scalc/ui/sheetprintpage.ui
index 22086ed9d804..ae3aa741a510 100644
--- a/sc/uiconfig/scalc/ui/sheetprintpage.ui
+++ b/sc/uiconfig/scalc/ui/sheetprintpage.ui
@@ -184,7 +184,7 @@
<property name="valign">center</property>
<property name="xpad">6</property>
<property name="ypad">6</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sd/uiconfig/simpress/ui/customanimationeffecttab.ui b/sd/uiconfig/simpress/ui/customanimationeffecttab.ui
index 180d67aab353..892e33033758 100644
--- a/sd/uiconfig/simpress/ui/customanimationeffecttab.ui
+++ b/sd/uiconfig/simpress/ui/customanimationeffecttab.ui
@@ -10,7 +10,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-play</property>
+ <property name="icon-name">media-playback-start</property>
</object>
<object class="GtkBox" id="EffectTab">
<property name="visible">True</property>
diff --git a/sd/uiconfig/simpress/ui/dockinganimation.ui b/sd/uiconfig/simpress/ui/dockinganimation.ui
index 8ddc69cf0ec9..4a747931dd1a 100644
--- a/sd/uiconfig/simpress/ui/dockinganimation.ui
+++ b/sd/uiconfig/simpress/ui/dockinganimation.ui
@@ -37,27 +37,27 @@
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-first</property>
+ <property name="icon-name">go-first</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-previous</property>
+ <property name="icon-name">media-skip-backward</property>
</object>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-stop</property>
+ <property name="icon-name">media-playback-stop</property>
</object>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-next</property>
+ <property name="icon-name">media-skip-forward</property>
</object>
<object class="GtkImage" id="image9">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-last</property>
+ <property name="icon-name">go-last</property>
</object>
<object class="GtkBox" id="DockingAnimation">
<property name="visible">True</property>
diff --git a/sfx2/uiconfig/ui/decktitlebar.ui b/sfx2/uiconfig/ui/decktitlebar.ui
index 9349956950b7..f7a706aae306 100644
--- a/sfx2/uiconfig/ui/decktitlebar.ui
+++ b/sfx2/uiconfig/ui/decktitlebar.ui
@@ -25,7 +25,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sfx2/uiconfig/ui/documentinfopage.ui b/sfx2/uiconfig/ui/documentinfopage.ui
index 8ff9e4967be3..860b6e1c3348 100644
--- a/sfx2/uiconfig/ui/documentinfopage.ui
+++ b/sfx2/uiconfig/ui/documentinfopage.ui
@@ -387,7 +387,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/sfx2/uiconfig/ui/infobar.ui b/sfx2/uiconfig/ui/infobar.ui
index 50b1a7cc1d1d..3a9cc49a7f23 100644
--- a/sfx2/uiconfig/ui/infobar.ui
+++ b/sfx2/uiconfig/ui/infobar.ui
@@ -98,7 +98,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/svtools/uiconfig/ui/fixedimagecontrol.ui b/svtools/uiconfig/ui/fixedimagecontrol.ui
index 162ba17f63e3..1b462fa23d64 100644
--- a/svtools/uiconfig/ui/fixedimagecontrol.ui
+++ b/svtools/uiconfig/ui/fixedimagecontrol.ui
@@ -12,7 +12,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">True</property>
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 00940fadd111..0865f7273de3 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -10,7 +10,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-refresh</property>
+ <property name="icon-name">view-refresh</property>
</object>
<object class="GtkDialog" id="PlaceEditDialog">
<property name="can_focus">False</property>
diff --git a/svtools/uiconfig/ui/tabbuttons.ui b/svtools/uiconfig/ui/tabbuttons.ui
new file mode 100644
index 000000000000..82c5727c285a
--- /dev/null
+++ b/svtools/uiconfig/ui/tabbuttons.ui
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.1 -->
+<interface domain="svt">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">document-new</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">media-skip-backward</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">media-skip-forward</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">go-first</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">go-last</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkBox" id="TabButtons">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkButton" id="first">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image4</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="prev">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image2</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="next">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image3</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="last">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image5</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="add">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="margin-start">6</property>
+ <property name="image">image1</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/svtools/uiconfig/ui/tabbuttonsmirrored.ui b/svtools/uiconfig/ui/tabbuttonsmirrored.ui
new file mode 100644
index 000000000000..926887af1c15
--- /dev/null
+++ b/svtools/uiconfig/ui/tabbuttonsmirrored.ui
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.1 -->
+<interface domain="svt">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">document-new</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">media-skip-backward</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">media-skip-forward</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">go-first</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">go-last</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkBox" id="TabButtons">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkButton" id="add">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="margin-end">6</property>
+ <property name="image">image1</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="last">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image4</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="next">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image2</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="prev">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image3</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="first">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image5</property>
+ <property name="relief">none</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/svx/uiconfig/ui/grafctrlbox.ui b/svx/uiconfig/ui/grafctrlbox.ui
index eec2fbbab284..c33e83cb2b9c 100644
--- a/svx/uiconfig/ui/grafctrlbox.ui
+++ b/svx/uiconfig/ui/grafctrlbox.ui
@@ -18,7 +18,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/svx/uiconfig/ui/navigationbar.ui b/svx/uiconfig/ui/navigationbar.ui
index e5b773246b74..e729327e874c 100644
--- a/svx/uiconfig/ui/navigationbar.ui
+++ b/svx/uiconfig/ui/navigationbar.ui
@@ -5,31 +5,31 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-first</property>
+ <property name="icon-name">go-first</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-previous</property>
+ <property name="icon-name">media-skip-backward</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-next</property>
+ <property name="icon-name">media-skip-forward</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-last</property>
+ <property name="icon-name">go-last</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-new</property>
+ <property name="icon-name">document-new</property>
<property name="icon_size">1</property>
</object>
<object class="GtkBox" id="NavigationBar">
diff --git a/sw/uiconfig/swriter/ui/addressblockdialog.ui b/sw/uiconfig/swriter/ui/addressblockdialog.ui
index d6748dceeb0f..0d9daa26d621 100644
--- a/sw/uiconfig/swriter/ui/addressblockdialog.ui
+++ b/sw/uiconfig/swriter/ui/addressblockdialog.ui
@@ -5,33 +5,33 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="addressblockdialog|image5|tooltip_text">Add to address</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkTreeStore" id="liststore1">
<columns>
diff --git a/sw/uiconfig/swriter/ui/cardmediumpage.ui b/sw/uiconfig/swriter/ui/cardmediumpage.ui
index 14f79fdf7978..0806e6000e7e 100644
--- a/sw/uiconfig/swriter/ui/cardmediumpage.ui
+++ b/sw/uiconfig/swriter/ui/cardmediumpage.ui
@@ -12,7 +12,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkBox" id="CardMediumPage">
<property name="visible">True</property>
diff --git a/sw/uiconfig/swriter/ui/columnpage.ui b/sw/uiconfig/swriter/ui/columnpage.ui
index 6c4a7a19c095..9e7eeb842492 100644
--- a/sw/uiconfig/swriter/ui/columnpage.ui
+++ b/sw/uiconfig/swriter/ui/columnpage.ui
@@ -54,13 +54,13 @@
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
<property name="icon_size">1</property>
</object>
<!-- n-columns=1 n-rows=1 -->
diff --git a/sw/uiconfig/swriter/ui/customizeaddrlistdialog.ui b/sw/uiconfig/swriter/ui/customizeaddrlistdialog.ui
index 0e124c5f88e0..2f88ca4aeeb6 100644
--- a/sw/uiconfig/swriter/ui/customizeaddrlistdialog.ui
+++ b/sw/uiconfig/swriter/ui/customizeaddrlistdialog.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-up</property>
+ <property name="icon-name">go-up</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-down</property>
+ <property name="icon-name">go-down</property>
</object>
<object class="GtkTreeStore" id="liststore2">
<columns>
diff --git a/sw/uiconfig/swriter/ui/editfielddialog.ui b/sw/uiconfig/swriter/ui/editfielddialog.ui
index d83f3d8ac313..6f8e6173c854 100644
--- a/sw/uiconfig/swriter/ui/editfielddialog.ui
+++ b/sw/uiconfig/swriter/ui/editfielddialog.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-previous</property>
+ <property name="icon-name">media-skip-backward</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-media-next</property>
+ <property name="icon-name">media-skip-forward</property>
</object>
<object class="GtkDialog" id="EditFieldDialog">
<property name="can_focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/envaddresspage.ui b/sw/uiconfig/swriter/ui/envaddresspage.ui
index da21f38f904a..2eeb573896fc 100644
--- a/sw/uiconfig/swriter/ui/envaddresspage.ui
+++ b/sw/uiconfig/swriter/ui/envaddresspage.ui
@@ -5,7 +5,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkBox" id="EnvAddressPage">
<property name="visible">True</property>
diff --git a/sw/uiconfig/swriter/ui/indexentry.ui b/sw/uiconfig/swriter/ui/indexentry.ui
index 4f74da2bfab7..6d9d40ec24fa 100644
--- a/sw/uiconfig/swriter/ui/indexentry.ui
+++ b/sw/uiconfig/swriter/ui/indexentry.ui
@@ -13,32 +13,32 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="stock">gtk-index</property>
+ <property name="icon-name">vcl/res/index.png</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-first</property>
+ <property name="icon-name">go-first</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-last</property>
+ <property name="icon-name">go-last</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-refresh</property>
+ <property name="icon-name">view-refresh</property>
</object>
<object class="GtkDialog" id="IndexEntryDialog">
<property name="can_focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/insertfootnote.ui b/sw/uiconfig/swriter/ui/insertfootnote.ui
index 657c846e264c..4d7990bed1ad 100644
--- a/sw/uiconfig/swriter/ui/insertfootnote.ui
+++ b/sw/uiconfig/swriter/ui/insertfootnote.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkDialog" id="InsertFootnoteDialog">
<property name="can_focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/insertscript.ui b/sw/uiconfig/swriter/ui/insertscript.ui
index 433687ccee55..41be6617a689 100644
--- a/sw/uiconfig/swriter/ui/insertscript.ui
+++ b/sw/uiconfig/swriter/ui/insertscript.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkDialog" id="InsertScriptDialog">
<property name="can_focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/mmaddressblockpage.ui b/sw/uiconfig/swriter/ui/mmaddressblockpage.ui
index 2ab4c9bcf9af..9349651fec1f 100644
--- a/sw/uiconfig/swriter/ui/mmaddressblockpage.ui
+++ b/sw/uiconfig/swriter/ui/mmaddressblockpage.ui
@@ -5,13 +5,13 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
<property name="icon_size">1</property>
</object>
<object class="GtkBox" id="MMAddressBlockPage">
diff --git a/sw/uiconfig/swriter/ui/mmsalutationpage.ui b/sw/uiconfig/swriter/ui/mmsalutationpage.ui
index 5fc42f51b385..97249e5b4dc7 100644
--- a/sw/uiconfig/swriter/ui/mmsalutationpage.ui
+++ b/sw/uiconfig/swriter/ui/mmsalutationpage.ui
@@ -5,13 +5,13 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
<property name="icon_size">1</property>
</object>
<object class="GtkBox" id="MMSalutationPage">
diff --git a/sw/uiconfig/swriter/ui/outlinebutton.ui b/sw/uiconfig/swriter/ui/outlinebutton.ui
new file mode 100644
index 000000000000..a0c2b9e5db82
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/outlinebutton.ui
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.1 -->
+<interface domain="sw">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">go-next</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">go-down</property>
+ <property name="icon_size">1</property>
+ </object>
+ <object class="GtkBox" id="OutlineButton">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkButton" id="right">
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="image">image3</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="down">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="image">image5</property>
+ <property name="always-show-image">True</property>
+ <style>
+ <class name="small-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sw/uiconfig/swriter/ui/tablecolumnpage.ui b/sw/uiconfig/swriter/ui/tablecolumnpage.ui
index d69e9faaf188..9b54d63b01bd 100644
--- a/sw/uiconfig/swriter/ui/tablecolumnpage.ui
+++ b/sw/uiconfig/swriter/ui/tablecolumnpage.ui
@@ -46,13 +46,13 @@
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
<property name="icon_size">1</property>
</object>
<!-- n-columns=1 n-rows=1 -->
diff --git a/sw/uiconfig/swriter/ui/testmailsettings.ui b/sw/uiconfig/swriter/ui/testmailsettings.ui
index f8ab0e14c8f9..a10206d87745 100644
--- a/sw/uiconfig/swriter/ui/testmailsettings.ui
+++ b/sw/uiconfig/swriter/ui/testmailsettings.ui
@@ -156,7 +156,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-dialog-error</property>
+ <property name="icon-name">dialog-error</property>
</object>
<packing>
<property name="expand">False</property>
@@ -168,7 +168,7 @@
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-apply</property>
+ <property name="icon-name">sw/res/sc20558.png</property>
</object>
<packing>
<property name="expand">False</property>
@@ -190,7 +190,7 @@
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-dialog-error</property>
+ <property name="icon-name">dialog-error</property>
</object>
<packing>
<property name="expand">False</property>
@@ -202,7 +202,7 @@
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-apply</property>
+ <property name="icon-name">sw/res/sc20558.png</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sw/uiconfig/swriter/ui/tokenwidget.ui b/sw/uiconfig/swriter/ui/tokenwidget.ui
index ed5f5a40ce67..df1cc5cf1ff5 100644
--- a/sw/uiconfig/swriter/ui/tokenwidget.ui
+++ b/sw/uiconfig/swriter/ui/tokenwidget.ui
@@ -5,12 +5,12 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkBox" id="TokenWidget">
<property name="visible">True</property>
diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst
index 68f23533eae0..73e05c724ca2 100644
--- a/vcl/inc/bitmaps.hlst
+++ b/vcl/inc/bitmaps.hlst
@@ -54,7 +54,6 @@
#define SV_RESID_BITMAP_SCROLLV "vcl/res/scrollv.png"
#define SV_RESID_BITMAP_SCROLLH "vcl/res/scrollh.png"
#define SV_RESID_BITMAP_CLOSEDOC "vcl/res/closedoc.png"
-#define SV_RESID_BITMAP_INDEX "vcl/res/index.png"
#define SV_RESID_BITMAP_REFRESH "res/reload.png"
#define SV_RESID_BITMAP_NOTEBOOKBAR "res/notebookbar.png"
@@ -132,7 +131,6 @@
#define SPINNER_64_12 "vcl/res/spinner-64-12.png"
//end, Throbber::getDefaultImageURLs
-#define IMG_APPLY "sw/res/sc20558.png"
#define IMG_WARN "dbaccess/res/exwarning.png"
#define IMG_ERROR "dbaccess/res/exerror.png"
#define IMG_INFO "dbaccess/res/exinfo.png"
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index de4bd29e997c..93724a6e6023 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -87,67 +87,68 @@ namespace
{
OUString mapStockToImageResource(const OUString& sType)
{
- if (sType == "gtk-index")
- return SV_RESID_BITMAP_INDEX;
- else if (sType == "gtk-refresh")
+ if (sType == u"view-refresh")
return SV_RESID_BITMAP_REFRESH;
- else if (sType == "gtk-apply")
- return IMG_APPLY;
- else if (sType == "gtk-dialog-error")
+ else if (sType == u"dialog-error")
return IMG_ERROR;
- else if (sType == "gtk-add")
+ else if (sType == u"list-add")
return IMG_ADD;
- else if (sType == "gtk-remove")
+ else if (sType == u"list-remove")
return IMG_REMOVE;
- else if (sType == "gtk-copy")
+ else if (sType == u"edit-copy")
return IMG_COPY;
- else if (sType == "gtk-paste")
+ else if (sType == u"edit-paste")
return IMG_PASTE;
return OUString();
}
- SymbolType mapStockToSymbol(const OUString& sType)
- {
- SymbolType eRet = SymbolType::DONTKNOW;
- if (sType == "gtk-media-next")
- eRet = SymbolType::NEXT;
- else if (sType == "gtk-media-previous")
- eRet = SymbolType::PREV;
- else if (sType == "gtk-media-play")
- eRet = SymbolType::PLAY;
- else if (sType == "gtk-media-stop")
- eRet = SymbolType::STOP;
- else if (sType == "gtk-goto-first")
- eRet = SymbolType::FIRST;
- else if (sType == "gtk-goto-last")
- eRet = SymbolType::LAST;
- else if (sType == "gtk-go-back")
- eRet = SymbolType::ARROW_LEFT;
- else if (sType == "gtk-go-forward")
- eRet = SymbolType::ARROW_RIGHT;
- else if (sType == "gtk-go-up")
- eRet = SymbolType::ARROW_UP;
- else if (sType == "gtk-go-down")
- eRet = SymbolType::ARROW_DOWN;
- else if (sType == "gtk-missing-image")
- eRet = SymbolType::IMAGE;
- else if (sType == "gtk-help")
- eRet = SymbolType::HELP;
- else if (sType == "gtk-close")
- eRet = SymbolType::CLOSE;
- else if (sType == "gtk-new")
- eRet = SymbolType::PLUS;
- else if (!mapStockToImageResource(sType).isEmpty())
- eRet = SymbolType::IMAGE;
- return eRet;
- }
+}
- void setupFromActionName(Button *pButton, VclBuilder::stringmap &rMap, const css::uno::Reference<css::frame::XFrame>& rFrame);
+SymbolType VclBuilder::mapStockToSymbol(std::u16string_view sType)
+{
+ SymbolType eRet = SymbolType::DONTKNOW;
+ if (sType == u"media-skip-forward")
+ eRet = SymbolType::NEXT;
+ else if (sType == u"media-skip-backward")
+ eRet = SymbolType::PREV;
+ else if (sType == u"media-playback-start")
+ eRet = SymbolType::PLAY;
+ else if (sType == u"media-playback-stop")
+ eRet = SymbolType::STOP;
+ else if (sType == u"go-first")
+ eRet = SymbolType::FIRST;
+ else if (sType == u"go-last")
+ eRet = SymbolType::LAST;
+ else if (sType == u"go-previous")
+ eRet = SymbolType::ARROW_LEFT;
+ else if (sType == u"go-next")
+ eRet = SymbolType::ARROW_RIGHT;
+ else if (sType == u"go-up")
+ eRet = SymbolType::ARROW_UP;
+ else if (sType == u"go-down")
+ eRet = SymbolType::ARROW_DOWN;
+ else if (sType == u"missing-image")
+ eRet = SymbolType::IMAGE;
+ else if (sType == u"help-browser")
+ eRet = SymbolType::HELP;
+ else if (sType == u"window-close")
+ eRet = SymbolType::CLOSE;
+ else if (sType == u"document-new")
+ eRet = SymbolType::PLUS;
+ else if (sType == u"pan-down-symbolic")
+ eRet = SymbolType::SPIN_DOWN;
+ else if (sType == u"pan-up-symbolic")
+ eRet = SymbolType::SPIN_UP;
+ else if (!mapStockToImageResource(sType).isEmpty())
+ eRet = SymbolType::IMAGE;
+ return eRet;
}
-#if defined SAL_LOG_WARN
namespace
{
+ void setupFromActionName(Button *pButton, VclBuilder::stringmap &rMap, const css::uno::Reference<css::frame::XFrame>& rFrame);
+
+#if defined SAL_LOG_WARN
bool isButtonType(WindowType nType)
{
return nType == WindowType::PUSHBUTTON ||
@@ -159,9 +160,10 @@ namespace
nType == WindowType::MOREBUTTON ||
nType == WindowType::SPINBUTTON;
}
-}
#endif
+}
+
weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile)
{
bool bUseJSBuilder = false;
@@ -646,22 +648,25 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
continue;
aImagesToBeRemoved.insert(elem.m_sValue);
- VclBuilder::StockMap::iterator aFind = m_pParserState->m_aStockMap.find(elem.m_sValue.toUtf8());
- if (aFind == m_pParserState->m_aStockMap.end())
+ if (!elem.m_bRadio)
{
- if (!elem.m_bRadio)
+ const Image& rImage = pImage->GetImage();
+ SymbolType eSymbol = mapStockToSymbol(rImage.GetStock());
+ if (eSymbol != SymbolType::IMAGE && eSymbol != SymbolType::DONTKNOW)
{
- const Image& rImage = pImage->GetImage();
- if (rImage.GetStock() == "pan-down-symbolic")
- pTargetButton->SetSymbol(SymbolType::SPIN_DOWN);
- else if (rImage.GetStock() == "pan-up-symbolic")
- pTargetButton->SetSymbol(SymbolType::SPIN_UP);
- else
- pTargetButton->SetModeImage(rImage);
+ pTargetButton->SetSymbol(eSymbol);
+ //fdo#76457 keep symbol images small e.g. tools->customize->menu
+ //but images the right size. Really the PushButton::CalcMinimumSize
+ //and PushButton::ImplDrawPushButton are the better place to handle
+ //this, but its such a train-wreck
+ pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE);
+ }
+ else
+ {
+ pTargetButton->SetModeImage(rImage);
if (pImage->GetStyle() & WB_SMALLSTYLE)
{
- pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE);
- Size aSz(pTargetButton->GetModeImage().GetSizePixel());
+ Size aSz(rImage.GetSizePixel());
aSz.AdjustWidth(6);
aSz.AdjustHeight(6);
if (pTargetButton->get_width_request() == -1)
@@ -670,43 +675,24 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
pTargetButton->set_height_request(aSz.Height());
}
}
- else
- pTargetRadio->SetModeRadioImage(pImage->GetImage());
}
else
+ pTargetRadio->SetModeRadioImage(pImage->GetImage());
+
+ auto aFind = m_pParserState->m_aImageSizeMap.find(elem.m_sValue.toUtf8());
+ if (aFind != m_pParserState->m_aImageSizeMap.end())
{
- const stockinfo &rImageInfo = aFind->second;
- SymbolType eType = mapStockToSymbol(rImageInfo.m_sStock);
- SAL_WARN_IF(eType == SymbolType::DONTKNOW, "vcl", "missing stock image element for button");
- if (eType == SymbolType::DONTKNOW)
- continue;
- if (!elem.m_bRadio)
- {
- pTargetButton->SetSymbol(eType);
- //fdo#76457 keep symbol images small e.g. tools->customize->menu
- //but images the right size. Really the PushButton::CalcMinimumSize
- //and PushButton::ImplDrawPushButton are the better place to handle
- //this, but its such a train-wreck
- if (eType != SymbolType::IMAGE)
- pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE);
- }
- else
- SAL_WARN_IF(eType != SymbolType::IMAGE, "vcl.builder", "unimplemented symbol type for radiobuttons");
- if (eType == SymbolType::IMAGE)
- {
- Image const aImage(StockImage::Yes,
- mapStockToImageResource(rImageInfo.m_sStock));
- if (!elem.m_bRadio)
- pTargetButton->SetModeImage(aImage);
- else
- pTargetRadio->SetModeRadioImage(aImage);
- }
- switch (rImageInfo.m_nSize)
+ switch (aFind->second)
{
case 1:
pTarget->SetSmallSymbol();
break;
+ case 2:
+ assert(pImage->GetStyle() & WB_SMALLSTYLE);
+ pTarget->SetStyle(pTarget->GetStyle() | WB_SMALLSTYLE);
+ break;
case 3:
+ pTarget->SetStyle(pTarget->GetStyle() | WB_SMALLSTYLE);
// large toolbar, make bigger than normal (4)
pTarget->set_width_request(pTarget->GetOptimalSize().Width() * 1.5);
pTarget->set_height_request(pTarget->GetOptimalSize().Height() * 1.5);
@@ -714,9 +700,10 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
case 4:
break;
default:
- SAL_WARN("vcl.builder", "unsupported image size " << rImageInfo.m_nSize);
+ SAL_WARN("vcl.builder", "unsupported image size " << aFind->second);
break;
}
+ m_pParserState->m_aImageSizeMap.erase(aFind);
}
}
@@ -727,28 +714,6 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
delete_by_name(elem.toUtf8());
}
- //fill in any stock icons in surviving images
- for (auto const& elem : m_pParserState->m_aStockMap)
- {
- FixedImage *pImage = get<FixedImage>(elem.first);
- SAL_WARN_IF(!pImage, "vcl", "missing elements of image/stock: " << elem.first);
- if (!pImage)
- continue;
-
- const stockinfo &rImageInfo = elem.second;
- if (rImageInfo.m_sStock == "gtk-missing-image")
- continue;
-
- SymbolType eType = mapStockToSymbol(rImageInfo.m_sStock);
- SAL_WARN_IF(eType != SymbolType::IMAGE, "vcl", "unimplemented symbol type for images");
- if (eType != SymbolType::IMAGE)
- continue;
-
- Image const aImage(StockImage::Yes,
- mapStockToImageResource(rImageInfo.m_sStock));
- pImage->SetImage(aImage);
- }
-
//Set button menus when everything has been imported
for (auto const& elem : m_pParserState->m_aButtonMenuMaps)
{
@@ -1039,19 +1004,10 @@ namespace
rMap.erase(aFind);
}
}
- 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;
+ if (sIconName == "missing-image")
+ return OUString();
+ OUString sReplace = mapStockToImageResource(sIconName);
+ return !sReplace.isEmpty() ? sReplace : sIconName;
}
OUString getStockText(const OUString &rType)
@@ -1494,22 +1450,13 @@ void VclBuilder::extractBuffer(const OString &id, stringmap &rMap)
}
}
-void VclBuilder::extractStock(const OString &id, stringmap &rMap)
+int VclBuilder::getImageSize(const stringmap &rMap)
{
- VclBuilder::stringmap::iterator aFind = rMap.find(OString("stock"));
- if (aFind == rMap.end())
- return;
-
- stockinfo aInfo;
- aInfo.m_sStock = aFind->second;
- rMap.erase(aFind);
- aFind = rMap.find(OString("icon-size"));
+ int nSize = 4;
+ auto 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;
+ nSize = aFind->second.toInt32();
+ return nSize;
}
void VclBuilder::extractButtonImage(const OString &id, stringmap &rMap, bool bRadio)
@@ -2090,8 +2037,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
OUString sIconName = extractIconName(rMap);
if (!sIconName.isEmpty())
xFixedImage->SetImage(FixedImage::loadThemeImage(sIconName));
- else
- extractStock(id, rMap);
+ m_pParserState->m_aImageSizeMap[id] = getImageSize(rMap);
xWindow = xFixedImage;
//such parentless GtkImages are temps used to set icons on buttons
//default them to hidden to stop e.g. insert->index entry flicking temp
@@ -2227,8 +2173,6 @@ 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));
diff --git a/vcl/uiconfig/ui/aboutbox.ui b/vcl/uiconfig/ui/aboutbox.ui
index 560c84d89dc1..84d73f3e6111 100644
--- a/vcl/uiconfig/ui/aboutbox.ui
+++ b/vcl/uiconfig/ui/aboutbox.ui
@@ -13,7 +13,7 @@
<object class="GtkImage" id="logo">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index 011a8563bca0..837b571324ac 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -41,22 +41,22 @@
<object class="GtkImage" id="imgBack">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-back</property>
+ <property name="icon-name">go-previous</property>
</object>
<object class="GtkImage" id="imgFirst">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-first</property>
+ <property name="icon-name">go-first</property>
</object>
<object class="GtkImage" id="imgForward">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="icon-name">go-next</property>
</object>
<object class="GtkImage" id="imgLast">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-goto-last</property>
+ <property name="icon-name">go-last</property>
</object>
<object class="GtkDialog" id="PrintDialog">
<property name="can_focus">False</property>
@@ -809,7 +809,7 @@
<object class="GtkImage" id="collateimage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="icon-name">missing-image</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 7afe6a7b1587..a3c2fb498dfd 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -16652,6 +16652,12 @@ void ensure_disable_ctrl_page_up_down_bindings()
}
}
+bool IsAllowedBuiltInIcon(std::u16string_view iconName)
+{
+ // limit the named icons to those known by VclBuilder
+ return VclBuilder::mapStockToSymbol(iconName) != SymbolType::DONTKNOW;
+}
+
class GtkInstanceBuilder : public weld::Builder
{
private:
@@ -16689,7 +16695,7 @@ private:
if (icon_name)
{
OUString aIconName(icon_name, strlen(icon_name), RTL_TEXTENCODING_UTF8);
- if (aIconName != "pan-up-symbolic" && aIconName != "pan-down-symbolic")
+ if (!IsAllowedBuiltInIcon(aIconName))
{
if (GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang))
{
@@ -16705,7 +16711,7 @@ private:
if (const gchar* icon_name = gtk_tool_button_get_icon_name(pToolButton))
{
OUString aIconName(icon_name, strlen(icon_name), RTL_TEXTENCODING_UTF8);
- if (aIconName != "pan-up-symbolic" && aIconName != "pan-down-symbolic")
+ if (!IsAllowedBuiltInIcon(aIconName))
{
if (GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang))
{