Kaydet (Commit) 8e2eccb1 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Tab bar: multiply the size of the plus icon if HiDPI is detected

Change-Id: I6efaac9bd21ab986af77fed1a949d3d2b380e922
üst 39327e71
...@@ -1191,16 +1191,25 @@ public: ...@@ -1191,16 +1191,25 @@ public:
void drawPlusImage() void drawPlusImage()
{ {
SvtResId id( BMP_LIST_ADD ); SvtResId aPlusImageId(BMP_LIST_ADD);
Image aPlusImg( id ); Image aPlusImage(aPlusImageId);
sal_Int32 aScaleFactor = mrParent.GetDPIScaleFactor();
if (aScaleFactor > 1)
{
BitmapEx aBitmap = aPlusImage.GetBitmapEx();
aBitmap.Scale(aScaleFactor, aScaleFactor, BMP_SCALE_FAST);
aPlusImage = Image(aBitmap);
}
// Center the image within the bounding rectangle. // Center the image within the bounding rectangle.
Size aSize = aPlusImg.GetSizePixel(); Size aSize = aPlusImage.GetSizePixel();
Point pt = maRect.TopLeft(); Point aPosition = maRect.TopLeft();
long nXOffSet = (maRect.GetWidth() - aSize.Width()) / 2; long nXOffSet = (maRect.GetWidth() - aSize.Width()) / 2;
long nYOffset = (maRect.GetHeight() - aSize.Height()) / 2; long nYOffset = (maRect.GetHeight() - aSize.Height()) / 2;
pt += Point(nXOffSet, nYOffset); aPosition += Point(nXOffSet, nYOffset);
pt.X() += 1; aPosition.X() += 1;
mrParent.DrawImage(pt, aPlusImg); mrParent.DrawImage(aPosition, aPlusImage);
} }
void setRect(const Rectangle& rRect) void setRect(const Rectangle& rRect)
......
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