Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Sat, May 26, 2012 at 09:40:49PM +0400, Ruslan Kabatsayev wrote:
Hello,

Current GTK theming plugin renders toolbar buttons as non-flat
unconditionally. But some themes, e.g. oxygen-gtk expect toolbuttons
to be flat, and the desktop integration fails.
I'm attaching a patch to fix this. The patch has been tested with
oxygen-gtk(current master), QtCurve-GTK, Glossy and Simple themes.

Hi,

@@ -1155,8 +1155,31 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
 
NWEnsureGTKButton( m_nXScreen );
NWEnsureGTKToolbar( m_nXScreen );
-    NWConvertVCLStateToGTKState( nState, &stateType,
&shadowType );
-    NWSetWidgetState(
gWidgetData[m_nXScreen].gBtnWidget, nState,
stateType );
+
+    // Flat toolbutton has a bit bigger variety of
states than normal buttons, so handle it
differently
+    if(GTK_IS_TOGGLE_BUTTON(button))
+    {
+       if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))

This is equivalent to "if(nState & CTRL_STATE_PRESSED)", is it not?

+           shadowType=GTK_SHADOW_IN;
+       else
+           shadowType=GTK_SHADOW_OUT;
+
+       if(nState & CTRL_STATE_ROLLOVER)
+           stateType=GTK_STATE_PRELIGHT;
+       else
+           stateType=GTK_STATE_NORMAL;
+
+       if(nState & CTRL_STATE_PRESSED)
+       {
+           stateType=GTK_STATE_ACTIVE;
+           shadowType=GTK_SHADOW_IN;
+       }
+    }

It seems to me that this code could be used in
NWConvertVCLStateToGTKState (with the above modification), so there
would be no need for toggle button-specific code branch. Or am I missing
something?

D.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.