Make Start Center pin icon highlight behave as intended

After
commit 9a37652b79
Author: Andreas Heinisch <andreas.heinisch@yahoo.de>
Date:   Wed Sep 6 17:03:26 2023 +0200

    tdf#156959 - Remove pinned icons from thumbnail view item

    Remove pinned icons from thumbnail view item and pushed it down
    to the recent documents view item. This avoids that the pinned
    icon will be shown in a simple thumbnail view, e.g., in the
    thumbnail view of the side pane in base.

    In addition, fixed an error with the number of elements in the
    thumbnail view in the start center when items are pinned, i.e.,
    removed a spurious new line.

... the pin icon stopped changing its state to highlighted.

I believe my commit makes it work like Andreas intended.

Also fix a typo in a member name to prevent accidents in the future.

Change-Id: I074b1ebb773466d72b9fc381b6f1066d2dbc353e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174493
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
This commit is contained in:
Ilmari Lauhakangas
2024-10-04 19:48:29 +02:00
committed by Andreas Heinisch
parent 9a2c38530d
commit f37542a291
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -134,7 +134,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri
m_bPinned(isPinned),
m_bPinnedIconHighlighted(false),
m_aPinnedDocumentBitmap(BMP_PIN_DOC),
m_aPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED)
m_aPinnedDocumentBitmapHighlighted(BMP_PIN_DOC_HIGHLIGHTED)
{
OUString aTitle(rTitle);
INetURLObject aURLObj(rURL);
@@ -311,7 +311,8 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
// tdf#38742 - draw pinned icon
const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
aSeq.push_back(new DiscreteBitmapPrimitive2D(
m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())));
m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHighlighted : m_aPinnedDocumentBitmap,
B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())));
pProcessor->process(aSeq);
}
@@ -321,8 +322,7 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
drawinglayer::primitive2d::Primitive2DContainer aSeq {
new DiscreteBitmapPrimitive2D(
m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHiglighted : m_aPinnedDocumentBitmap,
B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) };
m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) };
pProcessor->process(aSeq);
}
+1 -1
View File
@@ -68,7 +68,7 @@ private:
bool m_bPinned;
bool m_bPinnedIconHighlighted;
BitmapEx m_aPinnedDocumentBitmap;
BitmapEx m_aPinnedDocumentBitmapHiglighted;
BitmapEx m_aPinnedDocumentBitmapHighlighted;
};
#endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX