diff options
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 98 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.hxx | 8 | ||||
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 7 |
3 files changed, 73 insertions, 40 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 44f53cfd8801..99c3990de072 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -62,7 +62,7 @@ using namespace ::com::sun::star::document; const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess"; // increase size of the text in the buttons on the left fMultiplier-times -float const fMultiplier = 1.4f; +float const g_fMultiplier = 1.4f; BackingWindow::BackingWindow(vcl::Window* i_pParent) : InterimItemWindow(i_pParent, "sfx/ui/startcenter.ui", "StartCenter", false) @@ -204,32 +204,77 @@ void BackingWindow::initControls() //initialize Template view mxLocalView->Hide(); - //set handlers mxLocalView->setCreateContextMenuHdl(LINK(this, BackingWindow, CreateContextMenuHdl)); mxLocalView->setOpenTemplateHdl(LINK(this, BackingWindow, OpenTemplateHdl)); mxLocalView->setEditTemplateHdl(LINK(this, BackingWindow, EditTemplateHdl)); mxLocalView->ShowTooltips( true ); - setupButton(*mxOpenButton); - setupButton(*mxRemoteButton); - setupButton(*mxRecentButton); - setupButton(*mxTemplateButton); - setupButton(*mxWriterAllButton); - setupButton(*mxDrawAllButton); - setupButton(*mxCalcAllButton); - setupButton(*mxDBAllButton); - setupButton(*mxImpressAllButton); - setupButton(*mxMathAllButton); - checkInstalledModules(); mxExtensionsButton->connect_clicked(LINK(this, BackingWindow, ExtLinkClickHdl)); - // setup larger font - vcl::Font aFont(mxCreateLabel->get_font()); - aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier)); - mxCreateLabel->set_font(aFont); + mxOpenButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxRemoteButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxRecentButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxTemplateButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxWriterAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxDrawAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxCalcAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxDBAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxImpressAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + mxMathAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl)); + + mxRecentButton->connect_selected(LINK(this, BackingWindow, MenuSelectHdl)); + mxTemplateButton->connect_selected(LINK(this, BackingWindow, MenuSelectHdl)); + + ApplyStyleSettings(); +} + +void BackingWindow::DataChanged(const DataChangedEvent& rDCEvt) +{ + if ((rDCEvt.GetType() != DataChangedEventType::SETTINGS) + || !(rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) + { + InterimItemWindow::DataChanged(rDCEvt); + return; + } + + ApplyStyleSettings(); + Invalidate(); +} + +template <typename WidgetClass> +void BackingWindow::setLargerFont(WidgetClass& pWidget, const vcl::Font& rFont) +{ + vcl::Font aFont(rFont); + aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * g_fMultiplier)); + pWidget->set_font(aFont); +} + +void BackingWindow::ApplyStyleSettings() +{ + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + const Color aButtonsBackground(rStyleSettings.GetWindowColor()); + const vcl::Font& aButtonFont(rStyleSettings.GetPushButtonFont()); + const vcl::Font& aLabelFont(rStyleSettings.GetLabelFont()); + + // setup larger fonts + setLargerFont(mxOpenButton, aButtonFont); + setLargerFont(mxOpenButton, aButtonFont); + setLargerFont(mxRemoteButton, aButtonFont); + setLargerFont(mxRecentButton, aButtonFont); + setLargerFont(mxTemplateButton, aButtonFont); + setLargerFont(mxWriterAllButton, aButtonFont); + setLargerFont(mxDrawAllButton, aButtonFont); + setLargerFont(mxCalcAllButton, aButtonFont); + setLargerFont(mxDBAllButton, aButtonFont); + setLargerFont(mxImpressAllButton, aButtonFont); + setLargerFont(mxMathAllButton, aButtonFont); + setLargerFont(mxCreateLabel, aLabelFont); + + mxAllButtonsBox->set_background(aButtonsBackground); + mxSmallButtonsBox->set_background(aButtonsBackground); // compute the menubar height sal_Int32 nMenuHeight = 0; @@ -259,25 +304,6 @@ void BackingWindow::initializeLocalView() } } -void BackingWindow::setupButton(weld::Button& rButton) -{ - // the buttons should have a bit bigger font - vcl::Font aFont(rButton.get_font()); - aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier)); - rButton.set_font(aFont); - rButton.connect_clicked( LINK( this, BackingWindow, ClickHdl ) ); -} - -void BackingWindow::setupButton(weld::MenuButton& rButton) -{ - vcl::Font aFont(rButton.get_font()); - aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier)); - rButton.set_font(aFont); - - rButton.connect_clicked(LINK(this, BackingWindow, ClickHdl)); - rButton.connect_selected(LINK(this, BackingWindow, MenuSelectHdl)); -} - void BackingWindow::checkInstalledModules() { SvtModuleOptions aModuleOpt; diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index f0a66edb5f77..391e582b9b22 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -78,9 +78,6 @@ class BackingWindow : public InterimItemWindow bool mbInitControls; std::unique_ptr<svt::AcceleratorExecute> mpAccExec; - void setupButton(weld::Button& rButton); - void setupButton(weld::MenuButton& rButton); - void dispatchURL(const OUString& i_rURL, const OUString& i_rTarget = OUString("_default"), const css::uno::Reference<css::frame::XDispatchProvider >& i_xProv = css::uno::Reference<css::frame::XDispatchProvider>(), @@ -100,6 +97,11 @@ class BackingWindow : public InterimItemWindow void checkInstalledModules(); + void DataChanged(const DataChangedEvent&) override; + + template <typename WidgetClass> void setLargerFont(WidgetClass&, const vcl::Font&); + void ApplyStyleSettings(); + public: explicit BackingWindow(vcl::Window* pParent); virtual ~BackingWindow() override; diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index b3ae786e97b0..21f00c62947a 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -1023,6 +1023,7 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings) Color aText = toColor(pal.color(QPalette::Active, QPalette::Text)); Color aBase = toColor(pal.color(QPalette::Active, QPalette::Base)); Color aButn = toColor(pal.color(QPalette::Active, QPalette::ButtonText)); + Color aMid = toColor(pal.color(QPalette::Active, QPalette::Mid)); Color aHigh = toColor(pal.color(QPalette::Active, QPalette::Highlight)); Color aHighText = toColor(pal.color(QPalette::Active, QPalette::HighlightedText)); Color aLink = toColor(pal.color(QPalette::Active, QPalette::Link)); @@ -1046,7 +1047,6 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings) style.SetFieldColor(aBase); style.SetWindowColor(aBase); style.SetActiveTabColor(aBase); - style.SetWorkspaceColor(aBase); style.SetAlternatingRowColor(toColor(pal.color(QPalette::Active, QPalette::AlternateBase))); // Buttons @@ -1078,9 +1078,14 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings) style.BatchSetBackgrounds(aBack); style.SetInactiveTabColor(aBack); + // Workspace + style.SetWorkspaceColor(aMid); + // Selection style.SetHighlightColor(aHigh); style.SetHighlightTextColor(aHighText); + style.SetActiveColor(aHigh); + style.SetActiveTextColor(aHighText); // Links style.SetLinkColor(aLink); |