summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-02-20 11:24:05 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-02-23 22:05:01 +0100
commit4ab0993f2537fade3c02b788508519070f44ebb8 (patch)
tree17df9066820458d2438425ee2f01d8c7025cf041 /sw
parent17f49b0cddaac5657a9c308328215a0eb3a87442 (diff)
WordCountDIalog in vertical mobile version
Change-Id: I335bee6fd03c202cb7e82b3205a92b48f5e861a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89204 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx41
-rw-r--r--sw/source/uibase/inc/wordcountdialog.hxx8
-rw-r--r--sw/uiconfig/swriter/ui/wordcount.ui184
3 files changed, 216 insertions, 17 deletions
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index 7dc7370f4b82..5e4b3aa0208d 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -28,6 +28,10 @@
#include <unotools/localedatawrapper.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
+
+#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
SwWordCountFloatDlg::~SwWordCountFloatDlg()
{
@@ -83,6 +87,8 @@ void SwWordCountFloatDlg::showCJK(bool bShowCJK)
m_xCurrentCjkcharsFT->set_visible(bShowCJK);
m_xDocCjkcharsFT->set_visible(bShowCJK);
m_xCjkcharsLabelFT->set_visible(bShowCJK);
+ if (m_xCjkcharsLabel2FT.get())
+ m_xCjkcharsLabel2FT->set_visible(bShowCJK);
}
void SwWordCountFloatDlg::showStandardizedPages(bool bShowStandardizedPages)
@@ -90,6 +96,8 @@ void SwWordCountFloatDlg::showStandardizedPages(bool bShowStandardizedPages)
m_xCurrentStandardizedPagesFT->set_visible(bShowStandardizedPages);
m_xDocStandardizedPagesFT->set_visible(bShowStandardizedPages);
m_xStandardizedPagesLabelFT->set_visible(bShowStandardizedPages);
+ if (m_xStandardizedPagesLabel2FT.get())
+ m_xStandardizedPagesLabel2FT->set_visible(bShowStandardizedPages);
}
SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
@@ -97,19 +105,42 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
weld::Window *pParent,
SfxChildWinInfo const * pInfo)
: SfxModelessDialogController(_pBindings, pChild, pParent, "modules/swriter/ui/wordcount.ui", "WordCountDialog")
+ , m_xCloseButton(m_xBuilder->weld_button("close"))
+ , m_xHelpButton(m_xBuilder->weld_button("help"))
+ , m_xDocumentLabelFT(m_xBuilder->weld_label(IS_MOBILE ? "documentlabel-mobile" : "documentlabel"))
+ , m_xWordsLabelFT(m_xBuilder->weld_label(IS_MOBILE ? "wordslabel-mobile" : "wordslabel"))
+ , m_xIncludingSpacesLabelFT(m_xBuilder->weld_label(IS_MOBILE ? "inclspaceslabel-mobile" : "inclspaceslabel"))
+ , m_xExcludingSpacesLabelFT(m_xBuilder->weld_label(IS_MOBILE ? "exclspaceslabel-mobile" : "exclspaceslabel"))
, m_xCurrentWordFT(m_xBuilder->weld_label("selectwords"))
, m_xCurrentCharacterFT(m_xBuilder->weld_label("selectchars"))
, m_xCurrentCharacterExcludingSpacesFT(m_xBuilder->weld_label("selectcharsnospaces"))
, m_xCurrentCjkcharsFT(m_xBuilder->weld_label("selectcjkchars"))
, m_xCurrentStandardizedPagesFT(m_xBuilder->weld_label("selectstandardizedpages"))
- , m_xDocWordFT(m_xBuilder->weld_label("docwords"))
- , m_xDocCharacterFT(m_xBuilder->weld_label("docchars"))
- , m_xDocCharacterExcludingSpacesFT(m_xBuilder->weld_label("doccharsnospaces"))
- , m_xDocCjkcharsFT(m_xBuilder->weld_label("doccjkchars"))
- , m_xDocStandardizedPagesFT(m_xBuilder->weld_label("docstandardizedpages"))
+ , m_xDocWordFT(m_xBuilder->weld_label(IS_MOBILE ? "docwords-mobile" : "docwords"))
+ , m_xDocCharacterFT(m_xBuilder->weld_label(IS_MOBILE ? "docchars-mobile" : "docchars"))
+ , m_xDocCharacterExcludingSpacesFT(m_xBuilder->weld_label(IS_MOBILE ? "doccharsnospaces-mobile" : "doccharsnospaces"))
+ , m_xDocCjkcharsFT(m_xBuilder->weld_label(IS_MOBILE ? "doccjkchars-mobile" : "doccjkchars"))
+ , m_xDocStandardizedPagesFT(m_xBuilder->weld_label(IS_MOBILE ? "docstandardizedpages-mobile" : "docstandardizedpages"))
, m_xCjkcharsLabelFT(m_xBuilder->weld_label("cjkcharsft"))
+ , m_xCjkcharsLabel2FT(IS_MOBILE ? m_xBuilder->weld_label("cjkcharsft2") : nullptr)
, m_xStandardizedPagesLabelFT(m_xBuilder->weld_label("standardizedpages"))
+ , m_xStandardizedPagesLabel2FT(IS_MOBILE ? m_xBuilder->weld_label("standardizedpages2") : nullptr)
{
+ if (IS_MOBILE)
+ {
+ m_xCloseButton->set_visible(false);
+ m_xHelpButton->set_visible(false);
+ }
+
+ m_xDocumentLabelFT->show();
+ m_xDocWordFT->show();
+ m_xDocCharacterFT->show();
+ m_xDocCharacterExcludingSpacesFT->show();
+
+ m_xWordsLabelFT->show();
+ m_xIncludingSpacesLabelFT->show();
+ m_xExcludingSpacesLabelFT->show();
+
showCJK(SvtCJKOptions().IsAnyEnabled());
showStandardizedPages(officecfg::Office::Writer::WordCount::ShowStandardizedPageCount::get());
diff --git a/sw/source/uibase/inc/wordcountdialog.hxx b/sw/source/uibase/inc/wordcountdialog.hxx
index 5a8ae3d522d2..76abfd8cf55c 100644
--- a/sw/source/uibase/inc/wordcountdialog.hxx
+++ b/sw/source/uibase/inc/wordcountdialog.hxx
@@ -29,6 +29,12 @@ class SwWordCountFloatDlg : public SfxModelessDialogController
void showCJK(bool bShowCJK);
void showStandardizedPages(bool bShowStandardizedPages);
+ std::unique_ptr<weld::Button> m_xCloseButton;
+ std::unique_ptr<weld::Button> m_xHelpButton;
+ std::unique_ptr<weld::Label> m_xDocumentLabelFT;
+ std::unique_ptr<weld::Label> m_xWordsLabelFT;
+ std::unique_ptr<weld::Label> m_xIncludingSpacesLabelFT;
+ std::unique_ptr<weld::Label> m_xExcludingSpacesLabelFT;
std::unique_ptr<weld::Label> m_xCurrentWordFT;
std::unique_ptr<weld::Label> m_xCurrentCharacterFT;
std::unique_ptr<weld::Label> m_xCurrentCharacterExcludingSpacesFT;
@@ -40,7 +46,9 @@ class SwWordCountFloatDlg : public SfxModelessDialogController
std::unique_ptr<weld::Label> m_xDocCjkcharsFT;
std::unique_ptr<weld::Label> m_xDocStandardizedPagesFT;
std::unique_ptr<weld::Label> m_xCjkcharsLabelFT;
+ std::unique_ptr<weld::Label> m_xCjkcharsLabel2FT;
std::unique_ptr<weld::Label> m_xStandardizedPagesLabelFT;
+ std::unique_ptr<weld::Label> m_xStandardizedPagesLabel2FT;
public:
SwWordCountFloatDlg(SfxBindings* pBindings,
diff --git a/sw/uiconfig/swriter/ui/wordcount.ui b/sw/uiconfig/swriter/ui/wordcount.ui
index 6da9a2c96b8e..c9d4a82bf46d 100644
--- a/sw/uiconfig/swriter/ui/wordcount.ui
+++ b/sw/uiconfig/swriter/ui/wordcount.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="WordCountDialog">
@@ -10,9 +10,6 @@
<property name="default_height">0</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -72,7 +69,7 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="wordslabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="wordcount|label1">Words</property>
@@ -84,7 +81,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="inclspaceslabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="wordcount|label2">Characters including spaces</property>
@@ -96,7 +93,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label3">
+ <object class="GtkLabel" id="exclspaceslabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="wordcount|label3">Characters excluding spaces</property>
@@ -168,8 +165,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label10">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="documentlabel">
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="wordcount|label10">Document</property>
@@ -184,7 +180,6 @@
</child>
<child>
<object class="GtkLabel" id="docwords">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
@@ -199,7 +194,6 @@
</child>
<child>
<object class="GtkLabel" id="docchars">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
@@ -214,7 +208,6 @@
</child>
<child>
<object class="GtkLabel" id="doccharsnospaces">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
@@ -312,6 +305,170 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="wordslabel-mobile">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="wordcount|label1">Words</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="inclspaceslabel-mobile">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="wordcount|label2">Characters including spaces</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="exclspaceslabel-mobile">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="wordcount|label3">Characters excluding spaces</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cjkcharsft2">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="wordcount|cjkcharsft">Asian characters and Korean syllables</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="standardizedpages2">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="wordcount|standardizedpages">Standardized pages</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="docwords-mobile">
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="label"> 0</property>
+ <property name="justify">right</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="docchars-mobile">
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="label"> 0</property>
+ <property name="justify">right</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="doccharsnospaces-mobile">
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="label"> 0</property>
+ <property name="justify">right</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="doccjkchars-mobile">
+ <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="label"> 0</property>
+ <property name="justify">right</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="docstandardizedpages-mobile">
+ <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="label"> 0</property>
+ <property name="justify">right</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="documentlabel-mobile">
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes" context="wordcount|label10">Document</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
<placeholder/>
</child>
</object>
@@ -327,6 +484,9 @@
<action-widget response="-7">close</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<property name="ignore_hidden">True</property>