diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-05-04 11:50:03 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-05-04 15:53:59 +0200 |
commit | 9dc7b88f5d3a3af0307b4ae39a01247677907d80 (patch) | |
tree | e0859676e8c8998f2cbe818f9f075f28aca44d89 /cui | |
parent | 2a9ea3c978f039d8ed9689f925860d07fbb4b717 (diff) |
remove checkboxes for enabling OpenGL
The expert options still stay, but the checkboxes are a bit confusing
when also the Skia checkbox is there, Skia is for now the default,
and if Skia drawing goes well then the OpenGL drawing method can
be slowly phased out.
Change-Id: Iaea7e471f27010291abedb644d4728189345e3b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93408
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 141 | ||||
-rw-r--r-- | cui/source/options/optgdlg.hxx | 8 | ||||
-rw-r--r-- | cui/uiconfig/ui/optviewpage.ui | 66 |
3 files changed, 5 insertions, 210 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index e0a95eea2282..8c9210474ce7 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -104,86 +104,6 @@ using namespace ::utl; namespace svt { -class OpenGLCfg -{ -private: - bool mbUseOpenGL; - bool mbForceOpenGL; - bool mbModified; - -public: - OpenGLCfg(); - ~OpenGLCfg(); - - bool useOpenGL() const; - bool forceOpenGL() const; - - void setUseOpenGL(bool bOpenGL); - void setForceOpenGL(bool bOpenGL); - - void reset(); -}; - -OpenGLCfg::OpenGLCfg(): - mbModified(false) -{ - reset(); -} - -void OpenGLCfg::reset() -{ - mbUseOpenGL = officecfg::Office::Common::VCL::UseOpenGL::get(); - mbForceOpenGL = officecfg::Office::Common::VCL::ForceOpenGL::get(); - mbModified = false; -} - -OpenGLCfg::~OpenGLCfg() -{ - if (!mbModified) - return; - - try - { - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - if (!officecfg::Office::Common::VCL::UseOpenGL::isReadOnly()) - officecfg::Office::Common::VCL::UseOpenGL::set(mbUseOpenGL, batch); - if (!officecfg::Office::Common::VCL::ForceOpenGL::isReadOnly()) - officecfg::Office::Common::VCL::ForceOpenGL::set(mbForceOpenGL, batch); - batch->commit(); - } - catch (...) - { - } -} - -bool OpenGLCfg::useOpenGL() const -{ - return mbUseOpenGL; -} - -bool OpenGLCfg::forceOpenGL() const -{ - return mbForceOpenGL; -} - -void OpenGLCfg::setUseOpenGL(bool bOpenGL) -{ - if (bOpenGL != mbUseOpenGL) - { - mbUseOpenGL = bOpenGL; - mbModified = true; - } -} - -void OpenGLCfg::setForceOpenGL(bool bOpenGL) -{ - if (mbForceOpenGL != bOpenGL) - { - mbForceOpenGL = bOpenGL; - mbModified = true; - } -} - class SkiaCfg { private: @@ -761,7 +681,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p , pAppearanceCfg(new SvtTabAppearanceCfg) , pCanvasSettings(new CanvasSettings) , mpDrawinglayerOpt(new SvtOptionsDrawinglayer) - , mpOpenGLConfig(new svt::OpenGLCfg) , mpSkiaConfig(new svt::SkiaCfg) , m_xIconSizeLB(m_xBuilder->weld_combo_box("iconsize")) , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box("sidebariconsize")) @@ -776,13 +695,9 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p , m_xFontShowCB(m_xBuilder->weld_check_button("showfontpreview")) , m_xUseHardwareAccell(m_xBuilder->weld_check_button("useaccel")) , m_xUseAntiAliase(m_xBuilder->weld_check_button("useaa")) - , m_xUseOpenGL(m_xBuilder->weld_check_button("useopengl")) - , m_xForceOpenGL(m_xBuilder->weld_check_button("forceopengl")) , m_xUseSkia(m_xBuilder->weld_check_button("useskia")) , m_xForceSkia(m_xBuilder->weld_check_button("forceskia")) , m_xForceSkiaRaster(m_xBuilder->weld_check_button("forceskiaraster")) - , m_xOpenGLStatusEnabled(m_xBuilder->weld_label("openglenabled")) - , m_xOpenGLStatusDisabled(m_xBuilder->weld_label("opengldisabled")) , m_xSkiaStatusEnabled(m_xBuilder->weld_label("skiaenabled")) , m_xSkiaStatusDisabled(m_xBuilder->weld_label("skiadisabled")) , m_xMousePosLB(m_xBuilder->weld_combo_box("mousepos")) @@ -790,10 +705,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p { if (Application::GetToolkitName() == "gtk3") { - m_xUseOpenGL->hide(); - m_xForceOpenGL->hide(); - m_xOpenGLStatusEnabled->hide(); - m_xOpenGLStatusDisabled->hide(); m_xUseSkia->hide(); m_xForceSkia->hide(); m_xForceSkiaRaster->hide(); @@ -804,7 +715,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p m_xFontAntiAliasing->connect_toggled( LINK( this, OfaViewTabPage, OnAntialiasingToggled ) ); - m_xForceOpenGL->connect_toggled(LINK(this, OfaViewTabPage, OnForceOpenGLToggled)); m_xForceSkia->connect_toggled(LINK(this, OfaViewTabPage, OnForceSkiaToggled)); m_xForceSkiaRaster->connect_toggled(LINK(this, OfaViewTabPage, OnForceSkiaRasterToggled)); @@ -833,10 +743,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p m_xIconStyleLB->set_active(0); // FIXME: should really add code to show a 'lock' icon here. - if (officecfg::Office::Common::VCL::UseOpenGL::isReadOnly()) - m_xUseOpenGL->set_sensitive(false); - if (officecfg::Office::Common::VCL::ForceOpenGL::isReadOnly()) - m_xForceOpenGL->set_sensitive(false); if (officecfg::Office::Common::VCL::UseSkia::isReadOnly()) m_xUseSkia->set_sensitive(false); if (officecfg::Office::Common::VCL::ForceSkia::isReadOnly()) @@ -844,7 +750,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p if (officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly()) m_xForceSkiaRaster->set_sensitive(false); - UpdateOGLStatus(); UpdateSkiaStatus(); } @@ -860,15 +765,6 @@ IMPL_LINK_NOARG( OfaViewTabPage, OnAntialiasingToggled, weld::ToggleButton&, voi m_xAAPointLimit->set_sensitive(bAAEnabled); } -IMPL_LINK_NOARG(OfaViewTabPage, OnForceOpenGLToggled, weld::ToggleButton&, void) -{ - if (m_xForceOpenGL->get_active()) - { - // Ignoring the opengl blacklist implies that opengl is on. - m_xUseOpenGL->set_active(true); - } -} - IMPL_LINK_NOARG(OfaViewTabPage, OnForceSkiaToggled, weld::ToggleButton&, void) { if (m_xForceSkia->get_active()) @@ -1043,14 +939,6 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) } } - if (m_xUseOpenGL->get_state_changed_from_saved() || - m_xForceOpenGL->get_state_changed_from_saved()) - { - mpOpenGLConfig->setUseOpenGL(m_xUseOpenGL->get_active()); - mpOpenGLConfig->setForceOpenGL(m_xForceOpenGL->get_active()); - bModified = true; - } - if (m_xUseSkia->get_state_changed_from_saved() || m_xForceSkia->get_state_changed_from_saved() || m_xForceSkiaRaster->get_state_changed_from_saved()) @@ -1088,16 +976,6 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) } } - if (m_xUseOpenGL->get_state_changed_from_saved() || - m_xForceOpenGL->get_state_changed_from_saved()) - { - SolarMutexGuard aGuard; - if( svtools::executeRestartDialog( - comphelper::getProcessComponentContext(), nullptr, - svtools::RESTART_REASON_OPENGL)) - GetDialogController()->response(RET_OK); - } - if (m_xUseSkia->get_state_changed_from_saved() || m_xForceSkia->get_state_changed_from_saved() || m_xForceSkiaRaster->get_state_changed_from_saved()) @@ -1115,7 +993,6 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) void OfaViewTabPage::Reset( const SfxItemSet* ) { SvtMiscOptions aMiscOptions; - mpOpenGLConfig->reset(); mpSkiaConfig->reset(); if (aMiscOptions.GetSymbolsSize() != SFX_SYMBOLS_SIZE_AUTO) @@ -1211,8 +1088,6 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) m_xUseAntiAliase->save_state(); } - m_xUseOpenGL->set_active(mpOpenGLConfig->useOpenGL()); - m_xForceOpenGL->set_active(mpOpenGLConfig->forceOpenGL()); m_xUseSkia->set_active(mpSkiaConfig->useSkia()); m_xForceSkia->set_active(mpSkiaConfig->forceSkia()); m_xForceSkiaRaster->set_active(mpSkiaConfig->forceSkiaRaster()); @@ -1221,8 +1096,6 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) m_xAAPointLimit->save_value(); m_xFontShowCB->save_state(); - m_xUseOpenGL->save_state(); - m_xForceOpenGL->save_state(); m_xUseSkia->save_state(); m_xForceSkia->save_state(); m_xForceSkiaRaster->save_state(); @@ -1230,20 +1103,6 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) OnAntialiasingToggled(*m_xFontAntiAliasing); } -void OfaViewTabPage::UpdateOGLStatus() -{ - if (Application::GetToolkitName() == "gtk3") - return; - // Easier than a custom translation string. -#if HAVE_FEATURE_OPENGL - bool bEnabled = OpenGLWrapper::isVCLOpenGLEnabled(); -#else - bool bEnabled = false; -#endif - m_xOpenGLStatusEnabled->set_visible(bEnabled); - m_xOpenGLStatusDisabled->set_visible(!bEnabled); -} - void OfaViewTabPage::UpdateSkiaStatus() { if (Application::GetToolkitName() == "gtk3") diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index 08eb2eab73b1..8ddec9631087 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -30,7 +30,6 @@ namespace vcl { } namespace svt { - class OpenGLCfg; class SkiaCfg; } @@ -90,7 +89,6 @@ private: std::unique_ptr<SvtTabAppearanceCfg> pAppearanceCfg; std::unique_ptr<CanvasSettings> pCanvasSettings; std::unique_ptr<SvtOptionsDrawinglayer> mpDrawinglayerOpt; - std::unique_ptr<svt::OpenGLCfg> mpOpenGLConfig; std::unique_ptr<svt::SkiaCfg> mpSkiaConfig; std::vector<vcl::IconThemeInfo> mInstalledIconThemes; @@ -113,14 +111,10 @@ private: std::unique_ptr<weld::CheckButton> m_xUseHardwareAccell; std::unique_ptr<weld::CheckButton> m_xUseAntiAliase; - std::unique_ptr<weld::CheckButton> m_xUseOpenGL; - std::unique_ptr<weld::CheckButton> m_xForceOpenGL; std::unique_ptr<weld::CheckButton> m_xUseSkia; std::unique_ptr<weld::CheckButton> m_xForceSkia; std::unique_ptr<weld::CheckButton> m_xForceSkiaRaster; - std::unique_ptr<weld::Label> m_xOpenGLStatusEnabled; - std::unique_ptr<weld::Label> m_xOpenGLStatusDisabled; std::unique_ptr<weld::Label> m_xSkiaStatusEnabled; std::unique_ptr<weld::Label> m_xSkiaStatusDisabled; @@ -128,10 +122,8 @@ private: std::unique_ptr<weld::ComboBox> m_xMouseMiddleLB; DECL_LINK(OnAntialiasingToggled, weld::ToggleButton&, void); - DECL_LINK(OnForceOpenGLToggled, weld::ToggleButton&, void); DECL_LINK(OnForceSkiaToggled, weld::ToggleButton&, void); DECL_LINK(OnForceSkiaRasterToggled, weld::ToggleButton&, void); - void UpdateOGLStatus(); void UpdateSkiaStatus(); public: diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui index 096b0cb92a6d..f21b1ccdb629 100644 --- a/cui/uiconfig/ui/optviewpage.ui +++ b/cui/uiconfig/ui/optviewpage.ui @@ -510,62 +510,6 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="useopengl"> - <property name="label" translatable="yes" context="optviewpage|useopengl">Use OpenGL for all rendering</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="forceopengl"> - <property name="label" translatable="yes" context="optviewpage|forceopengl">Ignore OpenGL blacklist</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes" context="optviewpage|forceopengl|tooltip_text">Requires restart. Enabling this may expose driver bugs</property> - <property name="halign">start</property> - <property name="margin_left">12</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="openglenabled"> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="margin_left">12</property> - <property name="label" translatable="yes" context="optviewpage|openglenabled">GL is currently enabled.</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="opengldisabled"> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="margin_left">12</property> - <property name="label" translatable="yes" context="optviewpage|opengldisabled">GL is currently disabled.</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">5</property> - </packing> - </child> - <child> <object class="GtkCheckButton" id="useskia"> <property name="label" translatable="yes" context="optviewpage|useskia">Use Skia for all rendering</property> <property name="visible">True</property> @@ -577,7 +521,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">2</property> </packing> </child> <child> @@ -594,7 +538,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -611,7 +555,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">8</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -623,7 +567,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">9</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -635,7 +579,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">10</property> + <property name="top_attach">6</property> </packing> </child> </object> |