diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2019-12-10 15:50:36 +0100 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2019-12-11 10:08:46 +0100 |
commit | c1a0911b99b6c2a4e260c86eab1aa1ee1e173c0a (patch) | |
tree | 1595286b7745b17a7491a0782515e88a90f178bd /sw | |
parent | 36c931eaebdeff85e579c2b233174f34455c4c07 (diff) |
Direct cursor fillmode as combobox
UI only update of many radio buttons into one
combo box to comply with HIG
Change-Id: If96ee339159def4c3dfa5d3b2f9adb218d1faee3
Reviewed-on: https://gerrit.libreoffice.org/84864
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 38 | ||||
-rw-r--r-- | sw/source/uibase/inc/optpage.hxx | 7 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/optformataidspage.ui | 132 |
3 files changed, 39 insertions, 138 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index ebc5ed7ae9de..800fbb887fc4 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1208,11 +1208,7 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w , m_xCharHiddenCB(m_xBuilder->weld_check_button("hiddentext")) , m_xDirectCursorFrame(m_xBuilder->weld_frame("directcrsrframe")) , m_xOnOffCB(m_xBuilder->weld_check_button("cursoronoff")) - , m_xFillMarginRB(m_xBuilder->weld_radio_button("fillmargin")) - , m_xFillIndentRB(m_xBuilder->weld_radio_button("fillindent")) - , m_xFillTabRB(m_xBuilder->weld_radio_button("filltab")) - , m_xFillTabAndSpaceRB(m_xBuilder->weld_radio_button("filltabandspace")) - , m_xFillSpaceRB(m_xBuilder->weld_radio_button("fillspace")) + , m_xDirectCursorFillMode(m_xBuilder->weld_combo_box("cxDirectCursorFillMode")) , m_xCursorProtFrame(m_xBuilder->weld_frame("crsrprotframe")) , m_xCursorInProtCB(m_xBuilder->weld_check_button("cursorinprot")) , m_xMathBaselineAlignmentCB(m_xBuilder->weld_check_button("mathbaseline")) @@ -1229,12 +1225,7 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w } m_xOnOffCB->set_active( bIsOn ); - m_xFillIndentRB->set_active( FILL_INDENT == eMode ); - m_xFillMarginRB->set_active( FILL_MARGIN == eMode ); - m_xFillTabRB->set_active( FILL_TAB == eMode ); - m_xFillSpaceRB->set_active( FILL_SPACE == eMode ); - m_xFillTabAndSpaceRB->set_active( FILL_TAB_SPACE == eMode ); - + m_xDirectCursorFillMode->set_active( eMode ); if(SfxItemState::SET != rSet.GetItemState(SID_HTML_MODE, false, &pItem ) || !(static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)) return; @@ -1244,12 +1235,7 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w m_xDirectCursorFrame->hide(); m_xOnOffCB->hide(); - m_xFillMarginRB->hide(); - m_xFillIndentRB->hide(); - m_xFillTabRB->hide(); - m_xFillSpaceRB->hide(); - m_xFillTabAndSpaceRB->hide(); - + m_xDirectCursorFillMode->hide(); m_xCursorProtFrame->hide(); m_xCursorInProtCB->hide(); } @@ -1276,16 +1262,7 @@ bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet ) aOpt.SetOn( m_xOnOffCB->get_active() ); sal_uInt8 eMode; - if( m_xFillIndentRB->get_active() ) - eMode= FILL_INDENT; - else if( m_xFillMarginRB->get_active() ) - eMode = FILL_MARGIN; - else if( m_xFillTabRB->get_active() ) - eMode = FILL_TAB; - else if ( m_xFillTabAndSpaceRB->get_active() ) - eMode = FILL_TAB_SPACE; - else - eMode = FILL_SPACE; + eMode = m_xDirectCursorFillMode->get_active(); aOpt.SetMode( eMode ); bool bRet = false; @@ -1343,12 +1320,7 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet ) } m_xOnOffCB->set_active( bIsOn ); - m_xFillIndentRB->set_active( FILL_INDENT == eMode ); - m_xFillMarginRB->set_active( FILL_MARGIN == eMode ); - m_xFillTabRB->set_active( FILL_TAB == eMode ); - m_xFillSpaceRB->set_active( FILL_SPACE == eMode ); - m_xFillTabAndSpaceRB->set_active( FILL_TAB_SPACE == eMode ); - + m_xDirectCursorFillMode->set_active( eMode ); if (m_pWrtShell) { m_xMathBaselineAlignmentCB->set_active( m_pWrtShell->GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) ); m_xMathBaselineAlignmentCB->save_state(); diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 13c5d6194aef..0fb643768eeb 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -232,12 +232,7 @@ class SwShdwCursorOptionsTabPage : public SfxTabPage std::unique_ptr<weld::Frame> m_xDirectCursorFrame; std::unique_ptr<weld::CheckButton> m_xOnOffCB; - std::unique_ptr<weld::RadioButton> m_xFillMarginRB; - std::unique_ptr<weld::RadioButton> m_xFillIndentRB; - std::unique_ptr<weld::RadioButton> m_xFillTabRB; - std::unique_ptr<weld::RadioButton> m_xFillTabAndSpaceRB; - std::unique_ptr<weld::RadioButton> m_xFillSpaceRB; - + std::unique_ptr<weld::ComboBox> m_xDirectCursorFillMode; std::unique_ptr<weld::Frame> m_xCursorProtFrame; std::unique_ptr<weld::CheckButton> m_xCursorInProtCB; diff --git a/sw/uiconfig/swriter/ui/optformataidspage.ui b/sw/uiconfig/swriter/ui/optformataidspage.ui index 209de810ac5b..d150bf5d68d4 100644 --- a/sw/uiconfig/swriter/ui/optformataidspage.ui +++ b/sw/uiconfig/swriter/ui/optformataidspage.ui @@ -324,115 +324,49 @@ </packing> </child> <child> - <object class="GtkLabel" id="fillmode"> + <object class="GtkBox" id="bxFillMode"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes" context="optformataidspage|fillmode">Insert</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> + <property name="margin_left">18</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="fillmode"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="optformataidspage|fillmode">Insert:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">cxDirectCursorFillMode</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> <child> - <object class="GtkGrid" id="grid4"> + <object class="GtkComboBoxText" id="cxDirectCursorFillMode"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkRadioButton" id="fillmargin"> - <property name="label" translatable="yes" context="optformataidspage|fillmargin">Para_graph alignment</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="xalign">0</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="fillindent"> - <property name="label" translatable="yes" context="optformataidspage|fillindent">_Left paragraph margin</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="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">fillmargin</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="filltab"> - <property name="label" translatable="yes" context="optformataidspage|filltab">_Tabs</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="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">fillmargin</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="filltabandspace"> - <property name="label" translatable="yes" context="optformataidspage|filltabandspace">Tabs a_nd spaces</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="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">fillmargin</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="fillspace"> - <property name="label" translatable="yes" context="optformataidspage|fillspace">_Spaces</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="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">fillmargin</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - </packing> - </child> + <property name="active_id">2</property> + <items> + <item id="0" translatable="yes" context="optformataidspage|filltab">Tabs</item> + <item id="1" translatable="yes" context="optformataidspage|filltabandspace">Tabs and spaces</item> + <item id="2" translatable="yes" context="optformataidspage|fillspace">Spaces</item> + <item id="3" translatable="yes" context="optformataidspage|fillindent">Left paragraph margin</item> + <item id="4" translatable="yes" context="optformataidspage|fillmargin">Paragraph alignment</item> + </items> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">1</property> </packing> </child> </object> |