include/sfx2/thumbnailview.hxx | 11 -- include/sfx2/thumbnailviewitem.hxx | 2 officecfg/registry/schema/org/openoffice/Office/Common.xcs | 39 ++++++++ sfx2/source/control/recentdocsview.cxx | 8 + sfx2/source/control/thumbnailview.cxx | 57 +++---------- sfx2/source/control/thumbnailviewitem.cxx | 24 ++--- sfx2/source/dialog/backingwindow.cxx | 19 ++-- sfx2/source/dialog/backingwindow.hxx | 3 8 files changed, 91 insertions(+), 72 deletions(-)
New commits: commit c3a36a6761c8edbeb5f3af236d2f54c3b6dc8072 Author: Jan Holesovsky <ke...@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 Reviewed-on: https://gerrit.libreoffice.org/16622 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> 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 0bc0dc8..6f0dcb7 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -3570,11 +3570,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 0c0dad6..1ede436 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 b09bf8f..5430c76 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()); @@ -332,9 +333,9 @@ void BackingWindow::initControls() mpButtonsBox->SetBackground(aWallpaper); - // thin white rectangle aronud the Help and Extensions buttons - mpThinBox1->SetBackground(aButtonsText); - mpThinBox2->SetBackground(aButtonsText); + // thin white rectangle around the Help and Extensions buttons + 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;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits