[Libreoffice-commits] core.git: sw/source sw/uiconfig
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Mar 14 08:59:57 UTC 2019
sw/source/ui/fldui/fldvar.cxx | 24 +-
sw/source/ui/fldui/fldvar.hxx | 7
sw/uiconfig/swriter/ui/fldvarpage.ui | 316 +++++++++++++----------------------
3 files changed, 138 insertions(+), 209 deletions(-)
New commits:
commit 0a9094007cb9ad3e37866730c8a66c3ed92eeeb9
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Mar 13 17:36:44 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Mar 14 09:59:27 2019 +0100
Resolves: tdf#90863 replace toolbar with apply/remove buttons
which is consistent with the calc format->cells->numbering page
and solves the keyboard traversal problem here
Change-Id: I90c0f4a380693af871bbd20912eafcf5ea259fc7
Reviewed-on: https://gerrit.libreoffice.org/69229
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index d156a13204cf..ce303e37dab6 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -64,7 +64,8 @@ SwFieldVarPage::SwFieldVarPage(vcl::Window* pParent, const SfxItemSet *const pCo
get(m_pInvisibleCB, "invisible");
get(m_pSeparatorFT, "separatorft");
get(m_pSeparatorED, "separator");
- get(m_pNewDelTBX, "toolbar");
+ get(m_pNewPB, "apply");
+ get(m_pDelPB, "delete");
long nHeight = m_pTypeLB->GetTextHeight() * 20;
m_pTypeLB->set_height_request(nHeight);
@@ -76,9 +77,6 @@ SwFieldVarPage::SwFieldVarPage(vcl::Window* pParent, const SfxItemSet *const pCo
m_pSelectionLB->set_width_request(nWidth);
m_pFormatLB->set_width_request(nWidth);
- m_nApplyId = m_pNewDelTBX->GetItemId("apply");
- m_nDeleteId = m_pNewDelTBX->GetItemId("delete");
-
sOldValueFT = m_pValueFT->GetText();
sOldNameFT = m_pNameFT->GetText();
@@ -112,7 +110,8 @@ void SwFieldVarPage::dispose()
m_pInvisibleCB.clear();
m_pSeparatorFT.clear();
m_pSeparatorED.clear();
- m_pNewDelTBX.clear();
+ m_pNewPB.clear();
+ m_pDelPB.clear();
SwFieldPage::dispose();
}
@@ -172,7 +171,8 @@ void SwFieldVarPage::Reset(const SfxItemSet* )
m_pNumFormatLB->SetDoubleClickHdl (LINK(this, SwFieldVarPage, ListBoxInsertHdl));
m_pNameED->SetModifyHdl (LINK(this, SwFieldVarPage, ModifyHdl));
m_pValueED->SetModifyHdl (LINK(this, SwFieldVarPage, ModifyHdl));
- m_pNewDelTBX->SetClickHdl (LINK(this, SwFieldVarPage, TBClickHdl));
+ m_pNewPB->SetClickHdl (LINK(this, SwFieldVarPage, TBClickHdl));
+ m_pDelPB->SetClickHdl (LINK(this, SwFieldVarPage, TBClickHdl));
m_pChapterLevelLB->SetSelectHdl (LINK(this, SwFieldVarPage, ChapterHdl));
m_pSeparatorED->SetModifyHdl (LINK(this, SwFieldVarPage, SeparatorHdl));
@@ -952,18 +952,16 @@ IMPL_LINK_NOARG(SwFieldVarPage, ModifyHdl, Edit&, void)
break;
}
- m_pNewDelTBX->EnableItem(m_nApplyId, bApply);
- m_pNewDelTBX->EnableItem(m_nDeleteId, bDelete);
+ m_pNewPB->Enable(bApply);
+ m_pDelPB->Enable(bDelete);
EnableInsert(bInsert);
}
-IMPL_LINK( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void )
+IMPL_LINK( SwFieldVarPage, TBClickHdl, Button*, pBox, void )
{
const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
- const sal_uInt16 nCurId = pBox->GetCurItemId();
-
- if (nCurId == m_nDeleteId)
+ if (pBox == m_pDelPB)
{
if( nTypeId == TYP_USERFLD )
GetFieldMgr().RemoveFieldType(SwFieldIds::User, m_pSelectionLB->GetSelectedEntry());
@@ -994,7 +992,7 @@ IMPL_LINK( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void )
pSh->SetModified();
}
}
- else if (nCurId == m_nApplyId)
+ else if (pBox == m_pNewPB)
{
OUString sName(m_pNameED->GetText()), sValue(m_pValueED->GetText());
SwFieldType* pType = nullptr;
diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx
index 1ed556b1fcc2..b7afe73f0497 100644
--- a/sw/source/ui/fldui/fldvar.hxx
+++ b/sw/source/ui/fldui/fldvar.hxx
@@ -65,9 +65,8 @@ class SwFieldVarPage : public SwFieldPage
VclPtr<CheckBox> m_pInvisibleCB;
VclPtr<FixedText> m_pSeparatorFT;
VclPtr<Edit> m_pSeparatorED;
- VclPtr<ToolBox> m_pNewDelTBX;
- sal_uInt16 m_nApplyId;
- sal_uInt16 m_nDeleteId;
+ VclPtr<PushButton> m_pNewPB;
+ VclPtr<PushButton> m_pDelPB;
OUString sOldValueFT;
OUString sOldNameFT;
@@ -78,7 +77,7 @@ class SwFieldVarPage : public SwFieldPage
DECL_LINK( TypeHdl, ListBox&, void );
DECL_LINK( SubTypeListBoxHdl, ListBox&, void );
DECL_LINK( ModifyHdl, Edit&, void );
- DECL_LINK( TBClickHdl, ToolBox *, void );
+ DECL_LINK( TBClickHdl, Button*, void );
DECL_LINK( ChapterHdl, ListBox&, void );
DECL_LINK( SeparatorHdl, Edit&, void );
void SubTypeHdl(ListBox const *);
diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui b/sw/uiconfig/swriter/ui/fldvarpage.ui
index 8ce32e327494..d7cb812f609c 100644
--- a/sw/uiconfig/swriter/ui/fldvarpage.ui
+++ b/sw/uiconfig/swriter/ui/fldvarpage.ui
@@ -1,17 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
- <object class="GtkBox" id="FieldVarPage">
+ <object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="icon_name">svx/res/nu02.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/nu01.png</property>
+ </object>
+ <object class="GtkTreeStore" id="liststore1">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkGrid" id="FieldVarPage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="border_width">6</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
+ <property name="column_homogeneous">True</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
@@ -49,9 +69,9 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="fldvarpage|label1">_Type</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -64,59 +84,17 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkGrid" id="grid2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">end</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkLabel" id="nameft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="fldvarpage|nameft">Na_me</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="valign">center</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </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="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
@@ -149,9 +127,9 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="fldvarpage|label2">S_elect</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -164,59 +142,17 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkGrid" id="grid3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">end</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkLabel" id="valueft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="fldvarpage|valueft">_Value</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="swlo-ConditionEdit" id="value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="valign">center</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
@@ -291,9 +227,9 @@
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="fldvarpage|label3">F_ormat</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -346,39 +282,33 @@
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="fldvarpage|label5">_Level</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="separatorft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="fldvarpage|separatorft">_Separator</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">separator</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="level">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="entry_text_column">0</property>
- <property name="id_column">1</property>
<items>
<item translatable="yes" context="fldvarpage|level">None</item>
</items>
@@ -386,8 +316,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -401,8 +329,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -413,9 +339,9 @@
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="fldvarpage|label4">Numbering by Chapter</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -435,114 +361,120 @@
<property name="position">0</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="nameft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="fldvarpage|nameft">Na_me</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
<child>
- <object class="GtkGrid" id="grid4">
+ <object class="GtkLabel" id="valueft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="valign">end</property>
- <property name="row_spacing">6</property>
+ <property name="label" translatable="yes" context="fldvarpage|valueft">_Value</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">value</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="swlo-ConditionEdit" id="value">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="toolbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="column_spacing">6</property>
<child>
- <object class="GtkToolbar" id="toolbar">
+ <object class="GtkButton" id="apply">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text" translatable="yes" context="fldvarpage|apply|tooltip_text">Apply</property>
<property name="valign">center</property>
- <property name="toolbar_style">icons</property>
- <child>
- <object class="GtkToolButton" id="apply">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_text" translatable="yes" context="fldvarpage|apply|tooltip_text">Apply</property>
- <property name="action_name">apply</property>
- <property name="use_underline">True</property>
- <property name="icon_name">svx/res/nu01.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="delete">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_text" translatable="yes" context="fldvarpage|delete|tooltip_text">Delete</property>
- <property name="action_name">delete</property>
- <property name="use_underline">True</property>
- <property name="icon_name">svx/res/nu02.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
+ <property name="image">image2</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid5">
+ <object class="GtkButton" id="delete">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text" translatable="yes" context="fldvarpage|delete|tooltip_text">Delete</property>
+ <property name="valign">center</property>
+ <property name="image">image1</property>
</object>
<packing>
- <property name="left_attach">0</property>
+ <property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
</packing>
</child>
</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">1</property>
+ <property name="width">3</property>
</packing>
</child>
</object>
- <object class="GtkTreeStore" id="liststore1">
- <columns>
- <!-- column-name gchararray1 -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkSizeGroup" id="sizegroup1">
- <property name="mode">both</property>
- <property name="ignore_hidden">True</property>
- <widgets>
- <widget name="type:border"/>
- <widget name="select:border"/>
- </widgets>
- </object>
- <object class="GtkSizeGroup" id="sizegroup2">
- <property name="mode">vertical</property>
- <widgets>
- <widget name="grid2"/>
- <widget name="grid3"/>
- <widget name="grid4"/>
- </widgets>
- </object>
- <object class="GtkSizeGroup" id="sizegroup3">
- <property name="mode">vertical</property>
- <widgets>
- <widget name="nameft"/>
- <widget name="valueft"/>
- <widget name="grid5"/>
- </widgets>
- </object>
</interface>
More information about the Libreoffice-commits
mailing list