[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Akshay Deep
akshaydeepiitr at gmail.com
Tue Jun 7 12:58:38 UTC 2016
include/sfx2/thumbnailview.hxx | 4 +++-
include/sfx2/thumbnailviewitem.hxx | 2 ++
sfx2/source/control/templateviewitem.cxx | 4 +++-
sfx2/source/control/thumbnailview.cxx | 4 ++++
sfx2/source/control/thumbnailviewitem.cxx | 8 ++++++--
5 files changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 934908168ebdb4a021e18e6bea57accc21d5ad86
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date: Tue Jun 7 16:27:25 2016 +0530
Missing selected + hover state in Template Manager
Change-Id: I35c91cea34953a5c4a78031eb809001e902197f1
Reviewed-on: https://gerrit.libreoffice.org/26013
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 96946fa..4af3061 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -314,8 +314,10 @@ protected:
bool mbShowTooltips : 1;
Color maFillColor; ///< Background color of the thumbnail view widget.
Color maTextColor; ///< Text color.
- Color maHighlightColor; ///< Color of the highlight (background) of the hovered / selected item.
+ Color maHighlightColor; ///< Color of the highlight (background) of the hovered item.
Color maHighlightTextColor; ///< Color of the text for the higlighted item.
+ Color maSelectHighlightColor; ///< Color of the highlight (background) of the selected and hovered item.
+ Color maSelectHighlightTextColor; ///< Color of the text of the selected and hovered item.
double mfHighlightTransparence; ///< Transparence of the highlight.
Link<const ThumbnailViewItem*, void> maItemStateHdl;
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index 0ae23e5..c37d6aa 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -57,6 +57,8 @@ struct ThumbnailItemAttributes
basegfx::BColor aTextColor;
basegfx::BColor aHighlightColor;
basegfx::BColor aHighlightTextColor;
+ basegfx::BColor aSelectHighlightColor;
+ basegfx::BColor aSelectHighlightTextColor;
double fHighlightTransparence;
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr;
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index 3158a4c..28dc702 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -63,7 +63,9 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
double fTransparence = 0.0;
// Draw background
- if ( mbSelected || mbHover )
+ if( mbSelected && mbHover)
+ aFillColor = pAttrs->aSelectHighlightColor;
+ else if (mbSelected || mbHover)
aFillColor = pAttrs->aHighlightColor;
if (mbHover)
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index c8f2aa6..78e0569 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -150,6 +150,8 @@ void ThumbnailView::ImplInit()
maTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
maHighlightColor = GetSettings().GetStyleSettings().GetHighlightColor();
maHighlightTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ maSelectHighlightColor = GetSettings().GetStyleSettings().GetActiveColor();
+ maSelectHighlightTextColor = GetSettings().GetStyleSettings().GetActiveTextColor();
const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
mfHighlightTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
@@ -206,6 +208,8 @@ void ThumbnailView::ApplySettings(vcl::RenderContext& rRenderContext)
mpItemAttrs->aTextColor = maTextColor.getBColor();
mpItemAttrs->aHighlightColor = maHighlightColor.getBColor();
mpItemAttrs->aHighlightTextColor = maHighlightTextColor.getBColor();
+ mpItemAttrs->aSelectHighlightColor = maSelectHighlightColor.getBColor();
+ mpItemAttrs->aSelectHighlightTextColor = maSelectHighlightTextColor.getBColor();
mpItemAttrs->fHighlightTransparence = mfHighlightTransparence;
mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize,GetFont(),false,true);
mpItemAttrs->nMaxTextLength = 0;
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 0e36b29..3690ae0 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -151,7 +151,9 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
double fTransparence = 0.0;
// Draw background
- if (mbSelected || mbHover)
+ if( mbSelected && mbHover)
+ aFillColor = pAttrs->aSelectHighlightColor;
+ else if (mbSelected || mbHover)
aFillColor = pAttrs->aHighlightColor;
if (mbHover)
@@ -246,7 +248,9 @@ void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const Thumbnai
// setup color
BColor aTextColor = pAttrs->aTextColor;
- if (mbSelected || mbHover)
+ if( mbSelected && mbHover)
+ aTextColor = pAttrs->aSelectHighlightTextColor;
+ else if (mbSelected || mbHover)
aTextColor = pAttrs->aHighlightTextColor;
rSeq[nPrimitives++] = drawinglayer::primitive2d::Primitive2DReference(
More information about the Libreoffice-commits
mailing list