diff options
author | Per99 <solare99@gmx.de> | 2024-07-29 11:36:29 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-31 09:29:47 +0200 |
commit | ef7429f86788f0616db5b274ec77eb67cd41cb3d (patch) | |
tree | f037348182ff7ba6f42cb4943701bb2676403530 | |
parent | bf47539b805a3c654fa8ab3638123875b53565d5 (diff) |
tdf#161765, tdf#115688 Let user choose which animation settings to use
In the accessibility option page, the user can now choose which
animation settings to use (OS's or LO's animation setting) and what
animations to allow.
This fixes also tdf#115688: "Add Checkbox option to disable animated
overlay to Tools -> Options -> Accessibility panel"
Changes due to this patch:
1. Changes in the GUI of the accessibility option page:
- New option "Allow other animations" (Used for "Marching Ants"
animation, instead of old expert option "AnimationsEnabled"), now as enum.
- Changed option "Allow animated images", now as enum: "System", "No", "Yes"
- Changed option "Allow animated text", now as enum: "System", "No", "Yes"
- The old animation options in Common.xcs are not renamed, but marked
as deprecated and obsolete in their text.
These above changes are in the files: [optaccessibilitypage.ui,
optaccessibility.hxx, optaccessibility.cxx, Common.xcs]
2. Added functions to compute if the animations of images/text/other
are allowed. If "System" is chosen, then use OS’s animation setting.
See files: [settings.hxx, settings.cxx]
3. Respect the animation settings of animated images/texts in Draw and
Impress. Don't prohibit the user to enable animations in Draw and
Impress if the OS's animations are disabled.
See file: [objectcontactofpageview.cxx]
4. Respect the animation settings of animated images in Writer.
See file: [viewsh.cxx]
5. Respect the "Allow other animations" setting in Calc
(for "marching ants" animation). Don't prohibit the user to enable these
other animations in LO if the OS's animations are disabled.
See file: [overlayobject.cxx]
Change-Id: I5173f9b3d8652a17a6ae07164e874143738bcd66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170827
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
-rw-r--r-- | cui/source/options/optaccessibility.cxx | 47 | ||||
-rw-r--r-- | cui/source/options/optaccessibility.hxx | 9 | ||||
-rw-r--r-- | cui/uiconfig/ui/optaccessibilitypage.ui | 420 | ||||
-rw-r--r-- | include/vcl/settings.hxx | 3 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 98 | ||||
-rw-r--r-- | sc/source/ui/view/overlayobject.cxx | 9 | ||||
-rw-r--r-- | svx/source/sdr/contact/objectcontactofpageview.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 5 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 76 |
9 files changed, 531 insertions, 149 deletions
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx index de129b0ab2ba..15cf144add0d 100644 --- a/cui/source/options/optaccessibility.cxx +++ b/cui/source/options/optaccessibility.cxx @@ -68,10 +68,15 @@ SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(weld::Container* , m_xAccessibilityTool(m_xBuilder->weld_check_button(u"acctool"_ustr)) , m_xTextSelectionInReadonly(m_xBuilder->weld_check_button(u"textselinreadonly"_ustr)) , m_xTextSelectionInReadonlyImg(m_xBuilder->weld_widget(u"locktextselinreadonly"_ustr)) - , m_xAnimatedGraphics(m_xBuilder->weld_check_button(u"animatedgraphics"_ustr)) - , m_xAnimatedGraphicsImg(m_xBuilder->weld_widget(u"lockanimatedgraphics"_ustr)) - , m_xAnimatedTexts(m_xBuilder->weld_check_button(u"animatedtext"_ustr)) + , m_xAnimatedGraphics(m_xBuilder->weld_combo_box(u"animatedgraphicenabled"_ustr)) + , m_xAnimatedGraphicsImg(m_xBuilder->weld_widget(u"lockanimatedgraphic"_ustr)) + , m_xAnimatedGraphicsLabel(m_xBuilder->weld_label(u"animatedgraphiclabel"_ustr)) + , m_xAnimatedOthers(m_xBuilder->weld_combo_box(u"animatedothersenabled"_ustr)) + , m_xAnimatedOthersImg(m_xBuilder->weld_widget(u"lockanimatedothers"_ustr)) + , m_xAnimatedOthersLabel(m_xBuilder->weld_label(u"animatedotherslabel"_ustr)) + , m_xAnimatedTexts(m_xBuilder->weld_combo_box(u"animatedtextenabled"_ustr)) , m_xAnimatedTextsImg(m_xBuilder->weld_widget(u"lockanimatedtext"_ustr)) + , m_xAnimatedTextsLabel(m_xBuilder->weld_label(u"animatedtextlabel"_ustr)) , m_xHighContrast(m_xBuilder->weld_combo_box(u"highcontrast"_ustr)) , m_xHighContrastImg(m_xBuilder->weld_widget(u"lockhighcontrast"_ustr)) , m_xHighContrastLabel(m_xBuilder->weld_label(u"label13"_ustr)) @@ -112,7 +117,9 @@ std::unique_ptr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create(weld::Contain OUString SvxAccessibilityOptionsTabPage::GetAllStrings() { OUString sAllStrings; - OUString labels[] = { u"label1"_ustr, u"label2"_ustr, u"label13"_ustr }; + OUString labels[] = { u"label1"_ustr, u"label2"_ustr, u"label13"_ustr, + u"animationframelabel"_ustr, u"animatedgraphiclabel"_ustr, u"animatedtextlabel"_ustr, + u"animatedotherslabel"_ustr, u"label11"_ustr }; for (const auto& label : labels) { @@ -120,8 +127,8 @@ OUString SvxAccessibilityOptionsTabPage::GetAllStrings() sAllStrings += pString->get_label() + " "; } - OUString checkButton[] = { u"acctool"_ustr, u"textselinreadonly"_ustr, u"animatedgraphics"_ustr, - u"animatedtext"_ustr, u"autofontcolor"_ustr, u"systempagepreviewcolor"_ustr }; + OUString checkButton[] = { u"acctool"_ustr, u"textselinreadonly"_ustr, + u"autofontcolor"_ustr, u"systempagepreviewcolor"_ustr }; for (const auto& check : checkButton) { @@ -137,10 +144,12 @@ bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* ) std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create() ); if ( !officecfg::Office::Common::Accessibility::IsForPagePreviews::isReadOnly() ) officecfg::Office::Common::Accessibility::IsForPagePreviews::set(m_xPagePreviews->get_active(), batch); - if ( !officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::set(m_xAnimatedGraphics->get_active(), batch); - if ( !officecfg::Office::Common::Accessibility::IsAllowAnimatedText::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsAllowAnimatedText::set(m_xAnimatedTexts->get_active(), batch); + if ( !officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::isReadOnly() ) + officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::set(m_xAnimatedGraphics->get_active(), batch); + if ( !officecfg::Office::Common::Accessibility::AllowAnimatedOthers::isReadOnly() ) + officecfg::Office::Common::Accessibility::AllowAnimatedOthers::set(m_xAnimatedOthers->get_active(), batch); + if ( !officecfg::Office::Common::Accessibility::AllowAnimatedText::isReadOnly() ) + officecfg::Office::Common::Accessibility::AllowAnimatedText::set(m_xAnimatedTexts->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::IsAutomaticFontColor::isReadOnly() ) officecfg::Office::Common::Accessibility::IsAutomaticFontColor::set(m_xAutomaticFontColor->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::IsSelectionInReadonly::isReadOnly() ) @@ -310,17 +319,27 @@ void SvxAccessibilityOptionsTabPage::Reset( const SfxItemSet* ) m_xPagePreviewsImg->set_visible(true); } - m_xAnimatedGraphics->set_active( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get() ); - if (officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::isReadOnly()) + m_xAnimatedGraphics->set_active( officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::get() ); + if (officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::isReadOnly()) { m_xAnimatedGraphics->set_sensitive(false); + m_xAnimatedGraphicsLabel->set_sensitive(false); m_xAnimatedGraphicsImg->set_visible(true); } - m_xAnimatedTexts->set_active( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::get() ); - if (officecfg::Office::Common::Accessibility::IsAllowAnimatedText::isReadOnly()) + m_xAnimatedOthers->set_active( officecfg::Office::Common::Accessibility::AllowAnimatedOthers::get() ); + if (officecfg::Office::Common::Accessibility::AllowAnimatedOthers::isReadOnly()) + { + m_xAnimatedOthers->set_sensitive(false); + m_xAnimatedOthersLabel->set_sensitive(false); + m_xAnimatedOthersImg->set_visible(true); + } + + m_xAnimatedTexts->set_active( officecfg::Office::Common::Accessibility::AllowAnimatedText::get() ); + if (officecfg::Office::Common::Accessibility::AllowAnimatedText::isReadOnly()) { m_xAnimatedTexts->set_sensitive(false); + m_xAnimatedTextsLabel->set_sensitive(false); m_xAnimatedTextsImg->set_visible(true); } diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx index 7ce308155b15..5cdfee45d69d 100644 --- a/cui/source/options/optaccessibility.hxx +++ b/cui/source/options/optaccessibility.hxx @@ -27,10 +27,15 @@ class SvxAccessibilityOptionsTabPage : public SfxTabPage std::unique_ptr<weld::CheckButton> m_xAccessibilityTool; std::unique_ptr<weld::CheckButton> m_xTextSelectionInReadonly; std::unique_ptr<weld::Widget> m_xTextSelectionInReadonlyImg; - std::unique_ptr<weld::CheckButton> m_xAnimatedGraphics; + std::unique_ptr<weld::ComboBox> m_xAnimatedGraphics; std::unique_ptr<weld::Widget> m_xAnimatedGraphicsImg; - std::unique_ptr<weld::CheckButton> m_xAnimatedTexts; + std::unique_ptr<weld::Label> m_xAnimatedGraphicsLabel; + std::unique_ptr<weld::ComboBox> m_xAnimatedOthers; + std::unique_ptr<weld::Widget> m_xAnimatedOthersImg; + std::unique_ptr<weld::Label> m_xAnimatedOthersLabel; + std::unique_ptr<weld::ComboBox> m_xAnimatedTexts; std::unique_ptr<weld::Widget> m_xAnimatedTextsImg; + std::unique_ptr<weld::Label> m_xAnimatedTextsLabel; std::unique_ptr<weld::ComboBox> m_xHighContrast; std::unique_ptr<weld::Widget> m_xHighContrastImg; std::unique_ptr<weld::Label> m_xHighContrastLabel; diff --git a/cui/uiconfig/ui/optaccessibilitypage.ui b/cui/uiconfig/ui/optaccessibilitypage.ui index 0402e7760fe3..edf30438ca41 100644 --- a/cui/uiconfig/ui/optaccessibilitypage.ui +++ b/cui/uiconfig/ui/optaccessibilitypage.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.2 --> +<!-- Generated with glade 3.40.0 --> <interface domain="cui"> <requires lib="gtk+" version="3.20"/> <object class="GtkListStore" id="liststore1"> @@ -27,145 +27,234 @@ <property name="orientation">vertical</property> <property name="spacing">12</property> <child> - <object class="GtkFrame" id="frame1"> + <object class="GtkFrame" id="animationsframe"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=4 --> - <object class="GtkGrid" id="grid1"> + <object class="GtkBox" id="animationsbox"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="margin-start">12</property> <property name="margin-top">6</property> <property name="orientation">vertical</property> - <property name="row-spacing">6</property> + <property name="spacing">8</property> <child> - <object class="GtkCheckButton" id="acctool"> - <property name="label" translatable="yes" context="optaccessibilitypage|acctool">Support _assistive technology tools (program restart required)</property> + <!-- n-columns=3 n-rows=1 --> + <object class="GtkGrid" id="animatedgraphicgrid"> <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="use-underline">True</property> - <property name="draw-indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="acctool-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|acctool">Allows you to use assistive tools, such as external screen readers, Braille devices or speech recognition input devices. The Java Runtime Environment must be installed on your computer before you can enable assistive support.</property> + <property name="can-focus">False</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkLabel" id="animatedgraphiclabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="optaccessibilitypage|animatedgraphiclabel">Allow animated images: </property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">animatedgraphicenabled</property> + <property name="xalign">0</property> + <child internal-child="accessible"> + <object class="AtkObject" id="animatedgraphiclabel-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedgraphiclabel">Controls if previewing the animation of animated images (e.g. animated GIFs) is enabled. Select from “System”, “No” and “Yes”. +“System” previews the animation of animated images according to system settings.</property> + </object> + </child> </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> </child> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="textselinreadonly"> - <property name="label" translatable="yes" context="optaccessibilitypage|textselinreadonly">Use te_xt selection cursor in read-only text documents</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="use-underline">True</property> - <property name="draw-indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="textselinreadonly-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|textselinreadonly">Displays cursor in read-only documents.</property> + <child> + <object class="GtkImage" id="lockanimatedgraphic"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> </child> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="animatedgraphics"> - <property name="label" translatable="yes" context="optaccessibilitypage|animatedgraphics">Allow animated _images</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="use-underline">True</property> - <property name="draw-indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="animatedgraphics-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedgraphics">Previews animated graphics, such as GIF images.</property> + <child> + <object class="GtkComboBoxText" id="animatedgraphicenabled"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="halign">start</property> + <property name="active">0</property> + <items> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">System</item> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">No</item> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">Yes</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="animatedgraphicenabled-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedgraphicenabled">Controls if previewing the animation of animated images (e.g. animated GIFs) is enabled. Select from “System”, “No” and “Yes”. +“System” previews the animation of animated images according to system settings.</property> + </object> + </child> </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> </child> </object> <packing> - <property name="left-attach">1</property> - <property name="top-attach">2</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkCheckButton" id="animatedtext"> - <property name="label" translatable="yes" context="optaccessibilitypage|animatedtext">Allow animated _text</property> + <!-- n-columns=3 n-rows=1 --> + <object class="GtkGrid" id="animatedtextgrid"> <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="use-underline">True</property> - <property name="draw-indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="animatedtext-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedtext">Previews animated text, such as blinking and scrolling.</property> + <property name="can-focus">False</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkImage" id="lockanimatedtext"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="animatedtextlabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="optaccessibilitypage|animatedtextlabel">Allow animated text: </property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">animatedtextenabled</property> + <property name="xalign">0</property> + <child internal-child="accessible"> + <object class="AtkObject" id="animatedtextlabel-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedtextlabel">Controls if previewing the animation of animated text (such as blinking and scrolling) is enabled. Select from “System”, “No” and “Yes”. +“System” previews the animation of animated text according to system settings.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="animatedtextenabled"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="halign">start</property> + <property name="active">0</property> + <items> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">System</item> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">No</item> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">Yes</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="animatedtextenabled-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedtextenabled">Controls if previewing the animation of animated text (such as blinking and scrolling) is enabled. Select from “System”, “No” and “Yes”. +“System” previews the animation of animated text according to system settings.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> </child> </object> <packing> - <property name="left-attach">1</property> - <property name="top-attach">3</property> - </packing> - </child> - <child> - <object class="GtkImage" id="locktextselinreadonly"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon-name">res/lock.png</property> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkImage" id="lockanimatedgraphics"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon-name">res/lock.png</property> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">2</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> </packing> </child> <child> - <object class="GtkImage" id="lockanimatedtext"> + <!-- n-columns=3 n-rows=1 --> + <object class="GtkGrid" id="animatedothersgrid"> + <property name="visible">True</property> <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon-name">res/lock.png</property> + <property name="hexpand">True</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkLabel" id="animatedotherslabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="optaccessibilitypage|animatedotherslabel" comments="This option allows e.g. 'running ants' animation in Calc">Allow other animations: </property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">animatedothersenabled</property> + <property name="xalign">0</property> + <child internal-child="accessible"> + <object class="AtkObject" id="animatedotherslabel-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedotherslabel">Controls if certain other animations (e.g. 'marching ants' animation when copying a cell in calc) are enabled. Select from “System”, “No” and “Yes”. +“System” allows showing these certain other animations according to system settings.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockanimatedothers"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="animatedothersenabled"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="halign">start</property> + <property name="active">0</property> + <items> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">System</item> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">No</item> + <item translatable="yes" context="optaccessibilitypage|animationsenabled">Yes</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="animatedothersenabled-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|animatedothersenabled">Controls if certain other animations (e.g. 'marching ants' animation when copying a cell in calc) are enabled. Select from “System”, “No” and “Yes”. +“System” allows showing these certain other animations according to system settings.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> + </child> </object> <packing> - <property name="left-attach">0</property> - <property name="top-attach">3</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> </packing> </child> - <child> - <placeholder/> - </child> </object> </child> <child type="label"> - <object class="GtkLabel" id="label1"> + <object class="GtkLabel" id="animationframelabel"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="optaccessibilitypage|label1">Miscellaneous Options</property> + <property name="label" translatable="yes" context="optaccessibilitypage|animationframelabel">Animations</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -207,6 +296,11 @@ <property name="use-underline">True</property> <property name="mnemonic-widget">highcontrast</property> <property name="xalign">0</property> + <child internal-child="accessible"> + <object class="AtkObject" id="label13-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|label13">Controls if high contrast mode is used. Select from “Automatic”, “Disable” and “Enable”. “Automatic” uses high contrast according to system settings.</property> + </object> + </child> </object> <packing> <property name="left-attach">1</property> @@ -214,6 +308,19 @@ </packing> </child> <child> + <object class="GtkImage" id="lockhighcontrast"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> <object class="GtkComboBoxText" id="highcontrast"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -235,19 +342,6 @@ <property name="top-attach">0</property> </packing> </child> - <child> - <object class="GtkImage" id="lockhighcontrast"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon-name">res/lock.png</property> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> - </child> </object> <packing> <property name="expand">False</property> @@ -339,7 +433,7 @@ <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="optaccessibilitypage|label2">Options for High Contrast Appearance</property> + <property name="label" translatable="yes" context="optaccessibilitypage|label2">High Contrast</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -353,6 +447,104 @@ </packing> </child> <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <!-- n-columns=2 n-rows=2 --> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <property name="orientation">vertical</property> + <property name="row-spacing">6</property> + <child> + <object class="GtkCheckButton" id="acctool"> + <property name="label" translatable="yes" context="optaccessibilitypage|acctool">Support _assistive technology tools (program restart required)</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="acctool-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|acctool">Allows you to use assistive tools, such as external screen readers, Braille devices or speech recognition input devices. The Java Runtime Environment must be installed on your computer before you can enable assistive support.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="textselinreadonly"> + <property name="label" translatable="yes" context="optaccessibilitypage|textselinreadonly">Use te_xt selection cursor in read-only text documents</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="textselinreadonly-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|textselinreadonly">Displays cursor in read-only documents.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locktextselinreadonly"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockacctool"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="optaccessibilitypage|label1">Miscellaneous</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> <object class="GtkFrame" id="frame3"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -462,7 +654,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child internal-child="accessible"> diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 402a50df6d96..4379c4dd9822 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -679,6 +679,9 @@ public: static int GetAppColorMode(); // return true if system preferences are set to use reduced animation static bool GetUseReducedAnimation(); + static bool IsAnimatedGraphicAllowed(); + static bool IsAnimatedOthersAllowed(); + static bool IsAnimatedTextAllowed(); bool operator ==( const MiscSettings& rSet ) const; bool operator !=( const MiscSettings& rSet ) const; }; diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index fae4d7310201..068df683a2c5 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -679,13 +679,9 @@ </prop> <prop oor:name="AnimationsEnabled" oor:type="xs:boolean" oor:nillable="false"> <info> - <desc>Defines if the user interface animations (like "walking ant" - animation when copying a cell in Calc) is enabled or disabled. - Disabling animations makes a lot of sense on remote connections - (VNC), where animations increase the (always limited) amount of - bandwidth needed. - </desc> - <label>Defines if the user interface animations are disabled.</label> + <deprecated>Not used anymore</deprecated> + <desc>__Obsolete__: Please use the setting "Allow other animations" found in Menu: Tools --> Options --> Accessibility.</desc> + <label>__Obsolete__: Please use the setting "Allow other animations" found in Menu: Tools --> Options --> Accessibility.</label> </info> <value>true</value> </prop> @@ -6034,7 +6030,8 @@ </constraints> <value>4</value> </prop> - <prop oor:name="IsAllowAnimatedGraphics" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="AllowAnimatedGraphic" oor:type="xs:short" oor:nillable="false"> + <!-- UIHints: Tools - Options - Accessibility Options --> <info> <desc>Indicates whether to allow the graphical animation in all SO/OO applications (i.e. animated GIFs and objects in Impress during @@ -6042,14 +6039,95 @@ Insert-Image, Animation Tool in Impress.)</desc> <label>Allow animated images</label> </info> - <value>true</value> + <constraints> + <enumeration oor:value="0"> + <info> + <desc>Use the OS setting for allowing animations.</desc> + </info> + </enumeration> + <enumeration oor:value="1"> + <info> + <desc>No</desc> + </info> + </enumeration> + <enumeration oor:value="2"> + <info> + <desc>Yes</desc> + </info> + </enumeration> + </constraints> + <value>0</value> </prop> - <prop oor:name="IsAllowAnimatedText" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="AllowAnimatedText" oor:type="xs:short" oor:nillable="false"> + <!-- UIHints: Tools - Options - Accessibility Options --> <info> <desc>Indicates whether to allow all textual animation like blinking and scrolling in all SO/OO applications.</desc> <label>Allow animated text</label> </info> + <constraints> + <enumeration oor:value="0"> + <info> + <desc>Use the OS setting for allowing animations.</desc> + </info> + </enumeration> + <enumeration oor:value="1"> + <info> + <desc>No</desc> + </info> + </enumeration> + <enumeration oor:value="2"> + <info> + <desc>Yes</desc> + </info> + </enumeration> + </constraints> + <value>0</value> + </prop> + <prop oor:name="AllowAnimatedOthers" oor:type="xs:short" oor:nillable="false"> + <!-- UIHints: Tools - Options - Accessibility Options --> + <info> + <desc>Indicates whether to allow certain others animations + (like "marching ants" animation when copying a cell in Calc) + in all SO/OO applications. + Disabling animations makes a lot of sense on remote connections + (VNC), where animations increase the (always limited) amount of + bandwidth needed.</desc> + <label>Allow other animations</label> + </info> + <constraints> + <enumeration oor:value="0"> + <info> + <desc>Use the OS setting for allowing animations.</desc> + </info> + </enumeration> + <enumeration oor:value="1"> + <info> + <desc>No</desc> + </info> + </enumeration> + <enumeration oor:value="2"> + <info> + <desc>Yes</desc> + </info> + </enumeration> + </constraints> + <value>0</value> + </prop> + <prop oor:name="IsAllowAnimatedGraphics" oor:type="xs:boolean" oor:nillable="false"> + <info> + <deprecated>Not used anymore</deprecated> + <desc>__Obsolete__: Please use the setting "Allow animated images" found in Menu: Tools --> Options --> Accessibility.</desc> + <label>__Obsolete__: Please use the setting "Allow animated images" found in Menu: Tools --> Options --> Accessibility.</label> + </info> + <value>true</value> + </prop> + <prop oor:name="IsAllowAnimatedText" oor:type="xs:boolean" oor:nillable="false"> + <info> + <deprecated>Not used anymore</deprecated> + <desc>__Obsolete__: Please use the setting "Allow animated text" found in Menu: Tools --> Options --> Accessibility.</desc> + <label>__Obsolete__: Please use the setting "Allow animated text" found in Menu: Tools --> Options --> Accessibility.</label> + </info> <value>true</value> </prop> <prop oor:name="IsAutomaticFontColor" oor:type="xs:boolean" oor:nillable="false"> diff --git a/sc/source/ui/view/overlayobject.cxx b/sc/source/ui/view/overlayobject.cxx index a564265a95ef..b98c72be5114 100644 --- a/sc/source/ui/view/overlayobject.cxx +++ b/sc/source/ui/view/overlayobject.cxx @@ -35,10 +35,11 @@ ScOverlayDashedBorder::ScOverlayDashedBorder(const ::basegfx::B2DRange& rRange, OverlayObject(rColor), mbToggle(true) { - // tdf#155414 include system "reduce animation" preferences - // Allow the system's "reduce animation" preferences to disable the - // Calc animated border when copying a selection of cells. - mbAllowsAnimation = (officecfg::Office::Common::VCL::AnimationsEnabled::get() && !MiscSettings::GetUseReducedAnimation()); + // tdf#115688: Let the user choose in the accessability option page ("Tools" --> "Options" --> "Accessibility --> "Allow other animations") if the "marching ants" animation is allowed. + // tdf#161765: Don't override LO's animation settings with OS's all-or-nothing animation setting, + // but do respect OS's animation setting if the user has selected the option "System". + // New options: "System"/"No"/"Yes" + mbAllowsAnimation = MiscSettings::IsAnimatedOthersAllowed(); maRange = rRange; } diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index ff79d5b88444..28b40a56d59e 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -375,7 +375,10 @@ namespace sdr::contact { if (comphelper::IsFuzzing()) return true; - return officecfg::Office::Common::Accessibility::IsAllowAnimatedText::get(); + // tdf#161765: Let the user choose which animation settings to use: OS's / LO's + // New options: "System"/"No"/"Yes". + // Do respect OS's animation setting if the user has selected the option "System" + return MiscSettings::IsAnimatedTextAllowed(); } // check if graphic animation is allowed. @@ -383,9 +386,11 @@ namespace sdr::contact { if (comphelper::IsFuzzing()) return true; - - // Related tdf#156630 respect system animation setting - return officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get() && !MiscSettings::GetUseReducedAnimation(); + // tdf#161765: Let the user choose which animation settings to use: OS's / LO's and + // don't override here LO's animation settings with OS's all-or-nothing animation setting, + // but do respect OS's animation setting if the user has selected the option "System". + // New options: "System"/"No"/"Yes" + return MiscSettings::IsAnimatedGraphicAllowed(); } // print? diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index c4d9a551807c..0811862713ee 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2706,7 +2706,10 @@ void SwViewShell::ApplyAccessibilityOptions() else { mpAccOptions->SetAlwaysAutoColor(officecfg::Office::Common::Accessibility::IsAutomaticFontColor::get()); - mpAccOptions->SetStopAnimatedGraphics(! officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get()); + // tdf#161765: Let user choose which animation settings to use: OS's / LO's + // New options: "System"/"No"/"Yes". + // Do respect OS's animation setting if the user has selected the option "System" + mpAccOptions->SetStopAnimatedGraphics(! MiscSettings::IsAnimatedGraphicAllowed()); // Form view // Always set this option, not only if document is read-only: diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index e53f89d057b6..ba2901e11ec4 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2900,6 +2900,82 @@ bool MiscSettings::GetUseReducedAnimation() return pDefWindow->ImplGetFrame()->GetUseReducedAnimation(); } +// tdf#115688: Let the user choose in the accessability option page ("Tools" --> "Options" --> "Accessibility --> "Allow other animations") if the "marching ants" animation is allowed. +// tdf#161765: Let the user choose which animation settings to use: OS's / LO's +// New options: "System"/"No"/"Yes". +// Do respect OS's animation setting if the user has selected the option "System" +bool MiscSettings::IsAnimatedOthersAllowed() +{ + sal_Int16 nAllowAnimatedOthers = officecfg::Office::Common::Accessibility::AllowAnimatedOthers::get(); + bool bIsAllowed = false; // false is the default value, if someone sets the enum to other values than the allowed ones. + switch (nAllowAnimatedOthers) + { + case 0: // "System": Use OS's setting + bIsAllowed = ! MiscSettings::GetUseReducedAnimation(); + break; + case 1: // "No": Disallow animation + bIsAllowed = false; + break; + case 2: // "Yes": Allow animation + bIsAllowed = true; + break; + default: + SAL_WARN( "accessibility", "Invalid value of AllowAnimatedOthers: 0x" << std::hex << nAllowAnimatedOthers << std::dec); + break; + } + return bIsAllowed; +} + +// tdf#161765: Let the user choose which animation settings to use: OS's / LO's +// New options: "System"/"No"/"Yes". +// Do respect OS's animation setting if the user has selected the option "System" +bool MiscSettings::IsAnimatedGraphicAllowed() +{ + sal_Int16 nAllowAnimatedGraphic = officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::get(); + bool bIsAllowed = false; // false is the default value, if someone sets the enum to other values than the allowed ones. + switch (nAllowAnimatedGraphic) + { + case 0: // "System": Use OS's setting + bIsAllowed = ! MiscSettings::GetUseReducedAnimation(); + break; + case 1: // "No": Disallow animation + bIsAllowed = false; + break; + case 2: // "Yes": Allow animation + bIsAllowed = true; + break; + default: + SAL_WARN( "accessibility", "Invalid value of officecfg::Office::Common::Accessibility::AllowAnimatedGraphic: 0x" << std::hex << nAllowAnimatedGraphic << std::dec); + break; + } + return bIsAllowed; +} + +// tdf#161765: Let the user choose which animation settings to use: OS's / LO's +// New options: "System"/"No"/"Yes". +// Do respect OS's animation setting if the user has selected the option "System" +bool MiscSettings::IsAnimatedTextAllowed() +{ + sal_Int16 nAllowAnimatedText = officecfg::Office::Common::Accessibility::AllowAnimatedText::get(); + bool bIsAllowed = false; // false is the default value, if someone sets the enum to other values than the allowed ones. + switch (nAllowAnimatedText) + { + case 0: // "System": Use OS's setting + bIsAllowed = ! MiscSettings::GetUseReducedAnimation(); + break; + case 1: // "No": Disallow animation + bIsAllowed = false; + break; + case 2: // "Yes": Allow animation + bIsAllowed = true; + break; + default: + SAL_WARN( "accessibility", "Invalid value of officecfg::Office::Common::Accessibility::AllowAnimatedText: 0x" << std::hex << nAllowAnimatedText << std::dec); + break; + } + return bIsAllowed; +} + HelpSettings::HelpSettings() : mxData(std::make_shared<ImplHelpData>()) { |