Kaydet (Commit) e9be9ba8 authored tarafından Caolán McNamara's avatar Caolán McNamara

make the word count dialog the right size with disabled CJK word counting

we want to hide the CJK word count features unless CJK UI is enabled, or if
there are CJK chars in the word count. We want the dialog to fit to the best
size, so force the dialog to resize after it's visible (like a vclexpander)
if in non-CJK mode and some CJK chars appear in the document.

Change-Id: I328dcf2b111d5c5f527757ca11695ce4e9c43353
üst 9ac1f0aa
......@@ -76,6 +76,16 @@ void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat&
setValue(m_pDocCjkcharsFT, rDoc.nAsianWord);
bool bShowCJK = (SvtCJKOptions().IsAnyEnabled() || rDoc.nAsianWord);
bool bToggleCJK = m_pCurrentCjkcharsFT->IsVisible() != bShowCJK;
if (bToggleCJK)
{
showCJK(bShowCJK);
setInitialLayoutSize(); //force resize of dialog
}
}
void SwWordCountFloatDlg::showCJK(bool bShowCJK)
{
m_pCurrentCjkcharsFT->Show(bShowCJK);
m_pDocCjkcharsFT->Show(bShowCJK);
m_pCjkcharsLabelFT->Show(bShowCJK);
......@@ -112,6 +122,8 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
m_pDocCharacterExcludingSpacesFT->set_width_request(nPrefWidth);
m_pDocCjkcharsFT->set_width_request(nPrefWidth);
showCJK(SvtCJKOptions().IsAnyEnabled());
Initialize(pInfo);
m_pClosePB->SetClickHdl(LINK(this, SwWordCountFloatDlg, CloseHdl));
......
......@@ -38,7 +38,8 @@ struct SwDocStat;
class SwWordCountFloatDlg : public SfxModelessDialog
{
virtual void Activate();
void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc);
void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc);
void showCJK(bool bShowCJK);
FixedText* m_pCurrentWordFT;
FixedText* m_pCurrentCharacterFT;
......
......@@ -77,7 +77,7 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="row_spacing">2</property>
<property name="column_spacing">10</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
......@@ -130,7 +130,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -147,7 +147,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -164,7 +164,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -215,7 +215,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -232,7 +232,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -249,7 +249,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -259,13 +259,10 @@
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="cjkcharsft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Asian characters and Korean syllables</property>
......@@ -279,12 +276,12 @@
</child>
<child>
<object class="GtkLabel" id="selectcjkchars">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -296,12 +293,12 @@
</child>
<child>
<object class="GtkLabel" id="doccjkchars">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
<property name="label"> 0</property>
<property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -311,6 +308,9 @@
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment