summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-08-29 16:27:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-08-30 20:12:33 +0200
commit14afb688d3a24be302867ea614b0e30e01d168be (patch)
treea41fe590bf98a43690e67e2a813836c54fd5b817 /include
parenta2f2a40e37aadc0a32435a33402a21a678464ba4 (diff)
Resolves: tdf#95960 improve custom properties page
wrt widget heights and positions and other flakiness take the natural combobox height as the line height, use a vclgrid element for each row to get everything set to the same height move the positioning code into Resize, etc. Change-Id: I22de98ef91e39d1e7e45bbe62f68496d55c0c1cb Reviewed-on: https://gerrit.libreoffice.org/41734 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/dinfdlg.hxx34
1 files changed, 19 insertions, 15 deletions
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 1de0c95b680f..a5a0b73f4e95 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -367,6 +367,7 @@ public:
struct CustomPropertyLine
{
+ ScopedVclPtr<VclGrid> m_aLine;
ScopedVclPtr<ComboBox> m_aNameBox;
ScopedVclPtr<CustomPropertiesTypeBox> m_aTypeBox;
ScopedVclPtr<CustomPropertiesEdit> m_aValueEdit;
@@ -391,20 +392,15 @@ struct CustomPropertyLine
class CustomPropertiesWindow : public vcl::Window
{
private:
+ VclPtr<HeaderBar> m_pHeaderBar;
+ VclPtr<ScrollBar> m_pScrollBar;
VclPtr<FixedText> m_pHeaderAccName;
VclPtr<FixedText> m_pHeaderAccType;
VclPtr<FixedText> m_pHeaderAccValue;
- VclPtr<ComboBox> m_aNameBox;
- VclPtr<ListBox> m_aTypeBox;
- VclPtr<Edit> m_aValueEdit;
- VclPtr<DateField> m_aDateField;
- VclPtr<TimeField> m_aTimeField;
- VclPtr<Edit> m_aDurationField;
- VclPtr<PushButton> m_aEditButton;
- VclPtr<CustomPropertiesYesNoButton> m_aYesNoButton;
- VclPtr<ImageButton> m_aRemoveButton;
-
+ sal_Int32 m_nWidgetHeight;
+ sal_Int32 m_nRemoveButtonWidth;
+ sal_Int32 m_nTypeBoxWidth;
sal_Int32 m_nLineHeight;
sal_Int32 m_nScrollPos;
std::vector< CustomPropertyLine* > m_aCustomPropertiesLines;
@@ -414,10 +410,10 @@ private:
Idle m_aBoxLoseFocusIdle;
Link<void*,void> m_aRemovedHdl;
- DECL_STATIC_LINK( CustomPropertiesWindow, TypeHdl, ListBox&, void );
- DECL_LINK( RemoveHdl, Button*, void );
- DECL_LINK( EditLoseFocusHdl, Control&, void );
- DECL_LINK( BoxLoseFocusHdl, Control&, void );
+ DECL_LINK(TypeHdl, ListBox&, void);
+ DECL_LINK(RemoveHdl, Button*, void);
+ DECL_LINK(EditLoseFocusHdl, Control&, void);
+ DECL_LINK(BoxLoseFocusHdl, Control&, void);
//add lose focus handlers of Date/TimeField?
DECL_LINK(EditTimeoutHdl, Timer *, void);
@@ -431,10 +427,18 @@ public:
FixedText *pHeaderAccName,
FixedText *pHeaderAccType,
FixedText *pHeaderAccValue);
+ void Init(HeaderBar* pHeaderBar, ScrollBar* pScrollBar);
virtual ~CustomPropertiesWindow() override;
virtual void dispose() override;
- bool InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar );
+ virtual void Resize() override;
+ //these consts are unhelpful, this changes the state of the widgets
+ //that belong to CustomPropertyLine, but they are held by VclPtr
+ //and operator-> on a VclPtr is a const method that returns the
+ //non-const contents of the VclPtr, but loplugin:constparams
+ //correctly sees that it could all be set to const, so we end
+ //up with this unhappy situation
+ void SetWidgetWidths(const CustomPropertyLine* pLine) const;
sal_uInt16 GetVisibleLineCount() const;
sal_Int32 GetLineHeight() const { return m_nLineHeight; }
void AddLine( const OUString& sName, css::uno::Any const & rAny );