[Libreoffice-commits] core.git: cui/source cui/uiconfig vcl/source

Michael Meeks michael.meeks at collabora.com
Thu Nov 5 01:50:04 PST 2015


 cui/source/options/optgdlg.cxx |   14 ++++++++++++++
 cui/source/options/optgdlg.hxx |    4 ++++
 cui/uiconfig/ui/optviewpage.ui |   32 ++++++++++++++++++++++++++++++--
 vcl/source/outdev/bitmap.cxx   |    2 +-
 4 files changed, 49 insertions(+), 3 deletions(-)

New commits:
commit b3f78806942d4e562b5f0f3ff866eca2f953ef4f
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Wed Nov 4 21:17:17 2015 +0000

    OpenGL options: clarify setting descriptions, and provide a live status.
    
    Hopefully this will un-confuse users about whether GL is enabled; the
    settings only take effect on re-start, so show a current status line too.
    
    Change-Id: I82832fd8d35bc76ab2cf1f394f11a881fde80774
    Reviewed-on: https://gerrit.libreoffice.org/19790
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index e4811b9..ca895cc 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -635,6 +635,8 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
     get(m_pUseAntiAliase, "useaa");
     get(m_pUseOpenGL, "useopengl");
     get(m_pForceOpenGL, "forceopengl");
+    get(m_pOpenGLStatusEnabled, "openglenabled");
+    get(m_pOpenGLStatusDisabled, "opengldisabled");
     get(m_pMousePosLB, "mousepos");
     get(m_pMouseMiddleLB, "mousemiddle");
 
@@ -676,6 +678,8 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
         m_pUseOpenGL->Enable(false);
     if (officecfg::Office::Common::VCL::ForceOpenGL::isReadOnly())
         m_pForceOpenGL->Enable(false);
+
+    UpdateOGLStatus();
 }
 
 OfaViewTabPage::~OfaViewTabPage()
@@ -703,6 +707,8 @@ void OfaViewTabPage::dispose()
     m_pUseAntiAliase.clear();
     m_pUseOpenGL.clear();
     m_pForceOpenGL.clear();
+    m_pOpenGLStatusEnabled.clear();
+    m_pOpenGLStatusDisabled.clear();
     m_pMousePosLB.clear();
     m_pMouseMiddleLB.clear();
     SfxTabPage::dispose();
@@ -972,6 +978,14 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
 #endif
 }
 
+void OfaViewTabPage::UpdateOGLStatus()
+{
+    // Easier than a custom translation string.
+    bool bEnabled = OpenGLWrapper::isVCLOpenGLEnabled();
+    m_pOpenGLStatusEnabled->Show(bEnabled);
+    m_pOpenGLStatusDisabled->Show(!bEnabled);
+}
+
 struct LanguageConfig_Impl
 {
     SvtLanguageOptions aLanguageOptions;
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 658b89c..5f12c5d 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -97,6 +97,9 @@ private:
     VclPtr<CheckBox>       m_pUseOpenGL;
     VclPtr<CheckBox>       m_pForceOpenGL;
 
+    VclPtr<FixedText>      m_pOpenGLStatusEnabled;
+    VclPtr<FixedText>      m_pOpenGLStatusDisabled;
+
     VclPtr<ListBox>        m_pMousePosLB;
     VclPtr<ListBox>        m_pMouseMiddleLB;
 
@@ -113,6 +116,7 @@ private:
 #if defined( UNX )
     DECL_LINK_TYPED( OnAntialiasingToggled, CheckBox&, void );
 #endif
+    void UpdateOGLStatus();
 
 public:
     OfaViewTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index 273a0e8..39508c4 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -88,7 +88,7 @@
                     </child>
                     <child>
                       <object class="GtkCheckButton" id="useopengl">
-                        <property name="label" translatable="yes">Use OpenGL for all rendering</property>
+                        <property name="label" translatable="yes">Use OpenGL for all rendering (on restart)</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
@@ -104,7 +104,7 @@
                     </child>
                     <child>
                       <object class="GtkCheckButton" id="forceopengl">
-                        <property name="label" translatable="yes">Force OpenGL even if blacklisted</property>
+                        <property name="label" translatable="yes">Force OpenGL even if blacklisted (on restart)</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
@@ -119,6 +119,34 @@
                         <property name="height">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkLabel" id="openglenabled">
+                        <property name="visible">Galse</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Current GL status: Enabled</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">4</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="opengldisabled">
+                        <property name="visible">False</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Current GL status: Disabled</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">5</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
                   </object>
                 </child>
               </object>
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 9834347..a2e30aa 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -666,7 +666,7 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
             SalBitmap* pSalSrcBmp = rBmp.ImplGetImpBitmap()->ImplGetSalBitmap();
             SalBitmap* pSalAlphaBmp = rAlpha.ImplGetImpBitmap()->ImplGetSalBitmap();
 
-            // try the blen the alpha bitmap with the alpha virtual device
+            // try to blend the alpha bitmap with the alpha virtual device
             if (mpAlphaVDev)
             {
                 Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( aRelPt, aOutSz ) );


More information about the Libreoffice-commits mailing list