cui/source/options/optopencl.cxx | 46 ++++++++++------------------- cui/source/options/optopencl.hxx | 12 ++----- include/vcl/weld.hxx | 2 + sd/source/ui/dlg/RemoteDialogClientBox.cxx | 3 + vcl/source/app/salvtables.cxx | 20 +++++++++--- vcl/unx/gtk3/gtk3gtkinst.cxx | 6 +++ 6 files changed, 46 insertions(+), 43 deletions(-)
New commits: commit e171aec015212aa295e5e1831474b8af636e477b Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jul 26 20:44:53 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Jul 27 12:51:24 2019 +0200 weld SvxOpenCLTabPage Change-Id: I8cc47aa63daa76794f1ec2e4fc7b64a1a0a18564 Reviewed-on: https://gerrit.libreoffice.org/76457 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index ba1ea2de7294..5131714e18c8 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -17,9 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <vcl/fixed.hxx> #include <vcl/svapp.hxx> -#include <vcl/window.hxx> #include <vcl/settings.hxx> #include <vcl/weld.hxx> #include <svl/zforlist.hxx> @@ -27,7 +25,6 @@ #include <opencl/openclwrapper.hxx> #include <officecfg/Office/Common.hxx> #include <svtools/restartdialog.hxx> -#include <svtools/simptabl.hxx> #include "optHeaderTabListbox.hxx" #include <com/sun/star/configuration/theDefaultProvider.hpp> @@ -40,39 +37,28 @@ #include <dialmgr.hxx> #include "optopencl.hxx" -SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) : - SfxTabPage(pParent, "OptOpenCLPage", "cui/ui/optopenclpage.ui", &rSet), - maConfig(OpenCLConfig::get()) +SvxOpenCLTabPage::SvxOpenCLTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "cui/ui/optopenclpage.ui", "OptOpenCLPage", &rSet) + , maConfig(OpenCLConfig::get()) + , mxUseOpenCL(m_xBuilder->weld_check_button("useopencl")) + , mxOclUsed(m_xBuilder->weld_label("openclused")) + , mxOclNotUsed(m_xBuilder->weld_label("openclnotused")) { - get(mpUseOpenCL, "useopencl"); - get(mpOclUsed,"openclused"); - get(mpOclNotUsed,"openclnotused"); - - mpUseOpenCL->Check(maConfig.mbUseOpenCL); - mpUseOpenCL->Enable(!officecfg::Office::Common::Misc::UseOpenCL::isReadOnly()); + mxUseOpenCL->set_active(maConfig.mbUseOpenCL); + mxUseOpenCL->set_sensitive(!officecfg::Office::Common::Misc::UseOpenCL::isReadOnly()); bool bCLUsed = openclwrapper::GPUEnv::isOpenCLEnabled(); - mpOclUsed->Show(bCLUsed); - mpOclNotUsed->Show(!bCLUsed); + mxOclUsed->set_visible(bCLUsed); + mxOclNotUsed->set_visible(!bCLUsed); } SvxOpenCLTabPage::~SvxOpenCLTabPage() { - disposeOnce(); -} - -void SvxOpenCLTabPage::dispose() -{ - mpUseOpenCL.clear(); - mpOclUsed.clear(); - mpOclNotUsed.clear(); - - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxOpenCLTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +VclPtr<SfxTabPage> SvxOpenCLTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxOpenCLTabPage>::Create(pParent.pParent, *rAttrSet); + return VclPtr<SvxOpenCLTabPage>::Create(pParent, *rAttrSet); } bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) @@ -80,8 +66,8 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) bool bModified = false; std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - if (mpUseOpenCL->IsValueChangedFromSaved()) - maConfig.mbUseOpenCL = mpUseOpenCL->IsChecked(); + if (mxUseOpenCL->get_state_changed_from_saved()) + maConfig.mbUseOpenCL = mxUseOpenCL->get_active(); if (maConfig != OpenCLConfig::get()) { @@ -105,8 +91,8 @@ void SvxOpenCLTabPage::Reset( const SfxItemSet* ) { maConfig = OpenCLConfig::get(); - mpUseOpenCL->Check(maConfig.mbUseOpenCL); - mpUseOpenCL->SaveValue(); + mxUseOpenCL->set_active(maConfig.mbUseOpenCL); + mxUseOpenCL->save_state(); } diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx index cc07698e50ca..ddb74e07643a 100644 --- a/cui/source/options/optopencl.hxx +++ b/cui/source/options/optopencl.hxx @@ -22,23 +22,19 @@ #include <opencl/openclconfig.hxx> #include <sfx2/tabdlg.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> class SvxOpenCLTabPage : public SfxTabPage { private: OpenCLConfig maConfig; - VclPtr<CheckBox> mpUseOpenCL; - - VclPtr<FixedText> mpOclUsed; - VclPtr<FixedText> mpOclNotUsed; + std::unique_ptr<weld::CheckButton> mxUseOpenCL; + std::unique_ptr<weld::Label> mxOclUsed; + std::unique_ptr<weld::Label> mxOclNotUsed; public: - SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SvxOpenCLTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxOpenCLTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); commit f9fee27333e97e2251fc9b9b56072abc77a227fd Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jul 26 10:54:05 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Jul 27 12:51:02 2019 +0200 enable setting a highlight bg (cherry picked from commit 9b618c846835abb1fe664b5951dffb3c133380fe) Change-Id: I44649a9e2b1b267b56c2a5691d23665e7df94a58 Reviewed-on: https://gerrit.libreoffice.org/76449 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d422c84193cc..95dd97e9418a 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -237,6 +237,8 @@ public: //make this widget look like a page in a notebook virtual void set_stack_background() = 0; + //make this widget look like it has a highlighted background + virtual void set_highlight_background() = 0; virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() = 0; diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 30dab80f999a..775047ae5e89 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -135,7 +135,10 @@ IMPL_LINK_NOARG(ClientBoxEntry, DeauthoriseHdl, weld::Button&, void) IMPL_LINK_NOARG(ClientBoxEntry, FocusHdl, weld::Widget&, void) { + if (ClientBoxEntry* pOldEntry = m_pClientBox->GetActiveEntry()) + pOldEntry->m_xContainer->set_stack_background(); m_pClientBox->setActive(this); + m_xContainer->set_highlight_background(); } } //namespace dp_gui diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 6f8d11cb7886..bf50e7bc6ce2 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -294,6 +294,15 @@ protected: virtual bool HandleKeyEventListener(VclWindowEvent& rEvent); virtual void HandleMouseEventListener(VclSimpleEvent& rEvent); + void set_background(const Color& rColor) + { + m_xWidget->SetControlBackground(rColor); + m_xWidget->SetBackground(m_xWidget->GetControlBackground()); + // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under" + // transparent children of the widget + m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN); + } + public: SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership) : m_xWidget(pWidget) @@ -681,11 +690,12 @@ public: virtual void set_stack_background() override { - m_xWidget->SetControlBackground(m_xWidget->GetSettings().GetStyleSettings().GetWindowColor()); - m_xWidget->SetBackground(m_xWidget->GetControlBackground()); - // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under" - // transparent children of the widget - m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN); + set_background(m_xWidget->GetSettings().GetStyleSettings().GetWindowColor());; + } + + virtual void set_highlight_background() override + { + set_background(m_xWidget->GetSettings().GetStyleSettings().GetHighlightColor());; } SystemWindow* getSystemWindow() diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index a846b16d6e17..5e5feb493c86 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2105,6 +2105,12 @@ public: set_background(&sColor); } + virtual void set_highlight_background() override + { + OUString sColor = Application::GetSettings().GetStyleSettings().GetHighlightColor().AsRGBHexString(); + set_background(&sColor); + } + virtual ~GtkInstanceWidget() override { if (m_pFocusEvent) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits