Kaydet (Commit) eeb9e6bf authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Luboš Luňák

tdf#97822 vcl opengl gtk2: fix missing list node widget

OpenGL just sets GtkSalGraphics::bNeedPixmapPaint to true, and the
problem is specific to that flag (can be also enabled via
SAL_GTK_USE_PIXMAPPAINT=1).

Most other widgets are painted correctly in the GL case as they pass
around a drawable explicitly; do the same for ControlType::ListNode as
well in the GL case. The non-GL case still needs to go via the pixmap
render macros to have correct position, leave that unchanged.

(cherry picked from commit fb9c7e31)

Change-Id: Ia82a6772e357b434d706e58664be3a8427e91669
Reviewed-on: https://gerrit.libreoffice.org/70762
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 9da59611
...@@ -384,7 +384,7 @@ protected: ...@@ -384,7 +384,7 @@ protected:
bool NWPaintGTKSlider( ControlPart nPart, bool NWPaintGTKSlider( ControlPart nPart,
const tools::Rectangle& rControlRectangle, const tools::Rectangle& rControlRectangle,
ControlState nState, const ImplControlValue& aValue ); ControlState nState, const ImplControlValue& aValue );
bool NWPaintGTKListNode( bool NWPaintGTKListNode( GdkDrawable* gdkDrawable,
const tools::Rectangle& rControlRectangle, const tools::Rectangle& rControlRectangle,
ControlState nState, const ImplControlValue& aValue ); ControlState nState, const ImplControlValue& aValue );
}; };
......
...@@ -1018,7 +1018,7 @@ bool GtkSalGraphics::DoDrawNativeControl( ...@@ -1018,7 +1018,7 @@ bool GtkSalGraphics::DoDrawNativeControl(
} }
else if( (nType == ControlType::ListNode) && (nPart == ControlPart::Entire) ) else if( (nType == ControlType::ListNode) && (nPart == ControlPart::Entire) )
{ {
return NWPaintGTKListNode( aCtrlRect, nState, aValue ); return NWPaintGTKListNode( pDrawable, aCtrlRect, nState, aValue );
} }
else if( (nType == ControlType::ListNet) && (nPart == ControlPart::Entire) ) else if( (nType == ControlType::ListNet) && (nPart == ControlPart::Entire) )
{ {
...@@ -3345,7 +3345,18 @@ bool GtkSalGraphics::NWPaintGTKTooltip( ...@@ -3345,7 +3345,18 @@ bool GtkSalGraphics::NWPaintGTKTooltip(
return true; return true;
} }
namespace
{
void NWPaintGTKListNodeReal(SalX11Screen nXScreen, GdkDrawable* gdkDrawable, GtkStateType stateType,
gint w, int h, GtkExpanderStyle eStyle)
{
gtk_paint_expander(gWidgetData[nXScreen].gTreeView->style, gdkDrawable, stateType, nullptr,
gWidgetData[nXScreen].gTreeView, "treeview", w / 2, h / 2, eStyle);
}
}
bool GtkSalGraphics::NWPaintGTKListNode( bool GtkSalGraphics::NWPaintGTKListNode(
GdkDrawable* gdkDrawable,
const tools::Rectangle& rControlRectangle, const tools::Rectangle& rControlRectangle,
ControlState nState, const ImplControlValue& rValue ) ControlState nState, const ImplControlValue& rValue )
{ {
...@@ -3375,16 +3386,15 @@ bool GtkSalGraphics::NWPaintGTKListNode( ...@@ -3375,16 +3386,15 @@ bool GtkSalGraphics::NWPaintGTKListNode(
break; break;
} }
if (GtkSalGraphics::bNeedPixmapPaint)
{
NWPaintGTKListNodeReal(m_nXScreen, gdkDrawable, stateType, w, h, eStyle);
return true;
}
BEGIN_PIXMAP_RENDER( aRect, pixDrawable ) BEGIN_PIXMAP_RENDER( aRect, pixDrawable )
{ {
gtk_paint_expander( gWidgetData[m_nXScreen].gTreeView->style, NWPaintGTKListNodeReal(m_nXScreen, pixDrawable, stateType, w, h, eStyle);
pixDrawable,
stateType,
nullptr,
gWidgetData[m_nXScreen].gTreeView,
"treeview",
w/2, h/2,
eStyle );
} }
END_PIXMAP_RENDER( aRect ) END_PIXMAP_RENDER( aRect )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment