Bug 393737 - GTK buttons should have a "default button" style if its the default button p=Michael Ventnor <ventnor.bugzilla@yahoo.com.au> r+sr=roc, a=pavlov

This commit is contained in:
asqueella@gmail.com 2007-09-02 09:38:54 -07:00
Родитель d70d5ee269
Коммит 484033b76a
2 изменённых файлов: 5 добавлений и 20 удалений

Просмотреть файл

@ -406,25 +406,8 @@ moz_gtk_button_paint(GdkDrawable* drawable, GdkRectangle* rect,
gtk_widget_set_state(widget, button_state); gtk_widget_set_state(widget, button_state);
/* if (state->isDefault)
* XXX fix this code when we have default state working. GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_DEFAULT);
if (state->isDefault) {
TSOffsetStyleGCs(style, x, y);
gtk_paint_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
cliprect, widget, "buttondefault", x, y, width, height);
}
if (state->canDefault) {
x += XTHICKNESS(style);
y += YTHICKNESS(style);
width -= 2 * x + default_spacing;
height -= 2 * y + default_spacing;
x += (1 + default_spacing) / 2;
y += (1 + default_spacing) / 2;
}
*/
if (!interior_focus && state->focused) { if (!interior_focus && state->focused) {
x += focus_width + focus_pad; x += focus_width + focus_pad;
@ -463,6 +446,7 @@ moz_gtk_button_paint(GdkDrawable* drawable, GdkRectangle* rect,
widget, "button", x, y, width, height); widget, "button", x, y, width, height);
} }
GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_DEFAULT);
return MOZ_GTK_SUCCESS; return MOZ_GTK_SUCCESS;
} }

Просмотреть файл

@ -224,7 +224,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
aState->active = (eventState & NS_EVENT_STATE_ACTIVE) == NS_EVENT_STATE_ACTIVE; aState->active = (eventState & NS_EVENT_STATE_ACTIVE) == NS_EVENT_STATE_ACTIVE;
aState->focused = (eventState & NS_EVENT_STATE_FOCUS) == NS_EVENT_STATE_FOCUS; aState->focused = (eventState & NS_EVENT_STATE_FOCUS) == NS_EVENT_STATE_FOCUS;
aState->inHover = (eventState & NS_EVENT_STATE_HOVER) == NS_EVENT_STATE_HOVER; aState->inHover = (eventState & NS_EVENT_STATE_HOVER) == NS_EVENT_STATE_HOVER;
aState->isDefault = FALSE; // XXX fix me aState->isDefault = IsDefaultButton(aFrame);
aState->canDefault = FALSE; // XXX fix me aState->canDefault = FALSE; // XXX fix me
if (aFrame && aFrame->GetContent()->IsNodeOfType(nsINode::eXUL)) { if (aFrame && aFrame->GetContent()->IsNodeOfType(nsINode::eXUL)) {
@ -891,6 +891,7 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType,
aAttribute == nsWidgetAtoms::selected || aAttribute == nsWidgetAtoms::selected ||
aAttribute == nsWidgetAtoms::focused || aAttribute == nsWidgetAtoms::focused ||
aAttribute == nsWidgetAtoms::readonly || aAttribute == nsWidgetAtoms::readonly ||
aAttribute == nsWidgetAtoms::_default ||
aAttribute == nsWidgetAtoms::mozmenuactive) aAttribute == nsWidgetAtoms::mozmenuactive)
*aShouldRepaint = PR_TRUE; *aShouldRepaint = PR_TRUE;
} }