8152968: JTree Collapse Buttons Clipped Off Under GTK
Reviewed-by: alexsch
This commit is contained in:
parent
190b31b133
commit
876a0a5b94
@ -1339,14 +1339,14 @@ class GTKPainter extends SynthPainter {
|
|||||||
Graphics g, int state, int x, int y, int w, int h) {
|
Graphics g, int state, int x, int y, int w, int h) {
|
||||||
ENGINE.paintExpander(g, context, Region.TREE,
|
ENGINE.paintExpander(g, context, Region.TREE,
|
||||||
GTKLookAndFeel.synthStateToGTKState(context.getRegion(), state),
|
GTKLookAndFeel.synthStateToGTKState(context.getRegion(), state),
|
||||||
ExpanderStyle.EXPANDED, "treeview", x, y, w, h);
|
ExpanderStyle.EXPANDED, "expander", x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void paintTreeCollapsedIcon(SynthContext context,
|
public void paintTreeCollapsedIcon(SynthContext context,
|
||||||
Graphics g, int state, int x, int y, int w, int h) {
|
Graphics g, int state, int x, int y, int w, int h) {
|
||||||
ENGINE.paintExpander(g, context, Region.TREE,
|
ENGINE.paintExpander(g, context, Region.TREE,
|
||||||
GTKLookAndFeel.synthStateToGTKState(context.getRegion(), state),
|
GTKLookAndFeel.synthStateToGTKState(context.getRegion(), state),
|
||||||
ExpanderStyle.COLLAPSED, "treeview", x, y, w, h);
|
ExpanderStyle.COLLAPSED, "expander", x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void paintCheckBoxIcon(SynthContext context,
|
public void paintCheckBoxIcon(SynthContext context,
|
||||||
|
@ -854,6 +854,12 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
|||||||
return indicatorSpacing + focusSize + focusPad;
|
return indicatorSpacing + focusSize + focusPad;
|
||||||
} else if (GTKLookAndFeel.is3() && "ComboBox.forceOpaque".equals(key)) {
|
} else if (GTKLookAndFeel.is3() && "ComboBox.forceOpaque".equals(key)) {
|
||||||
return true;
|
return true;
|
||||||
|
} else if ("Tree.expanderSize".equals(key)) {
|
||||||
|
Object value = getClassSpecificValue("expander-size");
|
||||||
|
if (value instanceof Integer) {
|
||||||
|
return (Integer)value + 4;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is it a stock icon ?
|
// Is it a stock icon ?
|
||||||
@ -1136,7 +1142,6 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
|||||||
CLASS_SPECIFIC_MAP.put("Slider.thumbWidth", "slider-length");
|
CLASS_SPECIFIC_MAP.put("Slider.thumbWidth", "slider-length");
|
||||||
CLASS_SPECIFIC_MAP.put("Slider.trackBorder", "trough-border");
|
CLASS_SPECIFIC_MAP.put("Slider.trackBorder", "trough-border");
|
||||||
CLASS_SPECIFIC_MAP.put("SplitPane.size", "handle-size");
|
CLASS_SPECIFIC_MAP.put("SplitPane.size", "handle-size");
|
||||||
CLASS_SPECIFIC_MAP.put("Tree.expanderSize", "expander-size");
|
|
||||||
CLASS_SPECIFIC_MAP.put("ScrollBar.thumbHeight", "slider-width");
|
CLASS_SPECIFIC_MAP.put("ScrollBar.thumbHeight", "slider-width");
|
||||||
CLASS_SPECIFIC_MAP.put("ScrollBar.width", "slider-width");
|
CLASS_SPECIFIC_MAP.put("ScrollBar.width", "slider-width");
|
||||||
CLASS_SPECIFIC_MAP.put("TextArea.caretForeground", "cursor-color");
|
CLASS_SPECIFIC_MAP.put("TextArea.caretForeground", "cursor-color");
|
||||||
|
@ -1586,13 +1586,17 @@ static void gtk3_paint_expander(WidgetType widget_type, GtkStateType state_type,
|
|||||||
fp_gtk_style_context_save (context);
|
fp_gtk_style_context_save (context);
|
||||||
|
|
||||||
GtkStateFlags flags = get_gtk_flags(state_type);
|
GtkStateFlags flags = get_gtk_flags(state_type);
|
||||||
|
if (expander_style == GTK_EXPANDER_EXPANDED) {
|
||||||
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
||||||
|
}
|
||||||
|
|
||||||
fp_gtk_style_context_set_state(context, flags);
|
fp_gtk_style_context_set_state(context, flags);
|
||||||
|
|
||||||
if (detail != 0) {
|
if (detail != 0) {
|
||||||
transform_detail_string(detail, context);
|
transform_detail_string(detail, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
fp_gtk_render_expander (context, cr, x, y, width, height);
|
fp_gtk_render_expander (context, cr, x + 2, y + 2, width - 4, height - 4);
|
||||||
|
|
||||||
fp_gtk_style_context_restore (context);
|
fp_gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user