summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-10-25 10:31:47 +0200
committerBalazs Varga <balazs.varga.extern@allotropia.de>2023-10-26 09:22:40 +0200
commit54aa9a9cb7f283d2ed2853e064573564f16e353b (patch)
tree9f8aca6893b65cd7eea43a634868b0539db7a2ea
parent6a8cae6995d22666c0a6fd2b42c171ef27ae30ac (diff)
tdf#157842 - UI: Part 7 - Unify lockdown behavior of Options dialog
for Personalization Page. Change-Id: I5f2b674b9548610be8f918e6713e6ea91be7442e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158418 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
-rw-r--r--cui/source/options/personalization.cxx12
-rw-r--r--cui/source/options/personalization.hxx2
-rw-r--r--cui/uiconfig/ui/personalization_tab.ui206
3 files changed, 138 insertions, 82 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 49974a90eef2..6311fd491141 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -33,7 +33,9 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage(weld::Container* pPage,
: SfxTabPage(pPage, pController, "cui/ui/personalization_tab.ui", "PersonalizationTabPage",
&rSet)
, m_xNoPersona(m_xBuilder->weld_radio_button("no_persona"))
+ , m_xPersonaImg(m_xBuilder->weld_widget("lockpersona"))
, m_xDefaultPersona(m_xBuilder->weld_radio_button("default_persona"))
+ , m_xContentGrid(m_xBuilder->weld_container("gridpersonasetting"))
{
for (sal_uInt32 i = 0; i < MAX_DEFAULT_PERSONAS; ++i)
{
@@ -116,6 +118,16 @@ void SvxPersonalizationTabPage::Reset(const SfxItemSet*)
m_xNoPersona->set_active(true);
else
m_xDefaultPersona->set_active(true);
+
+ if (officecfg::Office::Common::Misc::Persona::isReadOnly())
+ {
+ m_xNoPersona->set_sensitive(false);
+ m_xDefaultPersona->set_sensitive(false);
+ m_xPersonaImg->set_visible(true);
+ }
+
+ if (officecfg::Office::Common::Misc::PersonaSettings::isReadOnly())
+ m_xContentGrid->set_sensitive(false);
}
void SvxPersonalizationTabPage::LoadDefaultImages()
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index b86653fc5d75..786b22c7d7b3 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -18,7 +18,9 @@ class SvxPersonalizationTabPage : public SfxTabPage
{
private:
std::unique_ptr<weld::RadioButton> m_xNoPersona; ///< Just the default look, without any bitmap
+ std::unique_ptr<weld::Widget> m_xPersonaImg;
std::unique_ptr<weld::RadioButton> m_xDefaultPersona; ///< Use the built-in bitmap
+ std::unique_ptr<weld::Container> m_xContentGrid;
std::unique_ptr<weld::ToggleButton> m_vDefaultPersonaImages
[MAX_DEFAULT_PERSONAS]; ///< Buttons to show the default persona images
OUString m_aPersonaSettings; ///< Header and footer images + color to be set in the settings.
diff --git a/cui/uiconfig/ui/personalization_tab.ui b/cui/uiconfig/ui/personalization_tab.ui
index 9e483780bb4f..fc89951f2cb4 100644
--- a/cui/uiconfig/ui/personalization_tab.ui
+++ b/cui/uiconfig/ui/personalization_tab.ui
@@ -1,38 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="cui">
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="PersonalizationTabPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="vbox2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
+ <property name="margin-end">6</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
- <property name="margin-end">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkRadioButton" id="no_persona">
- <property name="label" translatable="yes" context="personalization_tab|no_persona">Default look, do not use Themes</property>
+ <!-- n-columns=2 n-rows=1 -->
+ <object class="GtkGrid">
<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="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <!-- n-columns=1 n-rows=2 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row-spacing">12</property>
+ <child>
+ <object class="GtkRadioButton" id="no_persona">
+ <property name="label" translatable="yes" context="personalization_tab|no_persona">Default look, do not use Themes</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="active">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">default_persona</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="default_persona">
+ <property name="label" translatable="yes" context="personalization_tab|default_persona">Preinstalled Theme</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="active">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">no_persona</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="lockpersona">
+ <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>
@@ -41,128 +96,115 @@
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="default_persona">
- <property name="label" translatable="yes" context="personalization_tab|default_persona">Preinstalled Theme</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>
- <property name="group">no_persona</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
+ <placeholder/>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid">
+ <!-- n-columns=3 n-rows=3 -->
+ <object class="GtkGrid" id="gridpersonasetting">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">center</property>
<property name="margin-start">24</property>
<property name="margin-end">6</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkToggleButton" id="default1">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default0">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default2">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default3">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default4">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default5">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default6">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default7">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="default8">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="always_show_image">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">2</property>
</packing>
</child>
</object>
@@ -177,7 +219,7 @@
<child type="label">
<object class="GtkLabel" id="personas_label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="personalization_tab|personas_label">LibreOffice Themes</property>
<attributes>
<attribute name="weight" value="bold"/>