diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-10-24 12:47:52 +0200 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-10-26 09:20:49 +0200 |
commit | 9e8c90d92a6658ecc732554cb220d14eaee4692b (patch) | |
tree | 62bfef6b2405e2a4126bac4264c493312f94002d /cui | |
parent | 0c008ab081aa5bbf53f8562e95e547deae5afc2e (diff) |
tdf#157839 - UI: Part 5 - Unify lockdown behavior of Options dialog
for Font Page.
Change-Id: Idd7bdf5d79269dcb5b6e3276b91f17221c3b02e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158384
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/fontsubs.cxx | 24 | ||||
-rw-r--r-- | cui/source/options/fontsubs.hxx | 6 | ||||
-rw-r--r-- | cui/uiconfig/ui/optfontspage.ui | 284 |
3 files changed, 202 insertions, 112 deletions
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index eaf00e2364dd..4d61a873e264 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -35,14 +35,20 @@ SvxFontSubstTabPage::SvxFontSubstTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) : SfxTabPage(pPage, pController, "cui/ui/optfontspage.ui", "OptFontsPage", &rSet) , m_xUseTableCB(m_xBuilder->weld_check_button("usetable")) + , m_xUseTableImg(m_xBuilder->weld_widget("lockusetable")) , m_xFont1CB(m_xBuilder->weld_combo_box("font1")) , m_xFont2CB(m_xBuilder->weld_combo_box("font2")) , m_xApply(m_xBuilder->weld_button("apply")) , m_xDelete(m_xBuilder->weld_button("delete")) , m_xCheckLB(m_xBuilder->weld_tree_view("checklb")) , m_xFontNameLB(m_xBuilder->weld_combo_box("fontname")) + , m_xFontNameLabel(m_xBuilder->weld_label("label8")) + , m_xFontNameImg(m_xBuilder->weld_widget("lockfontname")) , m_xNonPropFontsOnlyCB(m_xBuilder->weld_check_button("nonpropfontonly")) + , m_xNonPropFontsOnlyImg(m_xBuilder->weld_widget("locknonpropfontonly")) , m_xFontHeightLB(m_xBuilder->weld_combo_box("fontheight")) + , m_xFontHeightLabel(m_xBuilder->weld_label("label9")) + , m_xFontHeightImg(m_xBuilder->weld_widget("lockfontheight")) { m_xFont1CB->make_sorted(); m_xFont1CB->set_size_request(1, -1); @@ -222,7 +228,10 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet* ) m_xFont2CB->thaw(); m_xFont1CB->thaw(); + bool bEnable = !officecfg::Office::Common::Font::Substitution::Replacement::isReadOnly(); m_xUseTableCB->set_active(svtools::IsFontSubstitutionsEnabled()); + m_xUseTableCB->set_sensitive(bEnable); + m_xUseTableImg->set_visible(!bEnable); std::vector<SubstitutionStruct> aFontSubs = svtools::GetFontSubstitutions(); std::unique_ptr<weld::TreeIter> xIter(m_xCheckLB->make_iterator()); @@ -259,6 +268,19 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet* ) OUString::number( officecfg::Office::Common::Font::SourceViewFont::FontHeight:: get())); + + bEnable = !officecfg::Office::Common::Font::SourceViewFont::FontName::isReadOnly(); + m_xFontNameLB->set_sensitive(bEnable); + m_xFontNameLabel->set_sensitive(bEnable); + m_xFontNameImg->set_visible(!bEnable); + + m_xNonPropFontsOnlyCB->set_sensitive(bEnable); + m_xNonPropFontsOnlyImg->set_visible(!bEnable); + + m_xFontHeightLB->set_sensitive(bEnable); + m_xFontHeightLabel->set_sensitive(bEnable); + m_xFontHeightImg->set_visible(!bEnable); + m_xNonPropFontsOnlyCB->save_state(); m_xFontHeightLB->save_value(); } @@ -395,7 +417,7 @@ IMPL_LINK(SvxFontSubstTabPage, NonPropFontsHdl, weld::Toggleable&, rBox, void) void SvxFontSubstTabPage::CheckEnable() { - bool bEnableAll = m_xUseTableCB->get_active(); + bool bEnableAll = m_xUseTableCB->get_active() && !officecfg::Office::Common::Font::SourceViewFont::FontName::isReadOnly(); m_xCheckLB->set_sensitive(bEnableAll); m_xFont1CB->set_sensitive(bEnableAll); m_xFont2CB->set_sensitive(bEnableAll); diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx index d86ed04f73cc..e91a9818e56c 100644 --- a/cui/source/options/fontsubs.hxx +++ b/cui/source/options/fontsubs.hxx @@ -28,14 +28,20 @@ class SvxFontSubstTabPage : public SfxTabPage OUString m_sAutomatic; std::unique_ptr<weld::CheckButton> m_xUseTableCB; + std::unique_ptr<weld::Widget> m_xUseTableImg; std::unique_ptr<weld::ComboBox> m_xFont1CB; std::unique_ptr<weld::ComboBox> m_xFont2CB; std::unique_ptr<weld::Button> m_xApply; std::unique_ptr<weld::Button> m_xDelete; std::unique_ptr<weld::TreeView> m_xCheckLB; std::unique_ptr<weld::ComboBox> m_xFontNameLB; + std::unique_ptr<weld::Label> m_xFontNameLabel; + std::unique_ptr<weld::Widget> m_xFontNameImg; std::unique_ptr<weld::CheckButton> m_xNonPropFontsOnlyCB; + std::unique_ptr<weld::Widget> m_xNonPropFontsOnlyImg; std::unique_ptr<weld::ComboBox> m_xFontHeightLB; + std::unique_ptr<weld::Label> m_xFontHeightLabel; + std::unique_ptr<weld::Widget> m_xFontHeightImg; DECL_LINK(SelectComboBoxHdl, weld::ComboBox&, void); DECL_LINK(ToggleHdl, weld::Toggleable&, void); diff --git a/cui/uiconfig/ui/optfontspage.ui b/cui/uiconfig/ui/optfontspage.ui index 30bb49d92d4e..878377a2af36 100644 --- a/cui/uiconfig/ui/optfontspage.ui +++ b/cui/uiconfig/ui/optfontspage.ui @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.38.2 --> <interface domain="cui"> <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">svx/res/nu01.png</property> + <property name="can-focus">False</property> + <property name="icon-name">svx/res/nu01.png</property> </object> <object class="GtkImage" id="image2"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">svx/res/nu02.png</property> + <property name="can-focus">False</property> + <property name="icon-name">svx/res/nu02.png</property> </object> <object class="GtkTreeStore" id="liststore1"> <columns> @@ -42,89 +42,133 @@ </object> <object class="GtkBox" id="OptFontsPage"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="vexpand">True</property> - <property name="border_width">6</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="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">6</property> - <property name="margin-start">12</property> - <property name="margin-top">6</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=1 --> + <object class="GtkGrid" id="grid4"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <child> + <object class="GtkCheckButton" id="usetable"> + <property name="label" translatable="yes" context="optfontspage|usetable">_Apply replacement table</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="usetable-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip | usetable">Enables the font replacement settings that you define.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockusetable"> + <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> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <!-- n-columns=4 n-rows=3 --> <object class="GtkGrid" id="replacements"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</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="GtkLabel" id="label2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="optfontspage|label2">_Font:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">font1</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">font1</property> <property name="xalign">0</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="GtkLabel" id="label3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="optfontspage|label3">Re_place with:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">font2</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">font2</property> <property name="xalign">0</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> <property name="width">3</property> </packing> </child> <child> <object class="GtkBox" id="box2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="vexpand">True</property> <child> <object class="GtkScrolledWindow" id="checklbscroll"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="checklb"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="Macro Library List-selection2"/> </child> @@ -207,8 +251,8 @@ </child> </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> <property name="width">4</property> </packing> </child> @@ -216,8 +260,8 @@ <object class="GtkButton" id="apply"> <property name="visible">True</property> <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="valign">center</property> <property name="image">image1</property> <property name="always-show-image">True</property> @@ -228,16 +272,16 @@ </child> </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="GtkButton" id="delete"> <property name="visible">True</property> <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="valign">center</property> <property name="image">image2</property> <property name="always-show-image">True</property> @@ -248,22 +292,22 @@ </child> </object> <packing> - <property name="left_attach">3</property> - <property name="top_attach">1</property> + <property name="left-attach">3</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkComboBoxText" id="font2"> - <property name="sensitive">False</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="has_entry">True</property> + <property name="has-entry">True</property> <child internal-child="entry"> <object class="GtkEntry"> - <property name="can_focus">True</property> + <property name="can-focus">True</property> + <property name="activates-default">True</property> <property name="truncate-multiline">True</property> - <property name="activates_default">True</property> </object> </child> <child internal-child="accessible"> @@ -273,22 +317,22 @@ </child> </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="GtkComboBoxText" id="font1"> - <property name="sensitive">False</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="has_entry">True</property> + <property name="has-entry">True</property> <child internal-child="entry"> <object class="GtkEntry"> - <property name="can_focus">True</property> + <property name="can-focus">True</property> + <property name="activates-default">True</property> <property name="truncate-multiline">True</property> - <property name="activates_default">True</property> </object> </child> <child internal-child="accessible"> @@ -298,8 +342,8 @@ </child> </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 internal-child="accessible"> @@ -314,32 +358,12 @@ <property name="position">1</property> </packing> </child> - <child> - <object class="GtkCheckButton" id="usetable"> - <property name="label" translatable="yes" context="optfontspage|usetable">_Apply replacement table</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="usetable-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip | usetable">Enables the font replacement settings that you define.</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> </object> </child> <child type="label"> <object class="GtkLabel" id="label4"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="optfontspage|label4">Replacement Table</property> <attributes> <attribute name="weight" value="bold"/> @@ -356,54 +380,53 @@ <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> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=3 n-rows=3 --> <object class="GtkGrid" id="grid3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> - <property name="margin_top">6</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> <property name="margin-start">12</property> <property name="margin-top">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkLabel" id="label8"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes" context="optfontspage|label8">Fon_ts:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">fontname</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">fontname</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="label9"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes" context="optfontspage|label9">_Size:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">fontheight</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">fontheight</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left-attach">1</property> + <property name="top-attach">2</property> </packing> </child> <child> <object class="GtkComboBoxText" id="fontname"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <items> <item translatable="yes" context="optfontspage|fontname">Automatic</item> </items> @@ -414,18 +437,18 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">2</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkCheckButton" id="nonpropfontonly"> <property name="label" translatable="yes" context="optfontspage|nonpropfontonly">_Non-proportional fonts only</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="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="nonpropfontonly-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip | nonpropfontonly">Check to display only non-proportional fonts in the Fonts list box.</property> @@ -433,15 +456,15 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left-attach">2</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkComboBoxText" id="fontheight"> - <property name="width_request">100</property> + <property name="width-request">100</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <child internal-child="accessible"> <object class="AtkObject" id="fontheight-atkobject"> @@ -450,8 +473,47 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="left-attach">2</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locknonpropfontonly"> + <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">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockfontname"> + <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="GtkImage" id="lockfontheight"> + <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> </packing> </child> <child> @@ -462,7 +524,7 @@ <child type="label"> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="optfontspage|label1">Font Settings for HTML, Basic and SQL Sources</property> <attributes> <attribute name="weight" value="bold"/> |