[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - include/vcl svx/uiconfig vcl/source
Caolán McNamara
caolanm at redhat.com
Wed Jul 31 08:40:50 PDT 2013
include/vcl/builder.hxx | 3 +++
include/vcl/layout.hxx | 17 +++++++++++++++++
svx/uiconfig/ui/findreplacedialog.ui | 1 +
vcl/source/window/builder.cxx | 22 +++++++++++++++++++++-
vcl/source/window/layout.cxx | 12 ++++++++++++
5 files changed, 54 insertions(+), 1 deletion(-)
New commits:
commit b3abb55edd5f6c3168882239df2b4b28dc96cfab
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 12 11:40:27 2013 +0100
Resolves: fdo#67378 merge the label into the disclosure button
(cherry picked from commit 479bba2cdcda8dbd86861ea62c8c25bfef633148)
(cherry picked from commit 06ac689a8d3887519d98a616f9a1727fcc7d0bf6)
(cherry picked from commit 5718ffbf0e3e68e43f87541ce0368a15de8ec90e)
Change-Id: I11c9a35e3d50a827127e4542a40f6f29580d4e8b
8b65b4986bf316e352131e737ebf736d91173d16
43df94c16a178c90da9c006565390a81c2fda29b
Related: fdo#67378 rows missing HIG 6pixel spacing
Change-Id: I6d4767c3159c1e9ebef19978a94ad994aab6ff4b
(cherry picked from commit c2ce9bf0c2bfd2b38262de8571257c8f02b076b4)
Reviewed-on: https://gerrit.libreoffice.org/5202
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index d699d50..508377d 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -31,6 +31,7 @@ class PopupMenu;
class ScrollBar;
class DateField;
class TimeField;
+class VclExpander;
class VclMultiLineEdit;
class VCL_DLLPUBLIC VclBuilder: private boost::noncopyable
@@ -209,6 +210,8 @@ private:
AtkMap m_aAtkInfo;
std::vector<MnemonicWidgetMap> m_aMnemonicWidgetMaps;
+
+ std::vector<VclExpander*> m_aExpanderWidgets;
};
void loadTranslations(const com::sun::star::lang::Locale &rLocale, const OUString &rUri);
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index dd2c0bc..978eaca 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -517,6 +517,23 @@ public:
virtual Window *get_child();
virtual const Window *get_child() const;
virtual bool set_property(const OString &rKey, const OString &rValue);
+ bool get_expanded() const
+ {
+ return m_aDisclosureButton.IsChecked();
+ }
+ void set_expanded(bool bExpanded)
+ {
+ m_aDisclosureButton.Check(bExpanded);
+ }
+ void set_label(const OUString& rLabel)
+ {
+ m_aDisclosureButton.SetText(rLabel);
+ }
+ OUString get_label() const
+ {
+ return m_aDisclosureButton.GetText();
+ }
+ virtual void StateChanged(StateChangedType nType);
protected:
virtual Size calculateRequisition() const;
virtual void setAllocation(const Size &rAllocation);
diff --git a/svx/uiconfig/ui/findreplacedialog.ui b/svx/uiconfig/ui/findreplacedialog.ui
index 1fef7c6..aec160e 100644
--- a/svx/uiconfig/ui/findreplacedialog.ui
+++ b/svx/uiconfig/ui/findreplacedialog.ui
@@ -496,6 +496,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
<child>
<object class="GtkCheckButton" id="matchcase">
<property name="label" translatable="yes">Ma_tch case</property>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 9793b86..7e5282c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -401,6 +401,22 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri
delete_by_window(aI->first);
}
+ //fdo#67378 merge the label into the disclosure button
+ for (std::vector<VclExpander*>::iterator aI = m_pParserState->m_aExpanderWidgets.begin(),
+ aEnd = m_pParserState->m_aExpanderWidgets.end(); aI != aEnd; ++aI)
+ {
+ VclExpander *pOne = *aI;
+
+ Window *pChild = pOne->get_child();
+ Window* pLabel = pOne->GetWindow(WINDOW_LASTCHILD);
+ if (pLabel && pLabel != pChild && pLabel->GetType() == WINDOW_FIXEDTEXT)
+ {
+ FixedText *pLabelWidget = static_cast<FixedText*>(pLabel);
+ pOne->set_label(pLabelWidget->GetText());
+ delete_by_window(pLabel);
+ }
+ }
+
//drop maps, etc. that we don't need again
delete m_pParserState;
@@ -1003,7 +1019,11 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
else if (name == "GtkFrame")
pWindow = new VclFrame(pParent);
else if (name == "GtkExpander")
- pWindow = new VclExpander(pParent);
+ {
+ VclExpander *pExpander = new VclExpander(pParent);
+ m_pParserState->m_aExpanderWidgets.push_back(pExpander);
+ pWindow = pExpander;
+ }
else if (name == "GtkAlignment")
pWindow = new VclAlignment(pParent);
else if (name == "GtkButton")
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index ae79e8f..a83a722 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1498,6 +1498,18 @@ bool VclExpander::set_property(const OString &rKey, const OString &rValue)
return true;
}
+void VclExpander::StateChanged(StateChangedType nType)
+{
+ VclBin::StateChanged( nType );
+
+ if (nType == STATE_CHANGE_INITSHOW)
+ {
+ Window *pChild = get_child();
+ if (pChild)
+ pChild->Show(m_aDisclosureButton.IsChecked());
+ }
+}
+
IMPL_LINK( VclExpander, ClickHdl, DisclosureButton*, pBtn )
{
Window *pChild = get_child();
More information about the Libreoffice-commits
mailing list