mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
bug 1261277 use GtkTextView to get an appropriate color for resizers r=acomminos
MozReview-Commit-ID: IhcjE7Aax8g --HG-- extra : rebase_source : bd1ec08134726b10626e69bd4d30b14b741bdde4
This commit is contained in:
parent
bd8bf4c81d
commit
1bc3b5e29b
@ -41,9 +41,9 @@ static GtkWidget* gComboBoxEntryArrowWidget;
|
||||
static GtkWidget* gHandleBoxWidget;
|
||||
static GtkWidget* gToolbarWidget;
|
||||
static GtkWidget* gFrameWidget;
|
||||
static GtkWidget* gStatusbarWidget;
|
||||
static GtkWidget* gProgressWidget;
|
||||
static GtkWidget* gTabWidget;
|
||||
static GtkWidget* gTextViewWidget;
|
||||
static GtkWidget* gTooltipWidget;
|
||||
static GtkWidget* gMenuBarWidget;
|
||||
static GtkWidget* gMenuBarItemWidget;
|
||||
@ -537,24 +537,12 @@ 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);
|
||||
gtk_container_add(GTK_CONTAINER(gStatusbarWidget), gFrameWidget);
|
||||
gtk_widget_realize(gFrameWidget);
|
||||
setup_widget_prototype(gFrameWidget);
|
||||
}
|
||||
return MOZ_GTK_SUCCESS;
|
||||
}
|
||||
@ -721,6 +709,17 @@ ensure_scrolled_window_widget()
|
||||
return MOZ_GTK_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_text_view_widget()
|
||||
{
|
||||
if (gTextViewWidget)
|
||||
return;
|
||||
|
||||
gTextViewWidget = gtk_text_view_new();
|
||||
ensure_scrolled_window_widget();
|
||||
gtk_container_add(GTK_CONTAINER(gScrolledWindowWidget), gTextViewWidget);
|
||||
}
|
||||
|
||||
gint
|
||||
moz_gtk_init()
|
||||
{
|
||||
@ -1964,11 +1963,16 @@ moz_gtk_resizer_paint(cairo_t *cr, GdkRectangle* rect,
|
||||
{
|
||||
GtkStyleContext* style;
|
||||
|
||||
ensure_frame_widget();
|
||||
gtk_widget_set_direction(gStatusbarWidget, GTK_TEXT_DIR_LTR);
|
||||
// gtk_render_handle() draws a background, so use GtkTextView and its
|
||||
// GTK_STYLE_CLASS_VIEW to match the background with textarea elements.
|
||||
// The resizer is drawn with shaded variants of the background color, and
|
||||
// so a transparent background would lead to a transparent resizer.
|
||||
ensure_text_view_widget();
|
||||
gtk_widget_set_direction(gTextViewWidget, GTK_TEXT_DIR_LTR);
|
||||
|
||||
style = gtk_widget_get_style_context(gStatusbarWidget);
|
||||
style = gtk_widget_get_style_context(gTextViewWidget);
|
||||
gtk_style_context_save(style);
|
||||
gtk_style_context_add_class(style, GTK_STYLE_CLASS_VIEW);
|
||||
gtk_style_context_add_class(style, GTK_STYLE_CLASS_GRIP);
|
||||
gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state));
|
||||
|
||||
@ -3441,10 +3445,10 @@ moz_gtk_shutdown()
|
||||
gComboBoxEntryTextareaWidget = NULL;
|
||||
gHandleBoxWidget = NULL;
|
||||
gToolbarWidget = NULL;
|
||||
gStatusbarWidget = NULL;
|
||||
gFrameWidget = NULL;
|
||||
gProgressWidget = NULL;
|
||||
gTabWidget = NULL;
|
||||
gTextViewWidget = nullptr;
|
||||
gTooltipWidget = NULL;
|
||||
gMenuBarWidget = NULL;
|
||||
gMenuBarItemWidget = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user