Kaydet (Commit) 8b124ceb authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

Improve gallery look for small width (Sidebar)

* Remove the path column in details view
* Only show the theme name next to the view switch buttons
* Only show the horizontal scrollbar when necessary

Change-Id: Ia3f5d854217e883275b1a7056489dba9fac6aabb
üst 62a6a7d7
......@@ -956,33 +956,8 @@ void GalleryBrowser2::ImplUpdateViews( sal_uInt16 nSelectionId )
void GalleryBrowser2::ImplUpdateInfoBar()
{
OUString aInfoText;
if( mpCurTheme )
{
Point aSelPos;
const sal_uIntPtr nItemId = ImplGetSelectedItemId( NULL, aSelPos );
if( nItemId )
{
const sal_uIntPtr nPos = nItemId - 1;
aInfoText = mpCurTheme->GetName();
if( nPos < mpCurTheme->GetObjectCount() )
{
SgaObject* pObj = mpCurTheme->AcquireObject( nPos );
if( pObj )
{
aInfoText = GetItemText( *mpCurTheme, *pObj, GALLERY_ITEM_THEMENAME | GALLERY_ITEM_TITLE | GALLERY_ITEM_PATH );
mpCurTheme->ReleaseObject( pObj );
}
}
}
}
maInfoBar.SetText( aInfoText );
maInfoBar.SetText( mpCurTheme->GetName() );
}
sal_uIntPtr GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point& rSelPos )
......
......@@ -36,7 +36,6 @@
#include <vcl/settings.hxx>
#define GALLERY_BRWBOX_TITLE 1
#define GALLERY_BRWBOX_PATH 2
GalleryPreview::GalleryPreview(Window* pParent, WinBits nStyle, GalleryTheme* pTheme)
: Window(pParent, nStyle)
......@@ -527,10 +526,9 @@ GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme
InitSettings();
SetMode( BROWSER_AUTO_VSCROLL | BROWSER_AUTOSIZE_LASTCOL );
SetMode( BROWSER_AUTO_VSCROLL | BROWSER_AUTOSIZE_LASTCOL | BROWSER_AUTO_HSCROLL );
SetDataRowHeight( 28 );
InsertDataColumn( GALLERY_BRWBOX_TITLE, GAL_RESSTR(RID_SVXSTR_GALLERY_TITLE), 256 );
InsertDataColumn( GALLERY_BRWBOX_PATH, GAL_RESSTR(RID_SVXSTR_GALLERY_PATH), 256 );
}
GalleryListView::~GalleryListView()
......@@ -558,7 +556,7 @@ bool GalleryListView::SeekRow( long nRow )
return true;
}
OUString GalleryListView::GetCellText(long _nRow, sal_uInt16 nColumnId) const
OUString GalleryListView::GetCellText(long _nRow, sal_uInt16 /*nColumnId*/) const
{
OUString sRet;
if( mpTheme && ( _nRow < static_cast< long >( mpTheme->GetObjectCount() ) ) )
......@@ -567,9 +565,7 @@ OUString GalleryListView::GetCellText(long _nRow, sal_uInt16 nColumnId) const
if( pObj )
{
sRet = GalleryBrowser2::GetItemText( *mpTheme, *pObj,
( GALLERY_BRWBOX_TITLE == nColumnId ) ? GALLERY_ITEM_TITLE : GALLERY_ITEM_PATH );
sRet = GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_TITLE );
mpTheme->ReleaseObject( pObj );
}
}
......@@ -607,7 +603,7 @@ sal_Int32 GalleryListView::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColu
return nRet;
}
void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const
void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 /*nColumnId*/ ) const
{
rDev.Push( PUSH_CLIPREGION );
rDev.IntersectClipRegion( rRect );
......@@ -624,20 +620,8 @@ void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, sa
bool bNeedToCreate(aBitmapEx.IsEmpty());
if(!bNeedToCreate && GALLERY_BRWBOX_TITLE == nColumnId && aItemTextTitle.isEmpty())
{
bNeedToCreate = true;
}
if(!bNeedToCreate && GALLERY_BRWBOX_PATH == nColumnId && aItemTextPath.isEmpty())
{
bNeedToCreate = true;
}
if(!bNeedToCreate && aPreparedSize != aSize)
{
if(!bNeedToCreate && (aItemTextTitle.isEmpty() || aPreparedSize != aSize))
bNeedToCreate = true;
}
if(bNeedToCreate)
{
......@@ -656,8 +640,6 @@ void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, sa
const long nTextPosY(rRect.Top() + ((rRect.GetHeight() - rDev.GetTextHeight()) >> 1));
if(GALLERY_BRWBOX_TITLE == nColumnId)
{
if(!aBitmapEx.IsEmpty())
{
const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel());
......@@ -675,11 +657,6 @@ void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, sa
}
rDev.DrawText(Point(rRect.Left() + rRect.GetHeight() + 6, nTextPosY), aItemTextTitle);
}
else if(GALLERY_BRWBOX_PATH == nColumnId)
{
rDev.DrawText(Point(rRect.Left(), nTextPosY), aItemTextPath);
}
//SgaObject* pObj = mpTheme->AcquireObject( mnCurRow );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment