diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx index 2404052271e6..478780578b56 100644 --- a/cui/source/dialogs/tipofthedaydlg.cxx +++ b/cui/source/dialogs/tipofthedaydlg.cxx @@ -42,6 +42,9 @@ #include #include +//size of preview +const Size ThumbSize(100, 120); + TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) : GenericDialogController(pParent, "cui/ui/tipofthedaydialog.ui", "TipOfTheDayDialog") , m_pText(m_xBuilder->weld_label("lbText")) @@ -52,8 +55,8 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) { m_pShowTip->set_active(officecfg::Office::Common::Misc::ShowTipOfTheDay::get()); m_pNext->connect_clicked(LINK(this, TipOfTheDayDialog, OnNextClick)); - m_nCurrentTip = officecfg::Office::Common::Misc::LastTipOfTheDayID::get(); + m_pPreview->set_size_request(ThumbSize.Width(), ThumbSize.Height()); const auto t0 = std::chrono::system_clock::now().time_since_epoch(); m_nDay = std::chrono::duration_cast(t0).count() / 24; @@ -176,6 +179,13 @@ void TipOfTheDayDialog::UpdateTip() aImageName = "tipoftheday.png"; Graphic aGraphic; GraphicFilter::LoadGraphic(aURL + aImageName, OUString(), aGraphic); + + if (!aGraphic.IsAnimated()) + { + BitmapEx aBmpEx(aGraphic.GetBitmapEx()); + if (aBmpEx.Scale(ThumbSize)) + aGraphic = aBmpEx; + } m_aPreview.SetPreview(aGraphic); } diff --git a/cui/uiconfig/ui/tipofthedaydialog.ui b/cui/uiconfig/ui/tipofthedaydialog.ui index 4ee6522558b2..e05738d8466a 100644 --- a/cui/uiconfig/ui/tipofthedaydialog.ui +++ b/cui/uiconfig/ui/tipofthedaydialog.ui @@ -1,5 +1,5 @@ - + @@ -86,6 +86,8 @@ True False + 6 + 12 False