[Libreoffice-commits] .: Branch 'feature/template-dialog' - 2 commits - sfx2/inc sfx2/source
Rafael Dominguez
rdominguez at kemper.freedesktop.org
Mon Jul 2 19:06:04 PDT 2012
sfx2/inc/sfx2/templatefolderview.hxx | 2 ++
sfx2/inc/sfx2/templateview.hxx | 3 +++
sfx2/inc/sfx2/thumbnailview.hxx | 1 +
sfx2/source/control/templatefolderview.cxx | 9 +++++++++
sfx2/source/control/templateview.cxx | 3 +--
sfx2/source/control/thumbnailview.cxx | 5 +++--
sfx2/source/doc/templatedlg.cxx | 2 +-
7 files changed, 20 insertions(+), 5 deletions(-)
New commits:
commit b12ad0815468d9f12517da8c12a53c6f3687d8cc
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Mon Jul 2 21:17:15 2012 -0430
Disable drawing folder items while overlay is active.
Change-Id: Iab2d1a5a4b18f981f996f592f66ed52acb04ac73
diff --git a/sfx2/inc/sfx2/templatefolderview.hxx b/sfx2/inc/sfx2/templatefolderview.hxx
index 2f604d9..b1dcade 100644
--- a/sfx2/inc/sfx2/templatefolderview.hxx
+++ b/sfx2/inc/sfx2/templatefolderview.hxx
@@ -72,6 +72,8 @@ private:
DECL_LINK(ChangeNameHdl, TemplateView*);
+ DECL_LINK(OverlayCloseHdl, void*);
+
private:
bool mbFilteredResults; // Flag keep track if overlay has been filtered so folders can get filtered too afterwards
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index ba9baa0..3ecdc9b 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -41,6 +41,8 @@ public:
void setChangeNameHdl (const Link &rLink) { maChangeNameHdl = rLink; }
+ void setCloseHdl (const Link &rLink) { maCloseHdl = rLink; }
+
protected:
virtual void Resize ();
@@ -59,6 +61,7 @@ private:
SfxDocumentTemplates *mpDocTemplates;
Link maDblClickHdl;
Link maChangeNameHdl;
+ Link maCloseHdl;
Edit *mpEditName;
};
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index 1145af5..84ff537 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -346,6 +346,7 @@ protected:
bool mbIsTransientChildrenDisabled : 1;
bool mbHasVisibleItems : 1;
bool mbSelectionMode;
+ bool mbActive;
Color maColor;
Link maItemStateHdl;
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx
index e2fc4ba..e8b01f5 100644
--- a/sfx2/source/control/templatefolderview.cxx
+++ b/sfx2/source/control/templatefolderview.cxx
@@ -262,6 +262,7 @@ TemplateFolderView::TemplateFolderView ( Window* pParent, const ResId& rResId, b
mpItemView->setItemStateHdl(LINK(this,TemplateFolderView,TVTemplateStateHdl));
mpItemView->setChangeNameHdl(LINK(this,TemplateFolderView,ChangeNameHdl));
+ mpItemView->setCloseHdl(LINK(this,TemplateFolderView,OverlayCloseHdl));
}
TemplateFolderView::~TemplateFolderView()
@@ -352,6 +353,7 @@ bool TemplateFolderView::isOverlayVisible () const
void TemplateFolderView::showOverlay (bool bVisible)
{
+ mbActive = !bVisible;
mpItemView->Show(bVisible);
// Clear items is the overlay is closed.
@@ -568,6 +570,7 @@ void TemplateFolderView::OnItemDblClicked (ThumbnailViewItem *pRegionItem)
if (meFilterOption != FILTER_APP_NONE)
mpItemView->filterItems(ViewFilter_Application(mpDocTemplates,meFilterOption));
+ mbActive = false;
mpItemView->Show();
}
@@ -599,4 +602,10 @@ IMPL_LINK(TemplateFolderView, ChangeNameHdl, TemplateView*, pView)
return true;
}
+IMPL_LINK_NOARG(TemplateFolderView, OverlayCloseHdl)
+{
+ showOverlay(false);
+ return 0;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx
index c757356..5078fbd 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -189,8 +189,7 @@ void TemplateView::MouseButtonDown (const MouseEvent &rMEvt)
if (aImgRect.IsInside(rMEvt.GetPosPixel()))
{
- Show(false);
- Clear();
+ maCloseHdl.Call(this);
}
else
{
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 7e0ec57..92938eb 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -104,6 +104,7 @@ void ThumbnailView::ImplInit()
mbScroll = false;
mbHasVisibleItems = false;
mbSelectionMode = false;
+ mbActive = true;
maFilterFunc = ViewFilterAll();
// Create the processor and process the primitives
@@ -195,7 +196,7 @@ void ThumbnailView::ImplInitScrollBar()
void ThumbnailView::DrawItem (ThumbnailViewItem *pItem)
{
- if (pItem->isVisible())
+ if (mbActive && pItem->isVisible())
{
Rectangle aRect = pItem->getDrawArea();
@@ -600,7 +601,7 @@ void ThumbnailView::MouseMove( const MouseEvent& rMEvt )
{
ThumbnailViewItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
- if (pItem)
+ if (pItem && mbActive)
{
if (mnHighItemId != pItem->mnId && pItem->isVisible())
{
commit 3ffa63c3bdef67447abdc8ccb7b9bc0a3ec58b3e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Mon Jul 2 17:49:04 2012 -0430
Make folder view scrollable.
Change-Id: Id93cee3c115086b6d96203b6c2bb7d319ab23234
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index e35542b..60e68a6 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -150,7 +150,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpSearchEdit->SetSizePixel(aSearchSize);
mpSearchEdit->SetPosPixel(Point(PADDING_DLG_BORDER,aActionPos.Y()+aActionSize.getHeight()));
- maView->SetStyle(WB_TABSTOP);
+ maView->SetStyle(WB_VSCROLL);
maView->SetColor(GetBackground().GetColor());
maView->SetSizePixel(aThumbSize);
maView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
More information about the Libreoffice-commits
mailing list