officecfg/registry/data/org/openoffice/Office/Common.xcu |3
officecfg/registry/schema/org/openoffice/Office/Common.xcs |5
sfx2/source/dialog/backingwindow.cxx | 94 +++--
sfx2/source/dialog/backingwindow.hxx |5
sfx2/uiconfig/ui/startcenter.ui| 10 -
5 files changed, 97 insertions(+), 20 deletions(-)
New commits:
commit 35713de9d0b4981a019edd25591285d0bc6107db
Author: Heiko Tietze
AuthorDate: Tue Jan 19 14:37:19 2021 +0100
Commit: Heiko Tietze
CommitDate: Tue Jan 26 14:43:06 2021 +0100
Make brand image clickable
and link to LibreOffice volunteer page
Change-Id: Ie422983d0e23faa16c2e2364b25798b938712a43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109637
Tested-by: Jenkins
Reviewed-by: Heiko Tietze
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu
b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 83335726c843..237348be96cb 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -363,6 +363,9 @@
https://hub.libreoffice.org/InstallJava/
+
+ https://hub.libreoffice.org/volunteersupport/
+
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index de96a9477b37..be60d3d19ec3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2111,6 +2111,11 @@
Specifies the URL used with the UNO command SendFeedback
(SID_SEND_FEEDBACK).
+
+
+ Specifies the URL opened per click on the brand image at the
start center.
+
+
Specifies the URL used with the UNO command QuestionAnswers
(SID_Q_AND_A).
diff --git a/sfx2/source/dialog/backingwindow.cxx
b/sfx2/source/dialog/backingwindow.cxx
index 45aec2821c4d..01b29e4dc197 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -37,6 +38,7 @@
#include
#include
#include
+#include
#include
@@ -60,6 +62,73 @@ using namespace ::com::sun::star::document;
constexpr OUStringLiteral SERVICENAME_CFGREADACCESS =
u"com.sun.star.configuration.ConfigurationAccess";
+class BrandImage final : public weld::CustomWidgetController
+{
+private:
+BitmapEx maBrandImage;
+bool mbIsDark = false;
+
+public:
+virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
+{
+weld::CustomWidgetController::SetDrawingArea(pDrawingArea);
+SetPointer(PointerStyle::RefHand);
+}
+
+virtual void Resize() override
+{
+auto nWidth = GetOutputSizePixel().Width();
+if (maBrandImage.GetSizePixel().Width() != nWidth)
+LoadImageForWidth(nWidth);
+weld::CustomWidgetController::Resize();
+}
+
+void LoadImageForWidth(int nWidth)
+{
+mbIsDark =
Application::GetSettings().GetStyleSettings().GetDialogColor().IsDark();
+SfxApplication::loadBrandSvg(mbIsDark ? "shell/logo-sc_inverted" :
"shell/logo-sc",
+maBrandImage, nWidth);
+}
+
+void ConfigureForWidth(int nWidth)
+{
+if (maBrandImage.GetSizePixel().Width() == nWidth)
+return;
+LoadImageForWidth(nWidth);
+const Size aBmpSize(maBrandImage.GetSizePixel());
+set_size_request(aBmpSize.Width(), aBmpSize.Height());
+}
+
+virtual void StyleUpdated() override
+{
+const bool bIsDark =
Application::GetSettings().GetStyleSettings().GetDialogColor().IsDark();
+if (bIsDark != mbIsDark)
+LoadImageForWidth(GetOutputSizePixel().Width());
+weld::CustomWidgetController::StyleUpdated();
+}
+
+virtual bool MouseButtonUp(const MouseEvent& rMEvt) override
+{
+if (rMEvt.IsLeft())
+{
+OUString sURL =
officecfg::Office::Common::Menus::VolunteerURL::get();
+localizeWebserviceURI(sURL);
+
+Reference const
xSystemShellExecute(
+css::system::SystemShellExecute::create(
+::comphelper::getProcessComponentContext()));
+xSystemShellExecute->execute(sURL, OUString(),
+
css::system::SystemShellExecuteFlags::URIS_ONLY);
+}
+return true;
+}
+
+virtual void Paint(vcl::RenderContext& rRenderContext, const
tools::Rectangle&) override
+{
+rRenderContext.DrawBitmapEx(Point(0, 0), maBrandImage);
+}
+};
+
// increase size of the text in the buttons on the left fMultiplier-times
float const g_fMultiplier = 1.4f;
@@ -77,7 +146,8 @@ BackingWindow::