icon-themes/colibre/sw/res/colbreak.png |binary icon-themes/colibre/sw/res/linebreak_full.png |binary icon-themes/colibre/sw/res/linebreak_left.png |binary icon-themes/colibre/sw/res/linebreak_none.png |binary icon-themes/colibre/sw/res/linebreak_right.png |binary icon-themes/colibre/sw/res/pagebreak.png |binary sw/inc/bitmaps.hlst | 7 sw/source/ui/chrdlg/break.cxx | 38 +++++ sw/source/uibase/inc/break.hxx | 3 sw/uiconfig/swriter/ui/insertbreak.ui | 187 +++++++++++++------------ 10 files changed, 146 insertions(+), 89 deletions(-)
New commits: commit 6cc1102abef4fa03d95923051f71b65da9b415f3 Author: Heiko Tietze <[email protected]> AuthorDate: Fri Sep 27 13:52:45 2024 +0200 Commit: Heiko Tietze <[email protected]> CommitDate: Thu Oct 24 10:04:17 2024 +0200 Resolves tdf148513 - Illustration for line break options Change-Id: I729c4a1e5c4b2a73cdb8d3a5c4969e3b43510deb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174038 Reviewed-by: Heiko Tietze <[email protected]> Tested-by: Jenkins diff --git a/icon-themes/colibre/sw/res/colbreak.png b/icon-themes/colibre/sw/res/colbreak.png new file mode 100644 index 000000000000..00e28e5e73f6 Binary files /dev/null and b/icon-themes/colibre/sw/res/colbreak.png differ diff --git a/icon-themes/colibre/sw/res/linebreak_full.png b/icon-themes/colibre/sw/res/linebreak_full.png new file mode 100644 index 000000000000..062da32d7838 Binary files /dev/null and b/icon-themes/colibre/sw/res/linebreak_full.png differ diff --git a/icon-themes/colibre/sw/res/linebreak_left.png b/icon-themes/colibre/sw/res/linebreak_left.png new file mode 100644 index 000000000000..80357bc3c926 Binary files /dev/null and b/icon-themes/colibre/sw/res/linebreak_left.png differ diff --git a/icon-themes/colibre/sw/res/linebreak_none.png b/icon-themes/colibre/sw/res/linebreak_none.png new file mode 100644 index 000000000000..813932dc67fb Binary files /dev/null and b/icon-themes/colibre/sw/res/linebreak_none.png differ diff --git a/icon-themes/colibre/sw/res/linebreak_right.png b/icon-themes/colibre/sw/res/linebreak_right.png new file mode 100644 index 000000000000..6f2bd317cd86 Binary files /dev/null and b/icon-themes/colibre/sw/res/linebreak_right.png differ diff --git a/icon-themes/colibre/sw/res/pagebreak.png b/icon-themes/colibre/sw/res/pagebreak.png new file mode 100644 index 000000000000..bff5c452f728 Binary files /dev/null and b/icon-themes/colibre/sw/res/pagebreak.png differ diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst index 5dacda42e987..45ef3a2805cd 100644 --- a/sw/inc/bitmaps.hlst +++ b/sw/inc/bitmaps.hlst @@ -120,4 +120,11 @@ inline constexpr OUString RID_BMP_QUERYINSMODE = u"res/queryinsmode.png"_ustr; inline constexpr OUString RID_SVXBMP_LOCKED = u"res/locked.png"_ustr; inline constexpr OUString RID_SVXBMP_UNLOCKED = u"res/unlocked.png"_ustr; +inline constexpr OUString RID_BMP_LINEBREAK_NONE = u"sw/res/linebreak_none.png"_ustr; +inline constexpr OUString RID_BMP_LINEBREAK_LEFT = u"sw/res/linebreak_left.png"_ustr; +inline constexpr OUString RID_BMP_LINEBREAK_RIGHT = u"sw/res/linebreak_right.png"_ustr; +inline constexpr OUString RID_BMP_LINEBREAK_FULL = u"sw/res/linebreak_full.png"_ustr; +inline constexpr OUString RID_BMP_COLBREAK = u"sw/res/colbreak.png"_ustr; +inline constexpr OUString RID_BMP_PAGEBREAK = u"sw/res/pagebreak.png"_ustr; + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index e980467eb0a5..e767456266e1 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -19,6 +19,7 @@ #include <vcl/svapp.hxx> #include <osl/diagnose.h> +#include <bitmaps.hlst> #include <uitool.hxx> #include <swtypes.hxx> @@ -61,6 +62,7 @@ void SwBreakDlg::rememberResult() IMPL_LINK_NOARG(SwBreakDlg, ToggleHdl, weld::Toggleable&, void) { CheckEnable(); + UpdateImage(); } IMPL_LINK_NOARG(SwBreakDlg, ChangeHdl, weld::ComboBox&, void) @@ -68,6 +70,11 @@ IMPL_LINK_NOARG(SwBreakDlg, ChangeHdl, weld::ComboBox&, void) CheckEnable(); } +IMPL_LINK_NOARG(SwBreakDlg, LineClearHdl, weld::ComboBox&, void) +{ + UpdateImage(); +} + // Handler for Change Page Number IMPL_LINK(SwBreakDlg, PageNumHdl, weld::Toggleable&, rBox, void) { @@ -137,6 +144,7 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) , m_xPageNumBox(m_xBuilder->weld_check_button(u"pagenumcb"_ustr)) , m_xPageNumEdit(m_xBuilder->weld_spin_button(u"pagenumsb"_ustr)) , m_xOkBtn(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xTypeImage(m_xBuilder->weld_image(u"imType"_ustr)) , m_rSh(rS) , m_nKind(0) , m_bHtmlMode(0 != ::GetHtmlMode(rS.GetView().GetDocShell())) @@ -146,6 +154,7 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) m_xLineBtn->connect_toggled(aLk); m_xColumnBtn->connect_toggled(aLk); m_xPageCollBox->connect_changed(LINK(this, SwBreakDlg, ChangeHdl)); + m_xLineClearBox->connect_changed(LINK(this, SwBreakDlg, LineClearHdl)); m_xOkBtn->connect_clicked(LINK(this, SwBreakDlg, OkHdl)); m_xPageNumBox->connect_toggled(LINK(this, SwBreakDlg, PageNumHdl)); @@ -172,6 +181,7 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) ::InsertStringSorted(u""_ustr, aFormatName, *m_xPageCollBox, 1); CheckEnable(); m_xPageNumEdit->set_text(OUString()); + UpdateImage(); } void SwBreakDlg::CheckEnable() @@ -210,4 +220,32 @@ void SwBreakDlg::CheckEnable() m_xPageNumEdit->set_sensitive(bEnable); } +void SwBreakDlg::UpdateImage() +{ + if (m_xLineBtn->get_active()) + { + switch (m_xLineClearBox->get_active()) + { + case 0: + m_xTypeImage->set_from_icon_name(RID_BMP_LINEBREAK_NONE); + break; + case 1: + m_xTypeImage->set_from_icon_name(RID_BMP_LINEBREAK_LEFT); + break; + case 2: + m_xTypeImage->set_from_icon_name(RID_BMP_LINEBREAK_RIGHT); + break; + case 3: + m_xTypeImage->set_from_icon_name(RID_BMP_LINEBREAK_FULL); + break; + } + } + else if (m_xColumnBtn->get_active()) + m_xTypeImage->set_from_icon_name(RID_BMP_COLBREAK); + else if (m_xPageBtn->get_active()) + m_xTypeImage->set_from_icon_name(RID_BMP_PAGEBREAK); + else + m_xTypeImage->set_from_icon_name(""); //clear +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 260229302ed2..62beafb18422 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -37,6 +37,7 @@ class SwBreakDlg final : public weld::GenericDialogController std::unique_ptr<weld::CheckButton> m_xPageNumBox; std::unique_ptr<weld::SpinButton> m_xPageNumEdit; std::unique_ptr<weld::Button> m_xOkBtn; + std::unique_ptr<weld::Image> m_xTypeImage; SwWrtShell& m_rSh; OUString m_aTemplate; @@ -48,11 +49,13 @@ class SwBreakDlg final : public weld::GenericDialogController DECL_LINK(ToggleHdl, weld::Toggleable&, void); DECL_LINK(ChangeHdl, weld::ComboBox&, void); + DECL_LINK(LineClearHdl, weld::ComboBox&, void); DECL_LINK(PageNumHdl, weld::Toggleable&, void); DECL_LINK(PageNumModifyHdl, weld::SpinButton&, void); DECL_LINK(OkHdl, weld::Button&, void); void CheckEnable(); + void UpdateImage(); void rememberResult(); public: diff --git a/sw/uiconfig/swriter/ui/insertbreak.ui b/sw/uiconfig/swriter/ui/insertbreak.ui index b52655b369f4..c180afd0d9e1 100644 --- a/sw/uiconfig/swriter/ui/insertbreak.ui +++ b/sw/uiconfig/swriter/ui/insertbreak.ui @@ -1,39 +1,39 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.40.0 --> <interface domain="sw"> <requires lib="gtk+" version="3.20"/> <object class="GtkAdjustment" id="adjustment1"> <property name="upper">55535</property> <property name="value">1</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> + <property name="step-increment">1</property> + <property name="page-increment">10</property> </object> <object class="GtkDialog" id="BreakDialog"> - <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="title" translatable="yes" context="insertbreak|BreakDialog">Insert Break</property> <property name="resizable">False</property> <property name="modal">True</property> - <property name="default_width">0</property> - <property name="default_height">0</property> - <property name="type_hint">dialog</property> + <property name="default-width">0</property> + <property name="default-height">0</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="stock">_OK</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -46,8 +46,8 @@ <object class="GtkButton" id="cancel"> <property name="label" translatable="yes" context="stock">_Cancel</property> <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="use-underline">True</property> </object> <packing> @@ -60,8 +60,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <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="use-underline">True</property> </object> <packing> @@ -75,32 +75,34 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </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> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <object class="GtkBox" id="box1"> + <!-- n-columns=2 n-rows=9 --> + <object class="GtkGrid" id="grid1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">6</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="column-spacing">12</property> <child> <object class="GtkRadioButton" id="linerb"> <property name="label" translatable="yes" context="insertbreak|linerb">Line break</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> <property name="group">pagerb</property> <child internal-child="accessible"> <object class="AtkObject" id="linerb-atkobject"> @@ -109,54 +111,51 @@ </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="clearft"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_top">6</property> + <property name="can-focus">False</property> + <property name="margin-top">6</property> <property name="label" translatable="yes" context="insertbreak|clearft">Restart Location:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">clearlb</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">clearlb</property> <property name="xalign">0</property> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkComboBoxText" id="clearlb"> <property name="visible">True</property> <property name="sensitive">False</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="active">0</property> <items> - <item id="0" translatable="yes" context="insertbreak|clearlb0">[None]</item> + <item id="0" translatable="yes" context="insertbreak|clearlb0">Next Line</item> <item id="1" translatable="yes" context="insertbreak|clearlb1">Left</item> <item id="2" translatable="yes" context="insertbreak|clearlb2">Right</item> <item id="3" translatable="yes" context="insertbreak|clearlb3">Next Full Line</item> </items> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> + <property name="left-attach">0</property> + <property name="top-attach">2</property> </packing> </child> <child> <object class="GtkRadioButton" id="columnrb"> <property name="label" translatable="yes" context="insertbreak|columnrb">Column break</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> <property name="group">pagerb</property> <child internal-child="accessible"> <object class="AtkObject" id="columnrb-atkobject"> @@ -165,20 +164,19 @@ </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> + <property name="left-attach">0</property> + <property name="top-attach">3</property> </packing> </child> <child> <object class="GtkRadioButton" id="pagerb"> <property name="label" translatable="yes" context="insertbreak|pagerb">Page break</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="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="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="pagerb-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="insertbreak|pagerb-atkobject">Inserts a manual page break, and moves the text found to the right of the cursor to the beginning of the next page. The inserted page break is indicated by a nonprinting border at the top of the new page.</property> @@ -186,31 +184,30 @@ </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> + <property name="left-attach">0</property> + <property name="top-attach">4</property> </packing> </child> <child> <object class="GtkLabel" id="styleft"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_top">6</property> + <property name="can-focus">False</property> + <property name="margin-top">6</property> <property name="label" translatable="yes" context="insertbreak|styleft">Page Style:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">stylelb</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">stylelb</property> <property name="xalign">0</property> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> + <property name="left-attach">0</property> + <property name="top-attach">5</property> + <property name="width">2</property> </packing> </child> <child> <object class="GtkComboBoxText" id="stylelb"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="active">0</property> <items> <item translatable="yes" context="insertbreak|liststore1">[None]</item> @@ -222,20 +219,20 @@ </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">6</property> + <property name="left-attach">0</property> + <property name="top-attach">6</property> + <property name="width">2</property> </packing> </child> <child> <object class="GtkCheckButton" id="pagenumcb"> <property name="label" translatable="yes" context="insertbreak|pagenumcb">Change page number</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="margin_top">6</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="margin-top">6</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="pagenumcb-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="insertbreak|pagenumcb-atkobject">Assigns the page number that you specify to the page that follows the manual page break. This option is only available if you assign a different page style to the page that follows manual page break.</property> @@ -243,22 +240,22 @@ </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">7</property> + <property name="left-attach">0</property> + <property name="top-attach">7</property> + <property name="width">2</property> </packing> </child> <child> <object class="GtkSpinButton" id="pagenumsb"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="halign">start</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> + <property name="truncate-multiline">True</property> <property name="adjustment">adjustment1</property> <accessibility> <relation type="labelled-by" target="pagenumcb"/> </accessibility> - <property name="truncate-multiline">True</property> <child internal-child="accessible"> <object class="AtkObject" id="pagenumsb-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="insertbreak|pagenumsb-atkobject">Enter the new page number for the page that follows the manual page break.</property> @@ -266,9 +263,24 @@ </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">8</property> + <property name="left-attach">0</property> + <property name="top-attach">8</property> + <property name="width">2</property> + </packing> + </child> + <child> + <object class="GtkImage" id="imType"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="halign">center</property> + <property name="valign">start</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + <property name="height">5</property> </packing> </child> </object> @@ -276,7 +288,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="insertbreak|label1">Type</property> <attributes> <attribute name="weight" value="bold"/> @@ -296,9 +308,6 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> - <child type="titlebar"> - <placeholder/> - </child> <child internal-child="accessible"> <object class="AtkObject" id="BreakDialog-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="insertbreak|extended_tip|BreakDialog">Inserts a manual line break, column break or a page break at the current cursor position.</property>
