370 - gComboBoxEntryTextareaWidget = gEntryWidget; |
378 - gComboBoxEntryTextareaWidget = gEntryWidget; |
371 + gComboBoxEntryTextarea.widget = gEntry.widget; |
379 + gComboBoxEntryTextarea.widget = gEntry.widget; |
372 } |
380 } |
373 |
381 |
374 if (gComboBoxEntryButtonWidget) { |
382 if (gComboBoxEntryButtonWidget) { |
375 @@ -530,9 +721,21 @@ ensure_tab_widget() |
383 @@ -507,12 +703,18 @@ ensure_toolbar_separator_widget() |
|
384 static gint |
|
385 ensure_tooltip_widget() |
|
386 { |
|
387 - if (!gTooltipWidget) { |
|
388 - gTooltipWidget = gtk_window_new(GTK_WINDOW_POPUP); |
|
389 - GtkStyleContext* style = gtk_widget_get_style_context(gTooltipWidget); |
|
390 - gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP); |
|
391 - gtk_widget_realize(gTooltipWidget); |
|
392 - moz_gtk_set_widget_name(gTooltipWidget); |
|
393 + if (!gTooltip.widget) { |
|
394 + GtkCssNode path[] = { |
|
395 + { GTK_TYPE_TOOLTIP, "tooltip", NULL, NULL}, |
|
396 + { GTK_TYPE_TOOLTIP, "tooltip", "background", NULL}, |
|
397 + }; |
|
398 + |
|
399 + gTooltip.widget = gtk_window_new(GTK_WINDOW_POPUP); |
|
400 + gtk_widget_realize(gTooltip.widget); |
|
401 + moz_gtk_set_widget_name(gTooltip.widget); |
|
402 + |
|
403 + gTooltip.tooltip.style = moz_gtk_style_create(&path[0], NULL); |
|
404 + gTooltip.tooltip.styleBackground = moz_gtk_style_create(&path[1], NULL); |
|
405 } |
|
406 return MOZ_GTK_SUCCESS; |
|
407 } |
|
408 @@ -530,9 +732,21 @@ ensure_tab_widget() |
376 static gint |
409 static gint |
377 ensure_progress_widget() |
410 ensure_progress_widget() |
378 { |
411 { |
379 - if (!gProgressWidget) { |
412 - if (!gProgressWidget) { |
380 - gProgressWidget = gtk_progress_bar_new(); |
413 - gProgressWidget = gtk_progress_bar_new(); |
407 + }; |
440 + }; |
408 + |
441 + |
409 ensure_menu_popup_widget(); |
442 ensure_menu_popup_widget(); |
410 gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M"); |
443 gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M"); |
411 gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget), |
444 gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget), |
412 @@ -752,7 +960,7 @@ moz_gtk_checkbox_get_metrics(gint* indic |
445 @@ -752,7 +971,7 @@ moz_gtk_checkbox_get_metrics(gint* indic |
413 { |
446 { |
414 ensure_checkbox_widget(); |
447 ensure_checkbox_widget(); |
415 |
448 |
416 - gtk_widget_style_get (gCheckboxWidget, |
449 - gtk_widget_style_get (gCheckboxWidget, |
417 + gtk_widget_style_get (gCheckbox.widget, |
450 + gtk_widget_style_get (gCheckbox.widget, |
418 "indicator_size", indicator_size, |
451 "indicator_size", indicator_size, |
419 "indicator_spacing", indicator_spacing, |
452 "indicator_spacing", indicator_spacing, |
420 NULL); |
453 NULL); |
421 @@ -765,7 +973,7 @@ moz_gtk_radio_get_metrics(gint* indicato |
454 @@ -765,7 +984,7 @@ moz_gtk_radio_get_metrics(gint* indicato |
422 { |
455 { |
423 ensure_radiobutton_widget(); |
456 ensure_radiobutton_widget(); |
424 |
457 |
425 - gtk_widget_style_get (gRadiobuttonWidget, |
458 - gtk_widget_style_get (gRadiobuttonWidget, |
426 + gtk_widget_style_get (gRadiobutton.widget, |
459 + gtk_widget_style_get (gRadiobutton.widget, |
427 "indicator_size", indicator_size, |
460 "indicator_size", indicator_size, |
428 "indicator_spacing", indicator_spacing, |
461 "indicator_spacing", indicator_spacing, |
429 NULL); |
462 NULL); |
430 @@ -778,13 +986,12 @@ moz_gtk_get_focus_outline_size(gint* foc |
463 @@ -778,13 +997,13 @@ moz_gtk_get_focus_outline_size(gint* foc |
431 { |
464 { |
432 GtkBorder border; |
465 GtkBorder border; |
433 GtkBorder padding; |
466 GtkBorder padding; |
434 - GtkStyleContext *style; |
467 - GtkStyleContext *style; |
435 + GtkStyleContext* style = gEntry.entry.style; |
468 + GtkStyleContext* style; |
436 |
469 |
437 ensure_entry_widget(); |
470 ensure_entry_widget(); |
438 - style = gtk_widget_get_style_context(gEntryWidget); |
471 - style = gtk_widget_get_style_context(gEntryWidget); |
439 |
472 |
440 - gtk_style_context_get_border(style, 0, &border); |
473 - gtk_style_context_get_border(style, 0, &border); |
441 - gtk_style_context_get_padding(style, 0, &padding); |
474 - gtk_style_context_get_padding(style, 0, &padding); |
|
475 + style = gEntry.entry.style; |
442 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
476 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
443 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
477 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
444 *focus_h_width = border.left + padding.left; |
478 *focus_h_width = border.left + padding.left; |
445 *focus_v_width = border.top + padding.top; |
479 *focus_v_width = border.top + padding.top; |
446 return MOZ_GTK_SUCCESS; |
480 return MOZ_GTK_SUCCESS; |
447 @@ -821,7 +1028,7 @@ moz_gtk_button_get_default_overflow(gint |
481 @@ -821,7 +1040,7 @@ moz_gtk_button_get_default_overflow(gint |
448 GtkBorder* default_outside_border; |
482 GtkBorder* default_outside_border; |
449 |
483 |
450 ensure_button_widget(); |
484 ensure_button_widget(); |
451 - gtk_widget_style_get(gButtonWidget, |
485 - gtk_widget_style_get(gButtonWidget, |
452 + gtk_widget_style_get(gButton.widget, |
486 + gtk_widget_style_get(gButton.widget, |
453 "default-outside-border", &default_outside_border, |
487 "default-outside-border", &default_outside_border, |
454 NULL); |
488 NULL); |
455 |
489 |
456 @@ -844,7 +1051,7 @@ moz_gtk_button_get_default_border(gint* |
490 @@ -844,7 +1063,7 @@ moz_gtk_button_get_default_border(gint* |
457 GtkBorder* default_border; |
491 GtkBorder* default_border; |
458 |
492 |
459 ensure_button_widget(); |
493 ensure_button_widget(); |
460 - gtk_widget_style_get(gButtonWidget, |
494 - gtk_widget_style_get(gButtonWidget, |
461 + gtk_widget_style_get(gButton.widget, |
495 + gtk_widget_style_get(gButton.widget, |
462 "default-border", &default_border, |
496 "default-border", &default_border, |
463 NULL); |
497 NULL); |
464 |
498 |
465 @@ -935,7 +1142,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec |
499 @@ -935,7 +1154,7 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec |
466 |
500 |
467 if (state->focused) { |
501 if (state->focused) { |
468 GtkBorder border; |
502 GtkBorder border; |
469 - gtk_style_context_get_border(style, state_flags, &border); |
503 - gtk_style_context_get_border(style, state_flags, &border); |
470 + moz_gtk_get_style_border(style, state_flags, &border); |
504 + moz_gtk_get_style_border(style, state_flags, &border); |
471 x += border.left; |
505 x += border.left; |
472 y += border.top; |
506 y += border.top; |
473 width -= (border.left + border.right); |
507 width -= (border.left + border.right); |
474 @@ -956,15 +1163,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec |
508 @@ -956,15 +1175,14 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRec |
475 gint indicator_size, indicator_spacing; |
509 gint indicator_size, indicator_spacing; |
476 gint x, y, width, height; |
510 gint x, y, width, height; |
477 gint focus_x, focus_y, focus_width, focus_height; |
511 gint focus_x, focus_y, focus_width, focus_height; |
478 - GtkWidget *w; |
512 - GtkWidget *w; |
479 - GtkStyleContext *style; |
513 - GtkStyleContext *style; |
543 - gtk_style_context_restore(style); |
577 - gtk_style_context_restore(style); |
544 + gtk_style_context_restore(w->check.styleCheck); |
578 + gtk_style_context_restore(w->check.styleCheck); |
545 |
579 |
546 return MOZ_GTK_SUCCESS; |
580 return MOZ_GTK_SUCCESS; |
547 } |
581 } |
548 @@ -1035,8 +1240,8 @@ calculate_button_inner_rect(GtkWidget* b |
582 @@ -1035,8 +1252,8 @@ calculate_button_inner_rect(GtkWidget* b |
549 style = gtk_widget_get_style_context(button); |
583 style = gtk_widget_get_style_context(button); |
550 |
584 |
551 /* This mirrors gtkbutton's child positioning */ |
585 /* This mirrors gtkbutton's child positioning */ |
552 - gtk_style_context_get_border(style, 0, &border); |
586 - gtk_style_context_get_border(style, 0, &border); |
553 - gtk_style_context_get_padding(style, 0, &padding); |
587 - gtk_style_context_get_padding(style, 0, &padding); |
554 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
588 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
555 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
589 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
556 |
590 |
557 inner_rect->x = rect->x + border.left + padding.left; |
591 inner_rect->x = rect->x + border.left + padding.left; |
558 inner_rect->y = rect->y + padding.top + border.top; |
592 inner_rect->y = rect->y + padding.top + border.top; |
559 @@ -1099,9 +1304,9 @@ moz_gtk_scrollbar_button_paint(cairo_t * |
593 @@ -1099,9 +1316,9 @@ moz_gtk_scrollbar_button_paint(cairo_t * |
560 ensure_scrollbar_widget(); |
594 ensure_scrollbar_widget(); |
561 |
595 |
562 if (flags & MOZ_GTK_STEPPER_VERTICAL) |
596 if (flags & MOZ_GTK_STEPPER_VERTICAL) |
563 - scrollbar = gVertScrollbarWidget; |
597 - scrollbar = gVertScrollbarWidget; |
564 + scrollbar = gVertScrollbar.widget; |
598 + scrollbar = gVertScrollbar.widget; |
600 + style = gVertScrollbar.scroll.style; |
634 + style = gVertScrollbar.scroll.style; |
601 + } |
635 + } |
602 |
636 |
603 gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); |
637 gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); |
604 gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); |
638 gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); |
605 @@ -1208,7 +1410,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW |
639 @@ -1208,7 +1422,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeW |
606 gtk_render_focus(style, cr, |
640 gtk_render_focus(style, cr, |
607 rect->x, rect->y, rect->width, rect->height); |
641 rect->x, rect->y, rect->width, rect->height); |
608 } |
642 } |
609 - gtk_style_context_restore(style); |
643 - gtk_style_context_restore(style); |
610 return MOZ_GTK_SUCCESS; |
644 return MOZ_GTK_SUCCESS; |
611 } |
645 } |
612 |
646 |
613 @@ -1220,24 +1421,20 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi |
647 @@ -1220,24 +1433,20 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi |
614 { |
648 { |
615 GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); |
649 GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); |
616 GtkStyleContext* style; |
650 GtkStyleContext* style; |
617 - GtkScrollbar *scrollbar; |
651 - GtkScrollbar *scrollbar; |
618 GtkBorder margin; |
652 GtkBorder margin; |
641 gtk_style_context_set_state(style, state_flags); |
675 gtk_style_context_set_state(style, state_flags); |
642 - |
676 - |
643 gtk_style_context_get_margin (style, state_flags, &margin); |
677 gtk_style_context_get_margin (style, state_flags, &margin); |
644 |
678 |
645 gtk_render_slider(style, cr, |
679 gtk_render_slider(style, cr, |
646 @@ -1248,8 +1445,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi |
680 @@ -1248,8 +1457,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWi |
647 (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ? |
681 (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ? |
648 GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); |
682 GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); |
649 |
683 |
650 - gtk_style_context_restore(style); |
684 - gtk_style_context_restore(style); |
651 - |
685 - |
652 return MOZ_GTK_SUCCESS; |
686 return MOZ_GTK_SUCCESS; |
653 } |
687 } |
654 |
688 |
655 @@ -1260,8 +1455,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta |
689 @@ -1260,8 +1467,8 @@ moz_gtk_spin_paint(cairo_t *cr, GdkRecta |
656 GtkStyleContext* style; |
690 GtkStyleContext* style; |
657 |
691 |
658 ensure_spin_widget(); |
692 ensure_spin_widget(); |
659 - gtk_widget_set_direction(gSpinWidget, direction); |
693 - gtk_widget_set_direction(gSpinWidget, direction); |
660 - style = gtk_widget_get_style_context(gSpinWidget); |
694 - style = gtk_widget_get_style_context(gSpinWidget); |
661 + gtk_widget_set_direction(gSpin.widget, direction); |
695 + gtk_widget_set_direction(gSpin.widget, direction); |
662 + style = gSpin.spin.style; |
696 + style = gSpin.spin.style; |
663 gtk_style_context_save(style); |
697 gtk_style_context_save(style); |
664 gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON); |
698 gtk_style_context_add_class(style, GTK_STYLE_CLASS_SPINBUTTON); |
665 gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); |
699 gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); |
666 @@ -1280,11 +1475,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G |
700 @@ -1280,11 +1487,10 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G |
667 GtkStyleContext* style; |
701 GtkStyleContext* style; |
668 |
702 |
669 ensure_spin_widget(); |
703 ensure_spin_widget(); |
670 - style = gtk_widget_get_style_context(gSpinWidget); |
704 - style = gtk_widget_get_style_context(gSpinWidget); |
671 + style = gSpin.spin.style; |
705 + style = gSpin.spin.style; |
706 gtk_style_context_save(style); |
740 gtk_style_context_save(style); |
707 - gtk_style_context_add_class(style, GTK_STYLE_CLASS_ENTRY); |
741 - gtk_style_context_add_class(style, GTK_STYLE_CLASS_ENTRY); |
708 |
742 |
709 /* Now paint the shadow and focus border. |
743 /* Now paint the shadow and focus border. |
710 * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad |
744 * We do like in gtk_entry_draw_frame, we first draw the shadow, a tad |
711 @@ -1531,7 +1722,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR |
745 @@ -1531,7 +1734,7 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR |
712 style = gtk_widget_get_style_context(gScrolledWindowWidget); |
746 style = gtk_widget_get_style_context(gScrolledWindowWidget); |
713 gtk_style_context_save(style); |
747 gtk_style_context_save(style); |
714 gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME); |
748 gtk_style_context_add_class(style, GTK_STYLE_CLASS_FRAME); |
715 - gtk_style_context_get_border(style, state_flags, &border); |
749 - gtk_style_context_get_border(style, state_flags, &border); |
716 + moz_gtk_get_style_border(style, state_flags, &border); |
750 + moz_gtk_get_style_border(style, state_flags, &border); |
717 xthickness = border.left; |
751 xthickness = border.left; |
718 ythickness = border.top; |
752 ythickness = border.top; |
719 |
753 |
720 @@ -1702,7 +1893,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk |
754 @@ -1702,7 +1905,7 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk |
721 if (direction == GTK_TEXT_DIR_LTR) { |
755 if (direction == GTK_TEXT_DIR_LTR) { |
722 GtkBorder padding; |
756 GtkBorder padding; |
723 GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); |
757 GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); |
724 - gtk_style_context_get_padding(style, state_flags, &padding); |
758 - gtk_style_context_get_padding(style, state_flags, &padding); |
725 + moz_gtk_get_style_padding(style, state_flags, &padding); |
759 + moz_gtk_get_style_padding(style, state_flags, &padding); |
726 arrow_rect.x -= padding.left; |
760 arrow_rect.x -= padding.left; |
727 } |
761 } |
728 else |
762 else |
729 @@ -1804,29 +1995,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk |
763 @@ -1804,29 +2007,27 @@ moz_gtk_container_paint(cairo_t *cr, Gdk |
730 gboolean isradio, GtkTextDirection direction) |
764 gboolean isradio, GtkTextDirection direction) |
731 { |
765 { |
732 GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); |
766 GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); |
733 - GtkStyleContext* style; |
767 - GtkStyleContext* style; |
734 - GtkWidget *widget; |
768 - GtkWidget *widget; |
804 - gtk_style_context_restore(style); |
838 - gtk_style_context_restore(style); |
805 + gtk_style_context_restore(widget->check.styleLabel); |
839 + gtk_style_context_restore(widget->check.styleLabel); |
806 |
840 |
807 return MOZ_GTK_SUCCESS; |
841 return MOZ_GTK_SUCCESS; |
808 } |
842 } |
809 @@ -1922,7 +2105,7 @@ moz_gtk_toolbar_separator_paint(cairo_t |
843 @@ -1922,7 +2117,7 @@ moz_gtk_toolbar_separator_paint(cairo_t |
810 rect->height * (end_fraction - start_fraction)); |
844 rect->height * (end_fraction - start_fraction)); |
811 } else { |
845 } else { |
812 GtkBorder padding; |
846 GtkBorder padding; |
813 - gtk_style_context_get_padding(style, 0, &padding); |
847 - gtk_style_context_get_padding(style, 0, &padding); |
814 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
848 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
815 |
849 |
816 paint_width = padding.left; |
850 paint_width = padding.left; |
817 if (paint_width > rect->width) |
851 if (paint_width > rect->width) |
818 @@ -2006,18 +2189,13 @@ static gint |
852 @@ -1945,9 +2140,9 @@ moz_gtk_tooltip_paint(cairo_t *cr, GdkRe |
|
853 GtkStyleContext* style; |
|
854 |
|
855 ensure_tooltip_widget(); |
|
856 - gtk_widget_set_direction(gTooltipWidget, direction); |
|
857 + gtk_widget_set_direction(gTooltip.widget, direction); |
|
858 |
|
859 - style = gtk_widget_get_style_context(gTooltipWidget); |
|
860 + style = gTooltip.tooltip.styleBackground; |
|
861 gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); |
|
862 gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); |
|
863 return MOZ_GTK_SUCCESS; |
|
864 @@ -2006,18 +2201,13 @@ static gint |
819 moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect, |
865 moz_gtk_progressbar_paint(cairo_t *cr, GdkRectangle* rect, |
820 GtkTextDirection direction) |
866 GtkTextDirection direction) |
821 { |
867 { |
822 - GtkStyleContext* style; |
868 - GtkStyleContext* style; |
823 - |
869 - |
873 } |
919 } |
874 - gtk_style_context_restore(style); |
920 - gtk_style_context_restore(style); |
875 |
921 |
876 return MOZ_GTK_SUCCESS; |
922 return MOZ_GTK_SUCCESS; |
877 } |
923 } |
878 @@ -2096,7 +2269,7 @@ moz_gtk_get_tab_thickness(void) |
924 @@ -2096,7 +2281,7 @@ moz_gtk_get_tab_thickness(void) |
879 |
925 |
880 style = gtk_widget_get_style_context(gTabWidget); |
926 style = gtk_widget_get_style_context(gTabWidget); |
881 gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK); |
927 gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK); |
882 - gtk_style_context_get_border(style, 0, &border); |
928 - gtk_style_context_get_border(style, 0, &border); |
883 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
929 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
884 |
930 |
885 if (border.top < 2) |
931 if (border.top < 2) |
886 return 2; /* some themes don't set ythickness correctly */ |
932 return 2; /* some themes don't set ythickness correctly */ |
887 @@ -2292,7 +2465,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan |
933 @@ -2292,7 +2477,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan |
888 gtk_style_context_save(style); |
934 gtk_style_context_save(style); |
889 moz_gtk_tab_prepare_style_context(style, flags); |
935 moz_gtk_tab_prepare_style_context(style, flags); |
890 |
936 |
891 - gtk_style_context_get_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding); |
937 - gtk_style_context_get_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding); |
892 + moz_gtk_get_style_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding); |
938 + moz_gtk_get_style_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding); |
893 |
939 |
894 focusRect.x += padding.left; |
940 focusRect.x += padding.left; |
895 focusRect.width -= (padding.left + padding.right); |
941 focusRect.width -= (padding.left + padding.right); |
896 @@ -2408,7 +2581,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t * |
942 @@ -2408,7 +2593,7 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t * |
897 } |
943 } |
898 |
944 |
899 static gint |
945 static gint |
900 -moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, |
946 -moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, |
901 +moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state, |
947 +moz_gtk_menu_bar_paint(cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state, |
902 GtkTextDirection direction) |
948 GtkTextDirection direction) |
903 { |
949 { |
904 GtkStyleContext* style; |
950 GtkStyleContext* style; |
905 @@ -2468,7 +2641,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr |
951 @@ -2468,7 +2653,7 @@ moz_gtk_menu_separator_paint(cairo_t *cr |
906 border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); |
952 border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); |
907 |
953 |
908 style = gtk_widget_get_style_context(gMenuSeparatorWidget); |
954 style = gtk_widget_get_style_context(gMenuSeparatorWidget); |
909 - gtk_style_context_get_padding(style, 0, &padding); |
955 - gtk_style_context_get_padding(style, 0, &padding); |
910 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
956 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
911 |
957 |
912 x = rect->x + border_width; |
958 x = rect->x + border_width; |
913 y = rect->y + border_width; |
959 y = rect->y + border_width; |
914 @@ -2521,7 +2694,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk |
960 @@ -2521,7 +2706,8 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk |
915 item_widget = gMenuItemWidget; |
961 item_widget = gMenuItemWidget; |
916 } |
962 } |
917 style = gtk_widget_get_style_context(item_widget); |
963 style = gtk_widget_get_style_context(item_widget); |
918 - gtk_style_context_save(style); |
964 - gtk_style_context_save(style); |
919 +// TODO - FIX! |
965 +// TODO - FIX! |
920 +// gtk_style_context_save(style); |
966 +// gtk_style_context_save(style); |
921 |
967 |
922 if (flags & MOZ_TOPLEVEL_MENU_ITEM) { |
968 if (flags & MOZ_TOPLEVEL_MENU_ITEM) { |
923 gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR); |
969 gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR); |
924 @@ -2540,7 +2714,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk |
970 @@ -2540,7 +2726,7 @@ moz_gtk_menu_item_paint(cairo_t *cr, Gdk |
925 |
971 |
926 gtk_render_background(style, cr, x, y, w, h); |
972 gtk_render_background(style, cr, x, y, w, h); |
927 gtk_render_frame(style, cr, x, y, w, h); |
973 gtk_render_frame(style, cr, x, y, w, h); |
928 - gtk_style_context_restore(style); |
974 - gtk_style_context_restore(style); |
929 +// gtk_style_context_restore(style); |
975 +// gtk_style_context_restore(style); |
930 } |
976 } |
931 |
977 |
932 return MOZ_GTK_SUCCESS; |
978 return MOZ_GTK_SUCCESS; |
933 @@ -2556,7 +2730,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd |
979 @@ -2556,7 +2742,10 @@ moz_gtk_menu_arrow_paint(cairo_t *cr, Gd |
934 |
980 |
935 ensure_menu_item_widget(); |
981 ensure_menu_item_widget(); |
936 gtk_widget_set_direction(gMenuItemWidget, direction); |
982 gtk_widget_set_direction(gMenuItemWidget, direction); |
937 - |
983 - |
938 +/* |
984 +/* |
940 + GTK_STATE_FLAG_DIR_RTL; |
986 + GTK_STATE_FLAG_DIR_RTL; |
941 +*/ |
987 +*/ |
942 style = gtk_widget_get_style_context(gMenuItemWidget); |
988 style = gtk_widget_get_style_context(gMenuItemWidget); |
943 gtk_style_context_save(style); |
989 gtk_style_context_save(style); |
944 gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM); |
990 gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUITEM); |
945 @@ -2606,7 +2783,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c |
991 @@ -2606,7 +2795,7 @@ moz_gtk_check_menu_item_paint(cairo_t *c |
946 } |
992 } |
947 |
993 |
948 gtk_style_context_set_state(style, state_flags); |
994 gtk_style_context_set_state(style, state_flags); |
949 - gtk_style_context_get_padding(style, state_flags, &padding); |
995 - gtk_style_context_get_padding(style, state_flags, &padding); |
950 + moz_gtk_get_style_padding(style, state_flags, &padding); |
996 + moz_gtk_get_style_padding(style, state_flags, &padding); |
951 |
997 |
952 offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) + |
998 offset = gtk_container_get_border_width(GTK_CONTAINER(gCheckMenuItemWidget)) + |
953 padding.left + 2; |
999 padding.left + 2; |
954 @@ -2658,7 +2835,7 @@ moz_gtk_add_style_border(GtkStyleContext |
1000 @@ -2658,7 +2847,7 @@ moz_gtk_add_style_border(GtkStyleContext |
955 { |
1001 { |
956 GtkBorder border; |
1002 GtkBorder border; |
957 |
1003 |
958 - gtk_style_context_get_border(style, 0, &border); |
1004 - gtk_style_context_get_border(style, 0, &border); |
959 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
1005 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
960 |
1006 |
961 *left += border.left; |
1007 *left += border.left; |
962 *right += border.right; |
1008 *right += border.right; |
963 @@ -2667,12 +2844,22 @@ moz_gtk_add_style_border(GtkStyleContext |
1009 @@ -2667,12 +2856,22 @@ moz_gtk_add_style_border(GtkStyleContext |
964 } |
1010 } |
965 |
1011 |
966 static void |
1012 static void |
967 +moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags, |
1013 +moz_gtk_get_style_border(GtkStyleContext* style, GtkStateFlags state_flags, |
968 + GtkBorder *border) |
1014 + GtkBorder *border) |
1037 // XXX: Subtract 1 pixel from the padding to account for the default |
1083 // XXX: Subtract 1 pixel from the padding to account for the default |
1038 // padding in forms.css. See bug 1187385. |
1084 // padding in forms.css. See bug 1187385. |
1039 *left = *top = *right = *bottom = -1; |
1085 *left = *top = *right = *bottom = -1; |
1040 - moz_gtk_add_style_padding(style, left, top, right, bottom); |
1086 - moz_gtk_add_style_padding(style, left, top, right, bottom); |
1041 - moz_gtk_add_style_border(style, left, top, right, bottom); |
1087 - moz_gtk_add_style_border(style, left, top, right, bottom); |
1042 + |
1088 |
1043 + moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom); |
1089 + moz_gtk_add_style_padding(gEntry.entry.style, left, top, right, bottom); |
1044 + moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom); |
1090 + moz_gtk_add_style_border(gEntry.entry.style, left, top, right, bottom); |
1045 |
1091 + |
|
1092 + return MOZ_GTK_SUCCESS; |
|
1093 + } |
|
1094 + case MOZ_GTK_TOOLTIP: |
|
1095 + { |
|
1096 + ensure_tooltip_widget(); |
|
1097 + moz_gtk_add_style_padding(gTooltip.tooltip.styleBackground, left, top, right, bottom); |
|
1098 + moz_gtk_add_style_border(gTooltip.tooltip.styleBackground, left, top, right, bottom); |
1046 return MOZ_GTK_SUCCESS; |
1099 return MOZ_GTK_SUCCESS; |
1047 } |
1100 } |
1048 @@ -2759,7 +2947,7 @@ moz_gtk_get_widget_border(GtkThemeWidget |
1101 case MOZ_GTK_TREEVIEW: |
|
1102 @@ -2759,7 +2966,7 @@ moz_gtk_get_widget_border(GtkThemeWidget |
1049 break; |
1103 break; |
1050 case MOZ_GTK_DROPDOWN_ENTRY: |
1104 case MOZ_GTK_DROPDOWN_ENTRY: |
1051 ensure_combo_box_entry_widgets(); |
1105 ensure_combo_box_entry_widgets(); |
1052 - w = gComboBoxEntryTextareaWidget; |
1106 - w = gComboBoxEntryTextareaWidget; |
1053 + w = gComboBoxEntryTextarea.widget; |
1107 + w = gComboBoxEntryTextarea.widget; |
1054 break; |
1108 break; |
1055 case MOZ_GTK_DROPDOWN_ARROW: |
1109 case MOZ_GTK_DROPDOWN_ARROW: |
1056 ensure_combo_box_entry_widgets(); |
1110 ensure_combo_box_entry_widgets(); |
1057 @@ -2795,7 +2983,7 @@ moz_gtk_get_widget_border(GtkThemeWidget |
1111 @@ -2795,7 +3002,7 @@ moz_gtk_get_widget_border(GtkThemeWidget |
1058 |
1112 |
1059 if (!wide_separators) { |
1113 if (!wide_separators) { |
1060 style = gtk_widget_get_style_context(gComboBoxSeparatorWidget); |
1114 style = gtk_widget_get_style_context(gComboBoxSeparatorWidget); |
1061 - gtk_style_context_get_border(style, 0, &border); |
1115 - gtk_style_context_get_border(style, 0, &border); |
1062 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
1116 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
1063 separator_width = border.left; |
1117 separator_width = border.left; |
1064 } |
1118 } |
1065 } |
1119 } |
1066 @@ -2814,14 +3002,17 @@ moz_gtk_get_widget_border(GtkThemeWidget |
1120 @@ -2814,14 +3021,17 @@ moz_gtk_get_widget_border(GtkThemeWidget |
1067 w = gTabWidget; |
1121 w = gTabWidget; |
1068 break; |
1122 break; |
1069 case MOZ_GTK_PROGRESSBAR: |
1123 case MOZ_GTK_PROGRESSBAR: |
1070 - ensure_progress_widget(); |
1124 - ensure_progress_widget(); |
1071 - w = gProgressWidget; |
1125 - w = gProgressWidget; |
1133 + |
1195 + |
1134 +gint |
1196 +gint |
1135 moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height) |
1197 moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height) |
1136 { |
1198 { |
1137 gint arrow_size; |
1199 gint arrow_size; |
1138 @@ -3030,7 +3248,7 @@ moz_gtk_get_toolbar_separator_width(gint |
1200 @@ -3030,7 +3266,7 @@ moz_gtk_get_toolbar_separator_width(gint |
1139 "separator-width", &separator_width, |
1201 "separator-width", &separator_width, |
1140 NULL); |
1202 NULL); |
1141 /* Just in case... */ |
1203 /* Just in case... */ |
1142 - gtk_style_context_get_border(style, 0, &border); |
1204 - gtk_style_context_get_border(style, 0, &border); |
1143 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
1205 + gtk_style_context_get_border(style, gtk_style_context_get_state(style), &border); |
1144 *size = MAX(*size, (wide_separators ? separator_width : border.left)); |
1206 *size = MAX(*size, (wide_separators ? separator_width : border.left)); |
1145 return MOZ_GTK_SUCCESS; |
1207 return MOZ_GTK_SUCCESS; |
1146 } |
1208 } |
1147 @@ -3072,7 +3290,7 @@ moz_gtk_get_menu_separator_height(gint * |
1209 @@ -3072,7 +3308,7 @@ moz_gtk_get_menu_separator_height(gint * |
1148 border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); |
1210 border_width = gtk_container_get_border_width(GTK_CONTAINER(gMenuSeparatorWidget)); |
1149 |
1211 |
1150 style = gtk_widget_get_style_context(gMenuSeparatorWidget); |
1212 style = gtk_widget_get_style_context(gMenuSeparatorWidget); |
1151 - gtk_style_context_get_padding(style, 0, &padding); |
1213 - gtk_style_context_get_padding(style, 0, &padding); |
1152 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
1214 + gtk_style_context_get_padding(style, gtk_style_context_get_state(style), &padding); |
1153 |
1215 |
1154 gtk_style_context_save(style); |
1216 gtk_style_context_save(style); |
1155 gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR); |
1217 gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR); |
1156 @@ -3130,15 +3348,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro |
1218 @@ -3130,15 +3366,21 @@ moz_gtk_get_scrollbar_metrics(MozGtkScro |
1157 { |
1219 { |
1158 ensure_scrollbar_widget(); |
1220 ensure_scrollbar_widget(); |
1159 |
1221 |
1160 - gtk_widget_style_get (gHorizScrollbarWidget, |
1222 - gtk_widget_style_get (gHorizScrollbarWidget, |
1161 + gtk_widget_style_get (gHorizScrollbar.widget, |
1223 + gtk_widget_style_get (gHorizScrollbar.widget, |
1176 + gtk_range_get_min_slider_size(GTK_RANGE(gVertScrollbar.widget)); |
1238 + gtk_range_get_min_slider_size(GTK_RANGE(gVertScrollbar.widget)); |
1177 + } |
1239 + } |
1178 |
1240 |
1179 return MOZ_GTK_SUCCESS; |
1241 return MOZ_GTK_SUCCESS; |
1180 } |
1242 } |
1181 @@ -3163,7 +3387,7 @@ moz_gtk_images_in_buttons() |
1243 @@ -3163,7 +3405,7 @@ moz_gtk_images_in_buttons() |
1182 GtkSettings* settings; |
1244 GtkSettings* settings; |
1183 |
1245 |
1184 ensure_button_widget(); |
1246 ensure_button_widget(); |
1185 - settings = gtk_widget_get_settings(gButtonWidget); |
1247 - settings = gtk_widget_get_settings(gButtonWidget); |
1186 + settings = gtk_widget_get_settings(gButton.widget); |
1248 + settings = gtk_widget_get_settings(gButton.widget); |
1187 |
1249 |
1188 g_object_get(settings, "gtk-button-images", &result, NULL); |
1250 g_object_get(settings, "gtk-button-images", &result, NULL); |
1189 return result; |
1251 return result; |
1190 @@ -3191,7 +3415,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1252 @@ -3191,7 +3433,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1191 } |
1253 } |
1192 ensure_button_widget(); |
1254 ensure_button_widget(); |
1193 return moz_gtk_button_paint(cr, rect, state, |
1255 return moz_gtk_button_paint(cr, rect, state, |
1194 - (GtkReliefStyle) flags, gButtonWidget, |
1256 - (GtkReliefStyle) flags, gButtonWidget, |
1195 + (GtkReliefStyle) flags, gButton.widget, |
1257 + (GtkReliefStyle) flags, gButton.widget, |
1196 direction); |
1258 direction); |
1197 break; |
1259 break; |
1198 case MOZ_GTK_CHECKBUTTON: |
1260 case MOZ_GTK_CHECKBUTTON: |
1199 @@ -3241,7 +3465,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1261 @@ -3241,7 +3483,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1200 case MOZ_GTK_SPINBUTTON_ENTRY: |
1262 case MOZ_GTK_SPINBUTTON_ENTRY: |
1201 ensure_spin_widget(); |
1263 ensure_spin_widget(); |
1202 return moz_gtk_entry_paint(cr, rect, state, |
1264 return moz_gtk_entry_paint(cr, rect, state, |
1203 - gSpinWidget, direction); |
1265 - gSpinWidget, direction); |
1204 + &gSpin, direction); |
1266 + &gSpin, direction); |
1205 break; |
1267 break; |
1206 case MOZ_GTK_GRIPPER: |
1268 case MOZ_GTK_GRIPPER: |
1207 return moz_gtk_gripper_paint(cr, rect, state, |
1269 return moz_gtk_gripper_paint(cr, rect, state, |
1208 @@ -3268,7 +3492,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1270 @@ -3268,7 +3510,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1209 case MOZ_GTK_ENTRY: |
1271 case MOZ_GTK_ENTRY: |
1210 ensure_entry_widget(); |
1272 ensure_entry_widget(); |
1211 return moz_gtk_entry_paint(cr, rect, state, |
1273 return moz_gtk_entry_paint(cr, rect, state, |
1212 - gEntryWidget, direction); |
1274 - gEntryWidget, direction); |
1213 + &gEntry, direction); |
1275 + &gEntry, direction); |
1214 break; |
1276 break; |
1215 case MOZ_GTK_DROPDOWN: |
1277 case MOZ_GTK_DROPDOWN: |
1216 return moz_gtk_combo_box_paint(cr, rect, state, direction); |
1278 return moz_gtk_combo_box_paint(cr, rect, state, direction); |
1217 @@ -3280,7 +3504,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1279 @@ -3280,7 +3522,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1218 case MOZ_GTK_DROPDOWN_ENTRY: |
1280 case MOZ_GTK_DROPDOWN_ENTRY: |
1219 ensure_combo_box_entry_widgets(); |
1281 ensure_combo_box_entry_widgets(); |
1220 return moz_gtk_entry_paint(cr, rect, state, |
1282 return moz_gtk_entry_paint(cr, rect, state, |
1221 - gComboBoxEntryTextareaWidget, direction); |
1283 - gComboBoxEntryTextareaWidget, direction); |
1222 + &gComboBoxEntryTextarea, direction); |
1284 + &gComboBoxEntryTextarea, direction); |
1223 break; |
1285 break; |
1224 case MOZ_GTK_CHECKBUTTON_CONTAINER: |
1286 case MOZ_GTK_CHECKBUTTON_CONTAINER: |
1225 case MOZ_GTK_RADIOBUTTON_CONTAINER: |
1287 case MOZ_GTK_RADIOBUTTON_CONTAINER: |
1226 @@ -3332,7 +3556,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1288 @@ -3332,7 +3574,7 @@ moz_gtk_widget_paint(GtkThemeWidgetType |
1227 (GtkArrowType) flags, direction); |
1289 (GtkArrowType) flags, direction); |
1228 break; |
1290 break; |
1229 case MOZ_GTK_MENUBAR: |
1291 case MOZ_GTK_MENUBAR: |
1230 - return moz_gtk_menu_bar_paint(cr, rect, direction); |
1292 - return moz_gtk_menu_bar_paint(cr, rect, direction); |
1231 + return moz_gtk_menu_bar_paint(cr, rect, state, direction); |
1293 + return moz_gtk_menu_bar_paint(cr, rect, state, direction); |
1232 break; |
1294 break; |
1233 case MOZ_GTK_MENUPOPUP: |
1295 case MOZ_GTK_MENUPOPUP: |
1234 return moz_gtk_menu_popup_paint(cr, rect, direction); |
1296 return moz_gtk_menu_popup_paint(cr, rect, direction); |
1235 @@ -3383,7 +3607,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget( |
1297 @@ -3383,7 +3625,7 @@ GtkWidget* moz_gtk_get_scrollbar_widget( |
1236 { |
1298 { |
1237 MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); |
1299 MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); |
1238 ensure_scrollbar_widget(); |
1300 ensure_scrollbar_widget(); |
1239 - return gHorizScrollbarWidget; |
1301 - return gHorizScrollbarWidget; |
1240 + return gVertScrollbar.widget; |
1302 + return gVertScrollbar.widget; |
1241 } |
1303 } |
1242 |
1304 |
1243 gboolean moz_gtk_has_scrollbar_buttons(void) |
1305 gboolean moz_gtk_has_scrollbar_buttons(void) |
1244 @@ -3391,7 +3615,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v |
1306 @@ -3391,7 +3633,7 @@ gboolean moz_gtk_has_scrollbar_buttons(v |
1245 gboolean backward, forward, secondary_backward, secondary_forward; |
1307 gboolean backward, forward, secondary_backward, secondary_forward; |
1246 MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); |
1308 MOZ_ASSERT(is_initialized, "Forgot to call moz_gtk_init()"); |
1247 ensure_scrollbar_widget(); |
1309 ensure_scrollbar_widget(); |
1248 - gtk_widget_style_get (gHorizScrollbarWidget, |
1310 - gtk_widget_style_get (gHorizScrollbarWidget, |
1249 + gtk_widget_style_get (gHorizScrollbar.widget, |
1311 + gtk_widget_style_get (gHorizScrollbar.widget, |
1250 "has-backward-stepper", &backward, |
1312 "has-backward-stepper", &backward, |
1251 "has-forward-stepper", &forward, |
1313 "has-forward-stepper", &forward, |
1252 "has-secondary-backward-stepper", &secondary_backward, |
1314 "has-secondary-backward-stepper", &secondary_backward, |
1253 @@ -3415,17 +3639,19 @@ moz_gtk_shutdown() |
1315 @@ -3403,8 +3645,8 @@ gboolean moz_gtk_has_scrollbar_buttons(v |
|
1316 gint |
|
1317 moz_gtk_shutdown() |
|
1318 { |
|
1319 - if (gTooltipWidget) |
|
1320 - gtk_widget_destroy(gTooltipWidget); |
|
1321 + moz_gtk_widget_free(&gTooltip); |
|
1322 + |
|
1323 /* This will destroy all of our widgets */ |
|
1324 if (gProtoWindow) |
|
1325 gtk_widget_destroy(gProtoWindow); |
|
1326 @@ -3415,17 +3657,19 @@ moz_gtk_shutdown() |
1254 |
1327 |
1255 gProtoWindow = NULL; |
1328 gProtoWindow = NULL; |
1256 gProtoLayout = NULL; |
1329 gProtoLayout = NULL; |
1257 - gButtonWidget = NULL; |
1330 - gButtonWidget = NULL; |
1258 + |
1331 + |
1345 +STUB(gtk_spin_button_get_type) |
1420 +STUB(gtk_spin_button_get_type) |
1346 +STUB(gtk_button_get_type) |
1421 +STUB(gtk_button_get_type) |
1347 #endif |
1422 #endif |
1348 |
1423 |
1349 #ifdef GTK3_SYMBOLS |
1424 #ifdef GTK3_SYMBOLS |
1350 @@ -581,6 +586,13 @@ STUB(gtk_color_chooser_get_type) |
1425 @@ -581,6 +586,14 @@ STUB(gtk_color_chooser_get_type) |
1351 STUB(gtk_color_chooser_set_rgba) |
1426 STUB(gtk_color_chooser_set_rgba) |
1352 STUB(gtk_color_chooser_get_rgba) |
1427 STUB(gtk_color_chooser_get_rgba) |
1353 STUB(gtk_color_chooser_set_use_alpha) |
1428 STUB(gtk_color_chooser_set_use_alpha) |
1354 +STUB(gtk_style_context_get_path) |
1429 +STUB(gtk_style_context_get_path) |
1355 +STUB(gtk_widget_path_copy) |
1430 +STUB(gtk_widget_path_copy) |
1356 +STUB(gtk_widget_path_iter_set_object_name) |
1431 +STUB(gtk_widget_path_iter_set_object_name) |
1357 +STUB(gtk_widget_path_iter_add_class) |
1432 +STUB(gtk_widget_path_iter_add_class) |
1358 +STUB(gtk_widget_path_iter_get_state) |
1433 +STUB(gtk_widget_path_iter_get_state) |
1359 +STUB(gtk_style_context_set_parent) |
1434 +STUB(gtk_style_context_set_parent) |
1360 +STUB(gtk_widget_path_unref) |
1435 +STUB(gtk_widget_path_unref) |
|
1436 +STUB(gtk_tooltip_get_type) |
1361 #endif |
1437 #endif |
1362 |
1438 |
1363 #ifdef GTK2_SYMBOLS |
1439 #ifdef GTK2_SYMBOLS |
1364 diff -up firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0/widget/gtk/nsLookAndFeel.cpp |
1440 diff -up firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp |
1365 --- firefox-46.0/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-04-22 02:37:27.000000000 +0200 |
1441 --- firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp.gtk3-20 2016-05-03 07:31:12.000000000 +0200 |
1366 +++ firefox-46.0/widget/gtk/nsLookAndFeel.cpp 2016-04-25 14:18:25.000000000 +0200 |
1442 +++ firefox-46.0.1/widget/gtk/nsLookAndFeel.cpp 2016-05-20 13:53:54.085049707 +0200 |
1367 @@ -353,14 +353,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI |
1443 @@ -353,14 +353,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI |
1368 case eColorID_activeborder: |
1444 case eColorID_activeborder: |
1369 // active window border |
1445 // active window border |
1370 gtk_style_context_get_border_color(mBackgroundStyle, |
1446 gtk_style_context_get_border_color(mBackgroundStyle, |
1371 - GTK_STATE_FLAG_NORMAL, &gdk_color); |
1447 - GTK_STATE_FLAG_NORMAL, &gdk_color); |
1417 &gdk_color); |
1493 &gdk_color); |
1418 + gtk_style_context_restore(mButtonStyle); |
1494 + gtk_style_context_restore(mButtonStyle); |
1419 aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); |
1495 aColor = GDK_RGBA_TO_NS_RGBA(gdk_color); |
1420 break; |
1496 break; |
1421 case eColorID__moz_buttonhovertext: |
1497 case eColorID__moz_buttonhovertext: |
1422 @@ -1110,7 +1121,7 @@ nsLookAndFeel::Init() |
1498 @@ -1110,27 +1126,29 @@ nsLookAndFeel::Init() |
1423 style = create_context(path); |
1499 style = create_context(path); |
1424 gtk_style_context_add_class(style, GTK_STYLE_CLASS_SCROLLBAR); |
1500 gtk_style_context_add_class(style, GTK_STYLE_CLASS_SCROLLBAR); |
1425 gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH); |
1501 gtk_style_context_add_class(style, GTK_STYLE_CLASS_TROUGH); |
1426 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1502 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1427 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1503 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1428 sMozScrollbar = GDK_RGBA_TO_NS_RGBA(color); |
1504 sMozScrollbar = GDK_RGBA_TO_NS_RGBA(color); |
1429 g_object_unref(style); |
1505 g_object_unref(style); |
1430 |
1506 |
1431 @@ -1118,18 +1129,18 @@ nsLookAndFeel::Init() |
1507 // Window colors |
1432 style = create_context(path); |
1508 style = create_context(path); |
1433 gtk_style_context_save(style); |
1509 - gtk_style_context_save(style); |
1434 gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); |
1510 gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); |
1435 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1511 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1436 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1512 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1437 sMozWindowBackground = GDK_RGBA_TO_NS_RGBA(color); |
1513 sMozWindowBackground = GDK_RGBA_TO_NS_RGBA(color); |
1438 - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1514 - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1439 + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); |
1515 + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); |
1440 sMozWindowText = GDK_RGBA_TO_NS_RGBA(color); |
1516 sMozWindowText = GDK_RGBA_TO_NS_RGBA(color); |
1441 gtk_style_context_restore(style); |
1517 - gtk_style_context_restore(style); |
|
1518 + g_object_unref(style); |
1442 |
1519 |
1443 // tooltip foreground and background |
1520 // tooltip foreground and background |
1444 gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP); |
1521 - gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP); |
|
1522 + GtkCssNode tooltipPath[] = { |
|
1523 + { GTK_TYPE_TOOLTIP, "tooltip", NULL, NULL}, |
|
1524 + }; |
|
1525 + style = moz_gtk_style_create(tooltipPath, NULL); |
|
1526 + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); |
|
1527 + sInfoText = GDK_RGBA_TO_NS_RGBA(color); |
1445 gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); |
1528 gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND); |
1446 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1529 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1447 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1530 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1448 sInfoBackground = GDK_RGBA_TO_NS_RGBA(color); |
1531 sInfoBackground = GDK_RGBA_TO_NS_RGBA(color); |
1449 - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1532 - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1450 + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); |
1533 - sInfoText = GDK_RGBA_TO_NS_RGBA(color); |
1451 sInfoText = GDK_RGBA_TO_NS_RGBA(color); |
|
1452 g_object_unref(style); |
1534 g_object_unref(style); |
1453 |
1535 |
1454 @@ -1144,20 +1155,26 @@ nsLookAndFeel::Init() |
1536 // menu foreground & menu background |
|
1537 @@ -1144,20 +1162,26 @@ nsLookAndFeel::Init() |
1455 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
1538 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
1456 |
1539 |
1457 style = gtk_widget_get_style_context(accel_label); |
1540 style = gtk_widget_get_style_context(accel_label); |
1458 - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1541 - gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1459 + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); |
1542 + gtk_style_context_get_color(style, gtk_style_context_get_state(style), &color); |
1553 sMenuBarHoverText = GDK_RGBA_TO_NS_RGBA(color); |
1636 sMenuBarHoverText = GDK_RGBA_TO_NS_RGBA(color); |
1554 + gtk_style_context_restore(style); |
1637 + gtk_style_context_restore(style); |
1555 |
1638 |
1556 // GTK's guide to fancy odd row background colors: |
1639 // GTK's guide to fancy odd row background colors: |
1557 // 1) Check if a theme explicitly defines an odd row color |
1640 // 1) Check if a theme explicitly defines an odd row color |
1558 @@ -1316,7 +1343,7 @@ nsLookAndFeel::Init() |
1641 @@ -1316,7 +1350,7 @@ nsLookAndFeel::Init() |
1559 // Get odd row background color |
1642 // Get odd row background color |
1560 gtk_style_context_save(style); |
1643 gtk_style_context_save(style); |
1561 gtk_style_context_add_region(style, GTK_STYLE_REGION_ROW, GTK_REGION_ODD); |
1644 gtk_style_context_add_region(style, GTK_STYLE_REGION_ROW, GTK_REGION_ODD); |
1562 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1645 - gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color); |
1563 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1646 + gtk_style_context_get_background_color(style, gtk_style_context_get_state(style), &color); |
1564 sOddCellBackground = GDK_RGBA_TO_NS_RGBA(color); |
1647 sOddCellBackground = GDK_RGBA_TO_NS_RGBA(color); |
1565 gtk_style_context_restore(style); |
1648 gtk_style_context_restore(style); |
1566 |
1649 |
1567 @@ -1334,9 +1361,11 @@ nsLookAndFeel::Init() |
1650 @@ -1334,9 +1368,11 @@ nsLookAndFeel::Init() |
1568 gtk_container_add(GTK_CONTAINER(parent), infoBar); |
1651 gtk_container_add(GTK_CONTAINER(parent), infoBar); |
1569 gtk_container_add(GTK_CONTAINER(infoBarContent), infoBarLabel); |
1652 gtk_container_add(GTK_CONTAINER(infoBarContent), infoBarLabel); |
1570 style = gtk_widget_get_style_context(infoBarLabel); |
1653 style = gtk_widget_get_style_context(infoBarLabel); |
1571 + gtk_style_context_save(style); |
1654 + gtk_style_context_save(style); |
1572 gtk_style_context_add_class(style, GTK_STYLE_CLASS_INFO); |
1655 gtk_style_context_add_class(style, GTK_STYLE_CLASS_INFO); |