Bug 245497 - "statusbar displayed wrong (not obeying gtk theme)" [p=twanno@lycos.nl (Teune van Steeg) r+sr=roc a1.9=schrep]

This commit is contained in:
reed@reedloden.com 2007-11-14 23:35:41 -08:00
parent c42326c0c1
commit 6f573201e6
2 changed files with 22 additions and 8 deletions

View File

@ -70,6 +70,7 @@ static GtkWidget* gDropdownButtonWidget;
static GtkWidget* gHandleBoxWidget;
static GtkWidget* gToolbarWidget;
static GtkWidget* gFrameWidget;
static GtkWidget* gStatusbarWidget;
static GtkWidget* gProgressWidget;
static GtkWidget* gTabWidget;
static GtkWidget* gTooltipWidget;
@ -277,12 +278,24 @@ ensure_progress_widget()
return MOZ_GTK_SUCCESS;
}
static gint
ensure_statusbar_widget()
{
if (!gStatusbarWidget) {
gStatusbarWidget = gtk_statusbar_new();
setup_widget_prototype(gStatusbarWidget);
}
return MOZ_GTK_SUCCESS;
}
static gint
ensure_frame_widget()
{
if (!gFrameWidget) {
ensure_statusbar_widget();
gFrameWidget = gtk_frame_new(NULL);
setup_widget_prototype(gFrameWidget);
gtk_container_add(GTK_CONTAINER(gStatusbarWidget), gFrameWidget);
gtk_widget_realize(gFrameWidget);
}
return MOZ_GTK_SUCCESS;
}
@ -1369,18 +1382,16 @@ static gint
moz_gtk_frame_paint(GdkDrawable* drawable, GdkRectangle* rect,
GdkRectangle* cliprect)
{
GtkStyle* style = gProtoWindow->style;
TSOffsetStyleGCs(style, rect->x, rect->y);
gtk_paint_flat_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
NULL, gProtoWindow, "base", rect->x, rect->y,
rect->width, rect->height);
GtkStyle* style;
GtkShadowType shadow_type;
ensure_frame_widget();
style = gFrameWidget->style;
gtk_widget_style_get(gStatusbarWidget, "shadow-type", &shadow_type, NULL);
TSOffsetStyleGCs(style, rect->x, rect->y);
gtk_paint_shadow(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
gtk_paint_shadow(style, drawable, GTK_STATE_NORMAL, shadow_type,
cliprect, gFrameWidget, "frame", rect->x, rect->y,
rect->width, rect->height);
@ -2096,6 +2107,7 @@ moz_gtk_shutdown()
gDropdownButtonWidget = NULL;
gHandleBoxWidget = NULL;
gToolbarWidget = NULL;
gStatusbarWidget = NULL;
gFrameWidget = NULL;
gProgressWidget = NULL;
gTabWidget = NULL;

View File

@ -440,6 +440,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
aGtkWidgetType = MOZ_GTK_TOOLTIP;
break;
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
aGtkWidgetType = MOZ_GTK_FRAME;
break;
case NS_THEME_PROGRESSBAR:
@ -997,6 +998,7 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
case NS_THEME_TOOLBAR_GRIPPER:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_RESIZER:
case NS_THEME_LISTBOX:
// case NS_THEME_LISTBOX_LISTITEM: