[Libreoffice-commits] core.git: 4 commits - include/sfx2 officecfg/registry sfx2/source sfx2/uiconfig
Jan Holesovsky
kendy at collabora.com
Tue Jun 30 08:58:09 PDT 2015
include/sfx2/thumbnailview.hxx | 12 -
include/sfx2/thumbnailviewitem.hxx | 3
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 39 ++++
sfx2/source/control/recentdocsview.cxx | 12 +
sfx2/source/control/templateabstractview.cxx | 2
sfx2/source/control/templatecontaineritem.cxx | 12 -
sfx2/source/control/templatedefaultview.cxx | 21 ++
sfx2/source/control/templateviewitem.cxx | 8 -
sfx2/source/control/thumbnailview.cxx | 63 ++-----
sfx2/source/control/thumbnailviewitem.cxx | 28 +--
sfx2/source/dialog/backingwindow.cxx | 27 ---
sfx2/source/dialog/backingwindow.hxx | 7
sfx2/uiconfig/ui/startcenter.ui | 104 +++----------
13 files changed, 156 insertions(+), 182 deletions(-)
New commits:
commit 1cf7e272f7731978695f4bcd8fbdf85766d4f14e
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Jun 30 17:53:49 2015 +0200
tdf#90452: Templates should adhere to the recent docs colors too.
Change-Id: I5df89581796eca4e48e0a305d4319e4674f8dd87
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 9000d32..bf0ea16 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -324,10 +324,11 @@ protected:
bool mbIsTransientChildrenDisabled : 1;
bool mbHasVisibleItems : 1;
bool mbShowTooltips : 1;
- Color maFillColor;
- Color maTextColor;
- Color maHighlightColor;
- Color maHighlightTextColor;
+ 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 maHighlightTextColor; ///< Color of the text for the higlighted item.
+ double mfHighlightTransparence; ///< Transparence of the highlight.
Link<> maItemStateHdl;
ThumbnailItemAttributes* mpItemAttrs;
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index ab2194b..8929b8e 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -60,6 +60,7 @@ struct ThumbnailItemAttributes
basegfx::BColor aTextColor;
basegfx::BColor aHighlightColor;
basegfx::BColor aHighlightTextColor;
+ double fHighlightTransparence;
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr;
};
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index b6afefa..a4745f0 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -74,6 +74,7 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent )
maTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsTextColor::get());
maHighlightColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightColor::get());
maHighlightTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightTextColor::get());
+ mfHighlightTransparence = 0.25;
}
VCL_BUILDER_FACTORY(RecentDocsView)
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index dbd2379..11b985d 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -312,7 +312,7 @@ void TemplateAbstractView::Paint(vcl::RenderContext& rRenderContext, const Recta
drawinglayer::primitive2d::Primitive2DSequence aSeq(1);
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
new PolyPolygonColorPrimitive2D(B2DPolyPolygon(Polygon(aRect).getB2DPolygon()),
- BColor(1.0, 1.0, 1.0)));
+ maFillColor.getBColor()));
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor(
diff --git a/sfx2/source/control/templatecontaineritem.cxx b/sfx2/source/control/templatecontaineritem.cxx
index 16e05d1..b4f2f63 100644
--- a/sfx2/source/control/templatecontaineritem.cxx
+++ b/sfx2/source/control/templatecontaineritem.cxx
@@ -22,7 +22,6 @@
#include <sfx2/templateviewitem.hxx>
#include <vcl/button.hxx>
#include <vcl/graph.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
using namespace basegfx;
using namespace basegfx::tools;
@@ -75,10 +74,7 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
aFillColor = pAttrs->aHighlightColor;
if (mbHover)
- {
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
- }
+ fTransparence = pAttrs->fHighlightTransparence;
aSeq[nCount++] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(
B2DPolyPolygon(Polygon(maDrawArea,5,5).getB2DPolygon()),
@@ -88,9 +84,9 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
true));
// Create rounded rectangle border
- aSeq[nCount++] = drawinglayer::primitive2d::Primitive2DReference( new PolygonStrokePrimitive2D(
- Polygon(maThumbnailArea,5,5).getB2DPolygon(),
- LineAttribute(BColor(0.8, 0.8, 0.8), 2.0)));
+ aSeq[nCount++] = drawinglayer::primitive2d::Primitive2DReference(new PolygonStrokePrimitive2D(
+ Polygon(maThumbnailArea, 5, 5).getB2DPolygon(),
+ LineAttribute(BColor(0.5, 0.5, 0.5), 2.0)));
// Paint the thumbnails side by side on a 2x2 grid
long nThumbPadding = 4;
diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx
index 61c3f2c..39ee415 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -12,6 +12,8 @@
#include <vcl/builderfactory.hxx>
#include <sfx2/app.hxx>
+#include <officecfg/Office/Common.hxx>
+
VCL_BUILDER_FACTORY(TemplateDefaultView)
TemplateDefaultView::TemplateDefaultView( Window* pParent)
@@ -23,6 +25,25 @@ TemplateDefaultView::TemplateDefaultView( Window* pParent)
Rectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
ThumbnailView::setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
+
+ // startcenter specific settings
+ maFillColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsBackgroundColor::get());
+ maTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsTextColor::get());
+ maHighlightColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightColor::get());
+ maHighlightTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightTextColor::get());
+ mfHighlightTransparence = 0.25;
+
+
+ maAllButton->SetControlForeground(maTextColor);
+ maFTName->SetControlForeground(maTextColor);
+
+ // TODO - convert the TemplateAbstractView to .ui (instead of fixed layout
+ // of the button and the fixed text), and do the following:
+ // const float fMultiplier = 1.4;
+ // vcl::Font aFont(maAllButton->GetSettings().GetStyleSettings().GetPushButtonFont());
+ // aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
+ // maAllButton->SetControlFont(aFont);
+ // maFTName->SetControlFont(aFont);
}
void TemplateDefaultView::reload()
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index c2ce8d2..05b7ebb 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -20,7 +20,6 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <vcl/button.hxx>
#include <vcl/graph.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
#define SUBTITLE_SCALE_FACTOR 0.85
@@ -77,11 +76,8 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
if ( mbSelected || mbHover )
aFillColor = pAttrs->aHighlightColor;
- if(mbHover)
- {
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
- }
+ if (mbHover)
+ fTransparence = pAttrs->fHighlightTransparence;
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(
B2DPolyPolygon(Polygon(maDrawArea,5,5).getB2DPolygon()),
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index b9f50d9..ff050df 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -29,6 +29,7 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <rtl/ustring.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <vcl/decoview.hxx>
#include <vcl/svapp.hxx>
#include <vcl/scrbar.hxx>
@@ -151,6 +152,10 @@ void ThumbnailView::ImplInit()
maTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
maHighlightColor = GetSettings().GetStyleSettings().GetHighlightColor();
maHighlightTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ mfHighlightTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
+
mpStartSelRange = mFilteredItemList.end();
ApplySettings(*this);
@@ -203,6 +208,7 @@ void ThumbnailView::ApplySettings(vcl::RenderContext& rRenderContext)
mpItemAttrs->aTextColor = maTextColor.getBColor();
mpItemAttrs->aHighlightColor = maHighlightColor.getBColor();
mpItemAttrs->aHighlightTextColor = maHighlightTextColor.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 7a0390c..68586ba 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -37,7 +37,6 @@
#include <vcl/graph.hxx>
#include <vcl/svapp.hxx>
#include <vcl/texteng.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
using namespace basegfx;
using namespace basegfx::tools;
@@ -277,10 +276,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
aFillColor = pAttrs->aHighlightColor;
if (mbHover)
- {
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = 0.25;
- }
+ fTransparence = pAttrs->fHighlightTransparence;
sal_uInt32 nPrimitive = 0;
aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(
commit 7387cdbc41924a85cc48e6b68563c91e35b3915c
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Jun 30 16:46:02 2015 +0200
tdf#90452: The correct color for the message when there's no recent file yet.
Change-Id: I5a990643903946ea339136fbc514ca8cb90fa34e
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index b396719..b6afefa 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -267,8 +267,9 @@ void RecentDocsView::Paint(vcl::RenderContext& rRenderContext, const Rectangle &
if (mItemList.empty())
{
// No recent files to be shown yet. Show a welcome screen.
- rRenderContext.Push(PushFlags::FONT);
+ rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR);
SetMessageFont(rRenderContext);
+ SetTextColor(maTextColor);
long nTextHeight = rRenderContext.GetTextHeight();
commit aef5e0a90cdfd37c2228a9959adee2efd543a717
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Jun 30 16:28:27 2015 +0200
tdf#90452: Remove the frame around the Help and Extension buttons.
Change-Id: I86d2daec6dcbd6af3a8da1b8329417bae46c8079
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 4eca52a..40be80d 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -143,10 +143,6 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
get(mpAllButtonsBox, "all_buttons_box");
get(mpButtonsBox, "buttons_box");
get(mpSmallButtonsBox, "small_buttons_box");
- get(mpThinBox1, "thin_box1");
- get(mpThinBox2, "thin_box2");
- get(mpHelpBox, "help_box");
- get(mpExtensionsBox, "extensions_box");
get(mpAllRecentThumbnails, "all_recent");
get(mpLocalView, "local_view");
@@ -233,10 +229,6 @@ void BackingWindow::dispose()
mpAllButtonsBox.clear();
mpButtonsBox.clear();
mpSmallButtonsBox.clear();
- mpThinBox1.clear();
- mpThinBox2.clear();
- mpHelpBox.clear();
- mpExtensionsBox.clear();
mpAllRecentThumbnails.clear();
mpLocalView.clear();
vcl::Window::dispose();
@@ -323,8 +315,6 @@ void BackingWindow::initControls()
mpAllButtonsBox->SetBackground(aButtonsBackground);
mpSmallButtonsBox->SetBackground(aButtonsBackground);
- mpHelpBox->SetBackground(aButtonsBackground);
- mpExtensionsBox->SetBackground(aButtonsBackground);
// motif image under the buttons
Wallpaper aWallpaper(get<FixedImage>("motif")->GetImage().GetBitmapEx());
@@ -333,10 +323,6 @@ void BackingWindow::initControls()
mpButtonsBox->SetBackground(aWallpaper);
- // thin white rectangle around the Help and Extensions buttons
- mpThinBox1->SetBackground(maButtonsTextColor);
- mpThinBox2->SetBackground(maButtonsTextColor);
-
Resize();
// compute the menubar height
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index 8ef01fb..c2c1462 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -78,10 +78,6 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer
VclPtr<VclBox> mpAllButtonsBox;
VclPtr<VclBox> mpButtonsBox;
VclPtr<VclBox> mpSmallButtonsBox;
- VclPtr<VclBox> mpThinBox1;
- VclPtr<VclBox> mpThinBox2;
- VclPtr<VclBox> mpHelpBox;
- VclPtr<VclBox> mpExtensionsBox;
VclPtr<RecentDocsView> mpAllRecentThumbnails;
VclPtr<TemplateDefaultView> mpLocalView;
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 2362028..57b7198 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
- <!-- interface-requires LibreOffice 1.0 -->
+ <requires lib="LibreOffice" version="1.0"/>
<object class="GtkImage" id="calc_all_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -353,53 +353,35 @@
</packing>
</child>
<child>
+ <object class="GtkSeparator" id="separator2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkBox" id="small_buttons_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
- <property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
- <object class="GtkBox" id="thin_box1">
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="help_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">1</property>
- <property name="margin_right">1</property>
- <property name="margin_top">1</property>
- <property name="margin_bottom">1</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkButton" id="help">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="has_tooltip">True</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="relief">none</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -408,42 +390,14 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="thin_box2">
+ <object class="GtkButton" id="extensions">
+ <property name="label" translatable="yes">E_xtensions</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="extensions_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">1</property>
- <property name="margin_right">1</property>
- <property name="margin_top">1</property>
- <property name="margin_bottom">1</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkButton" id="extensions">
- <property name="label" translatable="yes">E_xtensions</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="has_tooltip">True</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="relief">none</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -455,7 +409,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
commit 562d2c3337051da5d98d55a28dc391dab387b692
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Jun 30 16:13:23 2015 +0200
tdf#90452: Implement the new design of the startcenter.
See the comment 45 in the bug for the agreed design.
Change-Id: I428f339df48f530f606525434a4a2be8a79acaab
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index b7375dd..9000d32 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -232,10 +232,6 @@ public:
void ShowTooltips( bool bShowTooltips );
- Color GetColor() const { return maColor; }
-
- bool IsColor() const { return maColor.GetTransparency() == 0; }
-
void filterItems (const boost::function<bool (const ThumbnailViewItem*) > &func);
void sortItems (const boost::function<bool (const ThumbnailViewItem*,
@@ -283,14 +279,12 @@ protected:
friend class ThumbnailViewAcc;
friend class ThumbnailViewItemAcc;
- using Control::ImplInitSettings;
using Window::ImplInit;
void CalculateItemPositions (bool bScrollBarUsed = false);
void MakeItemVisible( sal_uInt16 nId );
SFX2_DLLPRIVATE void ImplInit();
- SFX2_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
@@ -330,7 +324,10 @@ protected:
bool mbIsTransientChildrenDisabled : 1;
bool mbHasVisibleItems : 1;
bool mbShowTooltips : 1;
- Color maColor;
+ Color maFillColor;
+ Color maTextColor;
+ Color maHighlightColor;
+ Color maHighlightTextColor;
Link<> maItemStateHdl;
ThumbnailItemAttributes* mpItemAttrs;
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index 48238af..ab2194b 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -57,7 +57,9 @@ struct ThumbnailItemAttributes
{
sal_uInt32 nMaxTextLength;
basegfx::BColor aFillColor;
+ basegfx::BColor aTextColor;
basegfx::BColor aHighlightColor;
+ basegfx::BColor aHighlightTextColor;
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr;
};
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 8922889..87aa3ed 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -3573,11 +3573,46 @@
<value>0</value>
</prop>
<prop oor:name="StartCenterBackgroundColor" oor:type="xs:int" oor:nillable="false">
- <!--Default 7514196 = TDF Green-->
+ <!-- Default 14540253 = 0xdddddd as specified in tdf#90452, comment 45 -->
<info>
<desc>Specifies the background color of the start center.</desc>
</info>
- <value>7514196</value>
+ <value>14540253</value>
+ </prop>
+ <prop oor:name="StartCenterTextColor" oor:type="xs:int" oor:nillable="false">
+ <!-- Default 3355443 = 0x333333 as specified in tdf#90452, comment 45 -->
+ <info>
+ <desc>Specifies the text color of the buttons in the start center.</desc>
+ </info>
+ <value>3355443</value>
+ </prop>
+ <prop oor:name="StartCenterThumbnailsBackgroundColor" oor:type="xs:int" oor:nillable="false">
+ <!-- Default 6710886 = 0x666666 as specified in tdf#90452, comment 45 -->
+ <info>
+ <desc>Specifies the background color of the thumbnail area in the start center.</desc>
+ </info>
+ <value>6710886</value>
+ </prop>
+ <prop oor:name="StartCenterThumbnailsTextColor" oor:type="xs:int" oor:nillable="false">
+ <!-- Default 15658734 = 0xeeeeee as specified in tdf#90452, comment 45 -->
+ <info>
+ <desc>Specifies the text color of the thumbnail area in the start center.</desc>
+ </info>
+ <value>15658734</value>
+ </prop>
+ <prop oor:name="StartCenterThumbnailsHighlightColor" oor:type="xs:int" oor:nillable="false">
+ <!-- Default 14540253 = 0xdddddd as specified in tdf#90452, comment 45 -->
+ <info>
+ <desc>Specifies the background color of the highlight of a thumbnail in the start center.</desc>
+ </info>
+ <value>14540253</value>
+ </prop>
+ <prop oor:name="StartCenterThumbnailsHighlightTextColor" oor:type="xs:int" oor:nillable="false">
+ <!-- Default 3355443 = 0x333333 as specified in tdf#90452, comment 45 -->
+ <info>
+ <desc>Specifies the text color of the highlight of a thumbnail in the start center.</desc>
+ </info>
+ <value>3355443</value>
</prop>
</group>
</group>
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index ad45119..b396719 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -32,6 +32,8 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <templateview.hrc>
+#include <officecfg/Office/Common.hxx>
+
using namespace ::com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -67,6 +69,11 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent )
SetStyle(GetStyle() | WB_VSCROLL);
setItemMaxTextLength( mnItemMaxTextLength );
setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
+
+ maFillColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsBackgroundColor::get());
+ maTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsTextColor::get());
+ maHighlightColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightColor::get());
+ maHighlightTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightTextColor::get());
}
VCL_BUILDER_FACTORY(RecentDocsView)
@@ -297,7 +304,6 @@ void RecentDocsView::LoseFocus()
ThumbnailView::LoseFocus();
}
-
void RecentDocsView::Clear()
{
Invalidate();
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 08675c0..b9f50d9 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -58,8 +58,8 @@ enum
ThumbnailView::ThumbnailView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: Control( pParent, nWinStyle )
+ , mpItemAttrs(new ThumbnailItemAttributes)
{
- mpItemAttrs = NULL;
ImplInit();
mbIsTransientChildrenDisabled = bDisableTransientChildren;
}
@@ -147,10 +147,13 @@ void ThumbnailView::ImplInit()
mbHasVisibleItems = false;
mbShowTooltips = false;
maFilterFunc = ViewFilterAll();
- maColor = GetSettings().GetStyleSettings().GetFieldColor();
+ maFillColor = GetSettings().GetStyleSettings().GetFieldColor();
+ maTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ maHighlightColor = GetSettings().GetStyleSettings().GetHighlightColor();
+ maHighlightTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
mpStartSelRange = mFilteredItemList.end();
- ImplInitSettings(true, true, true);
+ ApplySettings(*this);
}
void ThumbnailView::ImplDeleteItems()
@@ -194,35 +197,12 @@ void ThumbnailView::ApplySettings(vcl::RenderContext& rRenderContext)
ApplyControlFont(*this, rStyleSettings.GetAppFont());
ApplyControlForeground(*this, rStyleSettings.GetButtonTextColor());
rRenderContext.SetTextFillColor();
- Color aColor = rStyleSettings.GetFieldColor();
- rRenderContext.SetBackground(aColor);
-}
-
-void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
-{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ rRenderContext.SetBackground(maFillColor);
- if (bFont)
- {
- ApplyControlFont(*this, rStyleSettings.GetAppFont());
- }
-
- if (bForeground || bFont)
- {
- ApplyControlForeground(*this, rStyleSettings.GetButtonTextColor());
- SetTextFillColor();
- }
-
- if (bBackground)
- {
- Color aColor = rStyleSettings.GetFieldColor();
- SetBackground(aColor);
- }
-
- delete mpItemAttrs;
- mpItemAttrs = new ThumbnailItemAttributes;
- mpItemAttrs->aFillColor = maColor.getBColor();
- mpItemAttrs->aHighlightColor = rStyleSettings.GetHighlightColor().getBColor();
+ mpItemAttrs->aFillColor = maFillColor.getBColor();
+ mpItemAttrs->aTextColor = maTextColor.getBColor();
+ mpItemAttrs->aHighlightColor = maHighlightColor.getBColor();
+ mpItemAttrs->aHighlightTextColor = maHighlightTextColor.getBColor();
mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize,GetFont(),false,true);
mpItemAttrs->nMaxTextLength = 0;
}
@@ -862,15 +842,15 @@ void ThumbnailView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& r
// Draw background
drawinglayer::primitive2d::Primitive2DSequence aSeq(1);
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(new PolyPolygonColorPrimitive2D(
- B2DPolyPolygon(Polygon(rRect, 5, 5).getB2DPolygon()),
- maColor.getBColor()));
+ B2DPolyPolygon(Polygon(Rectangle(Point(), GetOutputSizePixel()), 0, 0).getB2DPolygon()),
+ maFillColor.getBColor()));
// Create the processor and process the primitives
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
- std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor(
+ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
- mpProcessor->process(aSeq);
+ pProcessor->process(aSeq);
// draw items
for (size_t i = 0; i < nItemCount; i++)
@@ -879,7 +859,7 @@ void ThumbnailView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& r
if (pItem->isVisible())
{
- pItem->Paint(mpProcessor.get(), mpItemAttrs);
+ pItem->Paint(pProcessor.get(), mpItemAttrs);
}
}
@@ -949,22 +929,18 @@ void ThumbnailView::StateChanged( StateChangedType nType )
else if ( (nType == StateChangedType::Zoom) ||
(nType == StateChangedType::ControlFont) )
{
- ImplInitSettings( true, false, false );
Invalidate();
}
else if ( nType == StateChangedType::ControlForeground )
{
- ImplInitSettings( false, true, false );
Invalidate();
}
else if ( nType == StateChangedType::ControlBackground )
{
- ImplInitSettings( false, false, true );
Invalidate();
}
else if ( (nType == StateChangedType::Style) || (nType == StateChangedType::Enable) )
{
- ImplInitSettings( false, false, true );
Invalidate();
}
}
@@ -979,7 +955,6 @@ void ThumbnailView::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
{
- ImplInitSettings( true, true, true );
Invalidate();
}
}
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index ee0e559..7a0390c 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -279,7 +279,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
if (mbHover)
{
const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
+ fTransparence = 0.25;
}
sal_uInt32 nPrimitive = 0;
@@ -304,8 +304,8 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
));
// draw thumbnail borders
- float fWidth = aImageSize.Width();
- float fHeight = aImageSize.Height();
+ float fWidth = aImageSize.Width() - 1;
+ float fHeight = aImageSize.Height() - 1;
float fPosX = maPrev1Pos.getX();
float fPosY = maPrev1Pos.getY();
@@ -319,8 +319,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference(createBorderLine(aBounds));
// Draw text below thumbnail
- aPos = maTextPos;
- addTextPrimitives( maTitle, pAttrs, aPos, aSeq );
+ addTextPrimitives(maTitle, pAttrs, maTextPos, aSeq);
pProcessor->process(aSeq);
}
@@ -370,13 +369,18 @@ void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const Thumbnai
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
nLineX, double( aPos.Y() ) ) );
+ // setup color
+ BColor aTextColor = pAttrs->aTextColor;
+ if (mbSelected || mbHover)
+ aTextColor = pAttrs->aHighlightTextColor;
+
rSeq[nPrimitives++] = drawinglayer::primitive2d::Primitive2DReference(
new TextSimplePortionPrimitive2D(aTextMatrix,
- aText,nLineStart,nLineLength,
- std::vector< double >( ),
+ aText, nLineStart, nLineLength,
+ std::vector<double>(),
pAttrs->aFontAttr,
com::sun::star::lang::Locale(),
- Color(COL_BLACK).getBColor() ) );
+ aTextColor));
nLineStart += nLineLength;
aPos.setY(aPos.getY() + aTextEngine.GetCharHeight());
@@ -388,9 +392,7 @@ void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const Thumbnai
drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
ThumbnailViewItem::createBorderLine (const basegfx::B2DPolygon& rPolygon)
{
- return new PolygonHairlinePrimitive2D(rPolygon, Color(186,186,186).getBColor());
+ return new PolygonHairlinePrimitive2D(rPolygon, Color(128, 128, 128).getBColor());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-
-
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index e77b332..4eca52a 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -71,8 +71,8 @@ const char TEMPLATE_URL[] = ".uno:NewDoc";
const char OPEN_URL[] = ".uno:Open";
const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess";
+// increase size of the text in the buttons on the left fMultiplier-times
float fMultiplier = 1.4f;
-const Color aButtonsText(COL_WHITE);
/***
*
@@ -91,6 +91,7 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
Window( i_pParent ),
mxDesktop( Desktop::create(comphelper::getProcessComponentContext()) ),
mbLocalViewInitialized(false),
+ maButtonsTextColor(officecfg::Office::Common::Help::StartCenter::StartCenterTextColor::get()),
mbIsSaveMode( false ),
mbInitControls( false ),
mnHideExternalLinks( 0 ),
@@ -310,13 +311,13 @@ void BackingWindow::initControls()
mpExtensionsButton->SetClickHdl(LINK(this, BackingWindow, ExtLinkClickHdl));
// setup nice colors
- mpCreateLabel->SetControlForeground(aButtonsText);
+ mpCreateLabel->SetControlForeground(maButtonsTextColor);
vcl::Font aFont(mpCreateLabel->GetSettings().GetStyleSettings().GetLabelFont());
aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
mpCreateLabel->SetControlFont(aFont);
- mpHelpButton->SetControlForeground(aButtonsText);
- mpExtensionsButton->SetControlForeground(aButtonsText);
+ mpHelpButton->SetControlForeground(maButtonsTextColor);
+ mpExtensionsButton->SetControlForeground(maButtonsTextColor);
const Color aButtonsBackground(officecfg::Office::Common::Help::StartCenter::StartCenterBackgroundColor::get());
@@ -333,8 +334,8 @@ void BackingWindow::initControls()
mpButtonsBox->SetBackground(aWallpaper);
// thin white rectangle around the Help and Extensions buttons
- mpThinBox1->SetBackground(aButtonsText);
- mpThinBox2->SetBackground(aButtonsText);
+ mpThinBox1->SetBackground(maButtonsTextColor);
+ mpThinBox2->SetBackground(maButtonsTextColor);
Resize();
@@ -371,7 +372,7 @@ void BackingWindow::setupButton( PushButton* pButton )
pButton->SetControlFont(aFont);
// color that fits the theme
- pButton->SetControlForeground(aButtonsText);
+ pButton->SetControlForeground(maButtonsTextColor);
pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
}
@@ -382,7 +383,7 @@ void BackingWindow::setupButton( MenuButton* pButton )
pButton->SetControlFont(aFont);
// color that fits the theme
- pButton->SetControlForeground(aButtonsText);
+ pButton->SetControlForeground(maButtonsTextColor);
PopupMenu* pMenu = pButton->GetPopupMenu();
pMenu->SetMenuFlags(pMenu->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries);
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index 796d8ad..8ef01fb 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -89,10 +89,11 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer
std::vector< VclPtr<vcl::Window> > maDndWindows;
+ Color maButtonsTextColor;
Rectangle maStartCentButtons;
bool mbIsSaveMode;
- bool mbInitControls;
+ bool mbInitControls;
sal_Int32 mnHideExternalLinks;
svt::AcceleratorExecute* mpAccExec;
More information about the Libreoffice-commits
mailing list