Kaydet (Commit) 93571a90 authored tarafından Caolán McNamara's avatar Caolán McNamara

gtk3: checkmarks slightly clipped on left side

Change-Id: If10822b64e0a9a28c45fd8a1c0e9e44bdbfb054b
üst 2d1abfff
...@@ -787,13 +787,14 @@ void GtkSalGraphics::PaintCheckOrRadio(GtkStyleContext *context, ...@@ -787,13 +787,14 @@ void GtkSalGraphics::PaintCheckOrRadio(GtkStyleContext *context,
const Rectangle& rControlRectangle, const Rectangle& rControlRectangle,
ControlType nType) ControlType nType)
{ {
gint x, y, indicator_size; gint indicator_size;
gtk_style_context_get_style(mpCheckButtonStyle, gtk_style_context_get_style(mpCheckButtonStyle,
"indicator-size", &indicator_size, "indicator-size", &indicator_size,
NULL ); NULL);
gint x = (rControlRectangle.GetWidth() - indicator_size) / 2;
gint y = (rControlRectangle.GetHeight() - indicator_size) / 2;
x = (rControlRectangle.GetWidth() - indicator_size) / 2;
y = (rControlRectangle.GetHeight() - indicator_size) / 2;
if (nType == CTRL_CHECKBOX) if (nType == CTRL_CHECKBOX)
gtk_render_check(context, cr, x, y, indicator_size, indicator_size); gtk_render_check(context, cr, x, y, indicator_size, indicator_size);
else if (nType == CTRL_RADIOBUTTON) else if (nType == CTRL_RADIOBUTTON)
...@@ -1222,16 +1223,27 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar ...@@ -1222,16 +1223,27 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
if(((nType == CTRL_CHECKBOX) || (nType == CTRL_RADIOBUTTON)) && if(((nType == CTRL_CHECKBOX) || (nType == CTRL_RADIOBUTTON)) &&
nPart == PART_ENTIRE_CONTROL) nPart == PART_ENTIRE_CONTROL)
{ {
rNativeBoundingRegion = rControlRegion;
gtk_style_context_get_style( mpCheckButtonStyle, gtk_style_context_get_style( mpCheckButtonStyle,
"indicator-size", &indicator_size, "indicator-size", &indicator_size,
"indicator-spacing", &indicator_spacing, "indicator-spacing", &indicator_spacing,
(char *)NULL ); (char *)NULL );
gint size = indicator_size + indicator_spacing*2; GtkBorder border;
gtk_style_context_get_border(mpCheckButtonStyle, GTK_STATE_FLAG_NORMAL, &border);
GtkBorder padding;
gtk_style_context_get_padding(mpCheckButtonStyle, GTK_STATE_FLAG_NORMAL, &padding);
point = MAX(0, rControlRegion.GetHeight() - size);
aEditRect = Rectangle( Point( 0, point / 2), indicator_size += 2*indicator_spacing + border.left + padding.left + border.right + padding.right;
Size( size, size ) ); Rectangle aIndicatorRect( Point( 0,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
return true;
} }
else if( nType == CTRL_MENU_POPUP) else if( nType == CTRL_MENU_POPUP)
{ {
......
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