[Libreoffice-commits] .: 2 commits - sfx2/inc sfx2/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Dec 5 09:12:41 PST 2012
sfx2/inc/templatedlg.hxx | 1 +
sfx2/source/control/templatelocalview.cxx | 4 ++--
sfx2/source/doc/templatedlg.cxx | 11 ++++++-----
sfx2/source/doc/templatedlg.hrc | 1 +
sfx2/source/doc/templatedlg.src | 12 +++++++++---
5 files changed, 19 insertions(+), 10 deletions(-)
New commits:
commit 57ed5702fda24dce9da13bafbd4b3f385bf9c5d5
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Dec 5 18:09:03 2012 +0100
Template manager: pickup non-empty thumbnails for folders
Change-Id: Idcb2987dc98ea9d00c8b160902446e71e8d6daff
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 26d9f3c..582e508 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -748,9 +748,9 @@ static void lcl_updateThumbnails (TemplateLocalViewItem *pItem)
pItem->maPreview2.Clear();
// Update folder thumbnails
- for (size_t i = 0, n = pItem->maTemplates.size(); i < 2 && i < n; ++i)
+ for (size_t i = 0, n = pItem->maTemplates.size(); i < n && ( pItem->maPreview1.IsEmpty() || pItem->maPreview2.IsEmpty( ) ); ++i)
{
- if (i == 0)
+ if ( pItem->maPreview1.IsEmpty( ) )
{
pItem->maPreview1 = TemplateAbstractView::scaleImg(pItem->maTemplates[i].aThumbnail,
TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
commit 337ac3bd696046e734c4bcc0c91294c59514274b
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Dec 5 17:15:04 2012 +0100
Template Manager: put all the ToolBoxes in a Control to ease painting changes
Change-Id: Ie63638a2b69594edf21e8025b1531842390f409d
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 8ce829e..8e70039 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -125,6 +125,7 @@ private:
PushButton aButtonSheets;
PushButton aButtonDraws;
ImageButton maButtonSelMode;
+ Control *mpToolbars;
Edit *mpSearchEdit;
ToolBox *mpViewBar;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 371f873..b4fb512 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -54,7 +54,6 @@
#define INIT_FOLDER_COLS 3
#define INIT_FOLDER_LINES 2
-#define PADDING_TOOLBAR_VIEW 15
#define PADDING_DLG_BORDER 10
using namespace ::com::sun::star;
@@ -106,10 +105,11 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
aButtonSheets(this,SfxResId(BTN_SELECT_SHEETS)),
aButtonDraws(this,SfxResId(BTN_SELECT_DRAWS)),
maButtonSelMode(this,SfxResId(BTN_SELECTION_MODE)),
+ mpToolbars( new Control(this,SfxResId(TOOLBARS))),
mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
- mpViewBar( new ToolBox(this, SfxResId(TBX_ACTION_VIEW))),
- mpActionBar( new ToolBox(this, SfxResId(TBX_ACTION_ACTION))),
- mpTemplateBar( new ToolBox(this, SfxResId(TBX_ACTION_TEMPLATES))),
+ mpViewBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_VIEW))),
+ mpActionBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_ACTION))),
+ mpTemplateBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_TEMPLATES))),
mpSearchView(new TemplateSearchView(this)),
maView(new TemplateLocalView(this,SfxResId(TEMPLATE_VIEW))),
mpOnlineView(new TemplateRemoteView(this, WB_VSCROLL,false)),
@@ -177,7 +177,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
// Set view position below toolbox
Point aViewPos = maView->GetPosPixel();
- aViewPos.setY(aActionPos.Y() + aActionSize.getHeight() + PADDING_TOOLBAR_VIEW);
+ aViewPos.setY(mpToolbars->GetPosPixel().Y() + mpToolbars->GetSizePixel().getHeight());
aViewPos.setX((aWinSize.getWidth() - aThumbSize.getWidth())/2); // Center the view
maView->SetPosPixel(aViewPos);
@@ -273,6 +273,7 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg ()
delete mpActionMenu;
delete mpRepositoryMenu;
delete mpTemplateDefaultMenu;
+ delete mpToolbars;
}
void SfxTemplateManagerDlg::setSaveMode(bool bMode)
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index aced42a..7624e48 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -16,6 +16,7 @@
#define TEMPLATE_VIEW 7
#define TBX_ACTION_VIEW 8
+#define TOOLBARS 9
#define TBI_TEMPLATE_IMPORT 10
#define TBX_ACTION_ACTION 11
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 9bafd2b..184b216 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -189,12 +189,18 @@ ModelessDialog DLG_TEMPLATE_MANAGER
};
};
+ Control TOOLBARS
+ {
+ Pos = MAP_APPFONT( 0 , 22 );
+ Size = MAP_APPFONT( 290 , 20 );
+ TabStop = False;
+ };
ToolBox TBX_ACTION_VIEW
{
SVLook = TRUE ;
TabStop = TRUE ;
- Pos = MAP_APPFONT ( 4 , 22 ) ;
+ Pos = MAP_APPFONT ( 4 , 0 ) ;
ItemList =
{
@@ -251,7 +257,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
{
SVLook = TRUE ;
TabStop = TRUE ;
- Pos = MAP_APPFONT ( 4 , 22 ) ;
+ Pos = MAP_APPFONT ( 4 , 0 ) ;
ItemList =
{
@@ -283,7 +289,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
{
SVLook = TRUE ;
TabStop = TRUE ;
- Pos = MAP_APPFONT ( 4 , 22 ) ;
+ Pos = MAP_APPFONT ( 4 , 0 ) ;
Hide = TRUE;
ItemList =
More information about the Libreoffice-commits
mailing list