unwind tangled mess around spinner buttons

Restore removed spinner artwork, cleanup the code: hicontrast - is now
a function of icon theme, not a global boolean.
uwith thanks to Ariel Constenla-Haile)

Change-Id: I68d4c7293a6faa130274cf45f53509ce140fa8c0
This commit is contained in:
Michael Meeks
2013-04-04 11:07:54 +01:00
parent cb3bf6a130
commit ae2c256e22
63 changed files with 42 additions and 121 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -43,6 +43,7 @@ $(eval $(call gb_SrsTarget_add_files,vcl/source/src,\
vcl/source/src/menu.src \
vcl/source/src/print.src \
vcl/source/src/stdtext.src \
vcl/source/src/throbber.src \
vcl/source/src/units.src \
vcl/source/src/fpicker.src \
vcl/source/edit/textundo.src \

View File

@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "vcl/throbber.hxx"
#include "vcl/svapp.hxx"
@@ -44,7 +43,6 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Exception;
namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
//----------------------------------------------------------------------------------------------------------------------
Throbber::Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet )
:ImageControl( i_parentWindow, i_style )
,mbRepeat( sal_True )
@@ -60,7 +58,6 @@ Throbber::Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_im
initImages();
}
//--------------------------------------------------------------------
Throbber::Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet )
:ImageControl( i_parentWindow, i_resId )
,mbRepeat( sal_True )
@@ -76,38 +73,14 @@ Throbber::Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet
initImages();
}
//----------------------------------------------------------------------------------------------------------------------
Throbber::~Throbber()
{
maWaitTimer.Stop();
}
//----------------------------------------------------------------------------------------------------------------------
namespace
{
//..................................................................................................................
::rtl::OUString lcl_getHighContrastURL( OUString const& i_imageURL )
{
INetURLObject aURL( i_imageURL );
if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE )
{
OSL_VERIFY( aURL.insertName( "hicontrast", false, 0 ) );
return aURL.GetMainURL( INetURLObject::NO_DECODE );
}
// the private: scheme is not considered to be hierarchical by INetURLObject, so manually insert the
// segment
const sal_Int32 separatorPos = i_imageURL.indexOf( '/' );
ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsipported URL scheme - cannot automatically determine HC version!", i_imageURL );
::rtl::OUStringBuffer composer;
composer.append( i_imageURL.copy( 0, separatorPos ) );
composer.appendAscii( "/hicontrast" );
composer.append( i_imageURL.copy( separatorPos ) );
return composer.makeStringAndClear();
}
//..................................................................................................................
::std::vector< Image > lcl_loadImageSet( const Throbber::ImageSet i_imageSet, const bool i_isHiContrast )
::std::vector< Image > lcl_loadImageSet( const Throbber::ImageSet i_imageSet )
{
::std::vector< Image > aImages;
ENSURE_OR_RETURN( i_imageSet != Throbber::IMAGES_NONE, "lcl_loadImageSet: illegal image set", aImages );
@@ -125,16 +98,8 @@ namespace
)
{
Reference< XGraphic > xGraphic;
if ( i_isHiContrast )
{
aMediaProperties.put( "URL", lcl_getHighContrastURL( *imageURL ) );
xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
}
if ( !xGraphic.is() )
{
aMediaProperties.put( "URL", *imageURL );
xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
}
aMediaProperties.put( "URL", *imageURL );
xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
aImages.push_back( Image( xGraphic ) );
}
@@ -142,7 +107,6 @@ namespace
}
}
//----------------------------------------------------------------------------------------------------------------------
void Throbber::Resize()
{
ImageControl::Resize();
@@ -151,7 +115,6 @@ void Throbber::Resize()
initImages();
}
//----------------------------------------------------------------------------------------------------------------------
void Throbber::initImages()
{
if ( meImageSet == IMAGES_NONE )
@@ -160,16 +123,15 @@ void Throbber::initImages()
try
{
::std::vector< ::std::vector< Image > > aImageSets;
const bool isHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
if ( meImageSet == IMAGES_AUTO )
{
aImageSets.push_back( lcl_loadImageSet( IMAGES_16_PX, isHiContrast ) );
aImageSets.push_back( lcl_loadImageSet( IMAGES_32_PX, isHiContrast ) );
aImageSets.push_back( lcl_loadImageSet( IMAGES_64_PX, isHiContrast ) );
aImageSets.push_back( lcl_loadImageSet( IMAGES_16_PX ) );
aImageSets.push_back( lcl_loadImageSet( IMAGES_32_PX ) );
aImageSets.push_back( lcl_loadImageSet( IMAGES_64_PX ) );
}
else
{
aImageSets.push_back( lcl_loadImageSet( meImageSet, isHiContrast ) );
aImageSets.push_back( lcl_loadImageSet( meImageSet ) );
}
// find the best matching image set (size-wise)
@@ -281,7 +243,7 @@ void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList
for ( size_t i=0; i<nImageCounts[index]; ++i )
{
::rtl::OUStringBuffer aURL;
aURL.appendAscii( "private:graphicrepository/shared/spinner-" );
aURL.appendAscii( "private:graphicrepository/vcl/res/spinner-" );
aURL.appendAscii( pResolutions[index] );
aURL.appendAscii( "-" );
if ( i < 9 )

View File

@@ -22,88 +22,46 @@
// at runtime, instead, the images in images.zip are accessed via
// private:graphicrepository/* URLs.
Resource 1000
Resource 3000
{
Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-16-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-16-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-16-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-16-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-16-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-16-06.png"; }; };
Image 1 { ImageBitmap = Bitmap{ file = "spinner-16-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "spinner-16-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "spinner-16-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "spinner-16-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "spinner-16-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "spinner-16-06.png"; }; };
};
Resource 1001
Resource 3001
{
Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-06.png"; }; };
Image 1 { ImageBitmap = Bitmap{ file = "spinner-32-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "spinner-32-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "spinner-32-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "spinner-32-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "spinner-32-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "spinner-32-06.png"; }; };
Image 7 { ImageBitmap = Bitmap{ file = "spinner-32-07.png"; }; };
Image 8 { ImageBitmap = Bitmap{ file = "spinner-32-08.png"; }; };
Image 9 { ImageBitmap = Bitmap{ file = "spinner-32-09.png"; }; };
Image 10 { ImageBitmap = Bitmap{ file = "spinner-32-10.png"; }; };
Image 11 { ImageBitmap = Bitmap{ file = "spinner-32-11.png"; }; };
Image 12 { ImageBitmap = Bitmap{ file = "spinner-32-12.png"; }; };
};
Resource 1002
Resource 3002
{
Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-32-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-32-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-32-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-32-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-32-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-32-06.png"; }; };
Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-32-07.png"; }; };
Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-32-08.png"; }; };
Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-32-09.png"; }; };
Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-32-10.png"; }; };
Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-32-11.png"; }; };
Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-32-12.png"; }; };
};
Resource 1003
{
Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-06.png"; }; };
Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-07.png"; }; };
Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-08.png"; }; };
Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-09.png"; }; };
Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-10.png"; }; };
Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-11.png"; }; };
Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-12.png"; }; };
};
Resource 1004
{
Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-64-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-64-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-64-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-64-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-64-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-64-06.png"; }; };
Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-64-07.png"; }; };
Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-64-08.png"; }; };
Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-64-09.png"; }; };
Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-64-10.png"; }; };
Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-64-11.png"; }; };
Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-64-12.png"; }; };
};
Resource 1005
{
Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-06.png"; }; };
Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-07.png"; }; };
Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-08.png"; }; };
Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-09.png"; }; };
Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-10.png"; }; };
Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-11.png"; }; };
Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-12.png"; }; };
Image 1 { ImageBitmap = Bitmap{ file = "spinner-64-01.png"; }; };
Image 2 { ImageBitmap = Bitmap{ file = "spinner-64-02.png"; }; };
Image 3 { ImageBitmap = Bitmap{ file = "spinner-64-03.png"; }; };
Image 4 { ImageBitmap = Bitmap{ file = "spinner-64-04.png"; }; };
Image 5 { ImageBitmap = Bitmap{ file = "spinner-64-05.png"; }; };
Image 6 { ImageBitmap = Bitmap{ file = "spinner-64-06.png"; }; };
Image 7 { ImageBitmap = Bitmap{ file = "spinner-64-07.png"; }; };
Image 8 { ImageBitmap = Bitmap{ file = "spinner-64-08.png"; }; };
Image 9 { ImageBitmap = Bitmap{ file = "spinner-64-09.png"; }; };
Image 10 { ImageBitmap = Bitmap{ file = "spinner-64-10.png"; }; };
Image 11 { ImageBitmap = Bitmap{ file = "spinner-64-11.png"; }; };
Image 12 { ImageBitmap = Bitmap{ file = "spinner-64-12.png"; }; };
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */