Avoid some unnecessary gtk_widget_get_style() calls.
2007-01-27 Matthias Clasen <mclasen@redhat.com> * gtk/gtknotebook.c (gtk_notebook_draw_arrow): (gtk_notebook_draw_focus): Avoid some unnecessary gtk_widget_get_style() calls. svn path=/trunk/; revision=17229
This commit is contained in:
committed by
Matthias Clasen
parent
f560d06dd5
commit
85832deef3
@ -1,3 +1,9 @@
|
|||||||
|
2007-01-27 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtknotebook.c (gtk_notebook_draw_arrow):
|
||||||
|
(gtk_notebook_draw_focus): Avoid some unnecessary
|
||||||
|
gtk_widget_get_style() calls.
|
||||||
|
|
||||||
2007-01-27 Matthias Clasen <mclasen@redhat.com>
|
2007-01-27 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtktoolbar.c:
|
* gtk/gtktoolbar.c:
|
||||||
|
|||||||
@ -2996,24 +2996,27 @@ gtk_notebook_draw_focus (GtkWidget *widget,
|
|||||||
notebook->cur_page->tab_label->window == event->window)
|
notebook->cur_page->tab_label->window == event->window)
|
||||||
{
|
{
|
||||||
GtkNotebookPage *page;
|
GtkNotebookPage *page;
|
||||||
|
|
||||||
|
page = notebook->cur_page;
|
||||||
|
|
||||||
|
if (gtk_widget_intersect (page->tab_label, &event->area, NULL))
|
||||||
|
{
|
||||||
GdkRectangle area;
|
GdkRectangle area;
|
||||||
gint focus_width;
|
gint focus_width;
|
||||||
|
|
||||||
gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
|
gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
|
||||||
|
|
||||||
page = notebook->cur_page;
|
|
||||||
|
|
||||||
area.x = page->tab_label->allocation.x - focus_width;
|
area.x = page->tab_label->allocation.x - focus_width;
|
||||||
area.y = page->tab_label->allocation.y - focus_width;
|
area.y = page->tab_label->allocation.y - focus_width;
|
||||||
area.width = page->tab_label->allocation.width + 2 * focus_width;
|
area.width = page->tab_label->allocation.width + 2 * focus_width;
|
||||||
area.height = page->tab_label->allocation.height + 2 * focus_width;
|
area.height = page->tab_label->allocation.height + 2 * focus_width;
|
||||||
|
|
||||||
if (gtk_widget_intersect (page->tab_label, &event->area, NULL))
|
gtk_paint_focus (widget->style, event->window,
|
||||||
gtk_paint_focus (widget->style, event->window, GTK_WIDGET_STATE (widget),
|
GTK_WIDGET_STATE (widget), NULL, widget, "tab",
|
||||||
NULL, widget, "tab",
|
|
||||||
area.x, area.y, area.width, area.height);
|
area.x, area.y, area.width, area.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_notebook_style_set (GtkWidget *widget,
|
gtk_notebook_style_set (GtkWidget *widget,
|
||||||
@ -4626,6 +4629,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook,
|
|||||||
GtkArrowType arrow;
|
GtkArrowType arrow;
|
||||||
gboolean is_rtl, left;
|
gboolean is_rtl, left;
|
||||||
|
|
||||||
|
if (GTK_WIDGET_DRAWABLE (notebook))
|
||||||
|
{
|
||||||
|
gint scroll_arrow_hlength;
|
||||||
|
gint scroll_arrow_vlength;
|
||||||
|
gint arrow_size;
|
||||||
|
|
||||||
gtk_notebook_get_arrow_rect (notebook, &arrow_rect, nbarrow);
|
gtk_notebook_get_arrow_rect (notebook, &arrow_rect, nbarrow);
|
||||||
|
|
||||||
widget = GTK_WIDGET (notebook);
|
widget = GTK_WIDGET (notebook);
|
||||||
@ -4634,12 +4643,6 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook,
|
|||||||
left = (ARROW_IS_LEFT (nbarrow) && !is_rtl) ||
|
left = (ARROW_IS_LEFT (nbarrow) && !is_rtl) ||
|
||||||
(!ARROW_IS_LEFT (nbarrow) && is_rtl);
|
(!ARROW_IS_LEFT (nbarrow) && is_rtl);
|
||||||
|
|
||||||
if (GTK_WIDGET_DRAWABLE (notebook))
|
|
||||||
{
|
|
||||||
gint scroll_arrow_hlength;
|
|
||||||
gint scroll_arrow_vlength;
|
|
||||||
gint arrow_size;
|
|
||||||
|
|
||||||
gtk_widget_style_get (widget,
|
gtk_widget_style_get (widget,
|
||||||
"scroll-arrow-hlength", &scroll_arrow_hlength,
|
"scroll-arrow-hlength", &scroll_arrow_hlength,
|
||||||
"scroll-arrow-vlength", &scroll_arrow_vlength,
|
"scroll-arrow-vlength", &scroll_arrow_vlength,
|
||||||
|
|||||||
Reference in New Issue
Block a user