summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-06-07 16:27:25 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-06-07 12:58:17 +0000
commit934908168ebdb4a021e18e6bea57accc21d5ad86 (patch)
tree3ab87af564a6f62c55282cc005d09cf25873b6e0
parent15436c009e756dd4c94046f9849ad5a186454af8 (diff)
Missing selected + hover state in Template Manager
Change-Id: I35c91cea34953a5c4a78031eb809001e902197f1 Reviewed-on: https://gerrit.libreoffice.org/26013 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--include/sfx2/thumbnailview.hxx4
-rw-r--r--include/sfx2/thumbnailviewitem.hxx2
-rw-r--r--sfx2/source/control/templateviewitem.cxx4
-rw-r--r--sfx2/source/control/thumbnailview.cxx4
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx8
5 files changed, 18 insertions, 4 deletions
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 96946fa09028..4af3061bb28b 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 0ae23e552249..c37d6aac7276 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 3158a4cdea28..28dc70254562 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 c8f2aa6727ba..78e0569069c0 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 0e36b29a9bec..3690ae020cab 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(