Bug 1710643 - Remove support for unused gtk infobar widget and colors. r=stransky

Presumably they were for notifications and now we use native notifications?

Differential Revision: https://phabricator.services.mozilla.com/D114874
This commit is contained in:
Emilio Cobos Álvarez 2021-05-12 19:13:21 +00:00
parent 7d8a2eeff3
commit e2075d6bdd
13 changed files with 0 additions and 65 deletions

View File

@ -2,4 +2,3 @@
<div style="background-color: -moz-mac-defaultbuttontext"></div>
<div style="background-color: -moz-mac-focusring"></div>
<div style="background-color: -moz-win-communicationstext"></div>
<div style="background-color: -moz-gtk-info-bar-text"></div>

View File

@ -96,7 +96,6 @@ const NON_CONTENT_ACCESSIBLE_VALUES = {
"-moz-window-frame-right",
"-moz-window-titlebar",
"-moz-window-titlebar-maximized",
"-moz-gtk-info-bar",
"-moz-mac-active-source-list-selection",
"-moz-mac-disclosure-button-closed",
"-moz-mac-disclosure-button-open",

View File

@ -1826,8 +1826,6 @@ pub enum Appearance {
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozWindowTitlebarMaximized,
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozGtkInfoBar,
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozMacActiveSourceListSelection,
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]

View File

@ -357,8 +357,6 @@ pub enum SystemColor {
MozComboboxtext,
MozCombobox,
MozGtkInfoBarText,
/// Color of tree column headers
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozColheadertext,

View File

@ -120,12 +120,6 @@ static GtkWidget* CreateToolbarSeparatorWidget() {
return widget;
}
static GtkWidget* CreateInfoBarWidget() {
GtkWidget* widget = gtk_info_bar_new();
AddToWindowContainer(widget);
return widget;
}
static GtkWidget* CreateButtonWidget() {
GtkWidget* widget = gtk_button_new_with_label("M");
AddToWindowContainer(widget);
@ -701,8 +695,6 @@ static GtkWidget* CreateWidget(WidgetNodeType aAppearance) {
return CreateToolbarWidget();
case MOZ_GTK_TOOLBAR_SEPARATOR:
return CreateToolbarSeparatorWidget();
case MOZ_GTK_INFO_BAR:
return CreateInfoBarWidget();
case MOZ_GTK_SPINBUTTON:
return CreateSpinWidget();
case MOZ_GTK_BUTTON:
@ -1072,10 +1064,6 @@ static GtkStyleContext* GetCssNodeStyleInternal(WidgetNodeType aNodeType) {
// TODO - create from CSS node
style = CreateSubStyleWithClass(MOZ_GTK_GRIPPER, GTK_STYLE_CLASS_GRIP);
break;
case MOZ_GTK_INFO_BAR:
// TODO - create from CSS node
style = CreateSubStyleWithClass(MOZ_GTK_INFO_BAR, GTK_STYLE_CLASS_INFO);
break;
case MOZ_GTK_SPINBUTTON_ENTRY:
// TODO - create from CSS node
style =
@ -1251,9 +1239,6 @@ static GtkStyleContext* GetWidgetStyleInternal(WidgetNodeType aNodeType) {
case MOZ_GTK_GRIPPER:
style = CreateSubStyleWithClass(MOZ_GTK_GRIPPER, GTK_STYLE_CLASS_GRIP);
break;
case MOZ_GTK_INFO_BAR:
style = CreateSubStyleWithClass(MOZ_GTK_INFO_BAR, GTK_STYLE_CLASS_INFO);
break;
case MOZ_GTK_SPINBUTTON_ENTRY:
style =
CreateSubStyleWithClass(MOZ_GTK_SPINBUTTON, GTK_STYLE_CLASS_ENTRY);

View File

@ -2177,17 +2177,6 @@ static gint moz_gtk_check_menu_item_paint(WidgetNodeType widgetType,
return MOZ_GTK_SUCCESS;
}
static gint moz_gtk_info_bar_paint(cairo_t* cr, GdkRectangle* rect,
GtkWidgetState* state) {
GtkStyleContext* style =
GetStyleContext(MOZ_GTK_INFO_BAR, state->scale, GTK_TEXT_DIR_LTR,
GetStateFlagsFromGtkWidgetState(state));
gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
return MOZ_GTK_SUCCESS;
}
static gint moz_gtk_header_bar_paint(WidgetNodeType widgetType, cairo_t* cr,
GdkRectangle* rect,
GtkWidgetState* state) {
@ -2390,9 +2379,6 @@ gint moz_gtk_get_widget_border(WidgetNodeType widget, gint* left, gint* top,
}
return MOZ_GTK_SUCCESS;
}
case MOZ_GTK_INFO_BAR:
w = GetWidget(MOZ_GTK_INFO_BAR);
break;
case MOZ_GTK_TOOLTIP: {
// In GTK 3 there are 6 pixels of additional margin around the box.
// See details there:
@ -3194,8 +3180,6 @@ gint moz_gtk_widget_paint(WidgetNodeType widget, cairo_t* cr,
return moz_gtk_hpaned_paint(cr, rect, state);
case MOZ_GTK_WINDOW:
return moz_gtk_window_paint(cr, rect, direction);
case MOZ_GTK_INFO_BAR:
return moz_gtk_info_bar_paint(cr, rect, state);
case MOZ_GTK_HEADER_BAR:
case MOZ_GTK_HEADER_BAR_MAXIMIZED:
return moz_gtk_header_bar_paint(widget, cr, rect, state);

View File

@ -305,8 +305,6 @@ enum WidgetNodeType : int {
MOZ_GTK_HEADERBAR_WINDOW_MAXIMIZED,
/* Window container for all widgets */
MOZ_GTK_WINDOW_CONTAINER,
/* Paints a GtkInfoBar, for notifications. */
MOZ_GTK_INFO_BAR,
/* Used for widget tree construction. */
MOZ_GTK_COMBOBOX,
/* Paints a GtkComboBox button widget. */

View File

@ -543,9 +543,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID,
case ColorID::MozMenubarhovertext:
aColor = mMenuBarHoverText;
break;
case ColorID::MozGtkInfoBarText:
aColor = mInfoBarText;
break;
case ColorID::MozColheadertext:
aColor = mMozColHeaderText;
break;
@ -1560,18 +1557,6 @@ void nsLookAndFeel::PerThemeData::Init() {
GetBorderColors(style, &mFrameOuterLightBorder, &mFrameInnerDarkBorder);
}
// GtkInfoBar
// TODO - Use WidgetCache for it?
GtkWidget* infoBar = gtk_info_bar_new();
GtkWidget* infoBarContent =
gtk_info_bar_get_content_area(GTK_INFO_BAR(infoBar));
GtkWidget* infoBarLabel = gtk_label_new(nullptr);
gtk_container_add(GTK_CONTAINER(parent), infoBar);
gtk_container_add(GTK_CONTAINER(infoBarContent), infoBarLabel);
style = gtk_widget_get_style_context(infoBarLabel);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_INFO);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
mInfoBarText = GDK_RGBA_TO_NS_RGBA(color);
// Some themes have a unified menu bar, and support window dragging on it
gboolean supports_menubar_drag = FALSE;
GParamSpec* param_spec = gtk_widget_class_find_style_property(

View File

@ -106,7 +106,6 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
nscolor mAccentColor = kWhite;
nscolor mAccentColorForeground = kWhite;
nscolor mMozScrollbar = kWhite;
nscolor mInfoBarText = kBlack;
nscolor mMozColHeaderText = kBlack;
nscolor mMozColHeaderHoverText = kBlack;
nscolor mThemedScrollbar = kWhite;

View File

@ -707,9 +707,6 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance,
case StyleAppearance::Radiomenuitem:
aGtkWidgetType = MOZ_GTK_RADIOMENUITEM;
break;
case StyleAppearance::MozGtkInfoBar:
aGtkWidgetType = MOZ_GTK_INFO_BAR;
break;
case StyleAppearance::MozWindowTitlebar:
aGtkWidgetType = MOZ_GTK_HEADER_BAR;
break;
@ -1883,7 +1880,6 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
case StyleAppearance::Checkmenuitem:
case StyleAppearance::Radiomenuitem:
case StyleAppearance::Splitter:
case StyleAppearance::MozGtkInfoBar:
case StyleAppearance::MozWindowButtonBox:
case StyleAppearance::MozWindowButtonClose:
case StyleAppearance::MozWindowButtonMinimize:

View File

@ -54,9 +54,6 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, ColorScheme,
case ColorID::MozEventreerow:
aColor = NS_RGB(0xff, 0xff, 0xff);
break;
case ColorID::MozGtkInfoBarText:
aColor = NS_RGB(0x00, 0x00, 0x00);
break;
case ColorID::MozMacButtonactivetext:
case ColorID::MozMacDefaultbuttontext:
aColor = NS_RGB(0xff, 0xff, 0xff);

View File

@ -53,7 +53,6 @@ LayoutDeviceIntMargin HeadlessThemeGTK::GetWidgetBorder(
case StyleAppearance::SpinnerTextfield:
case StyleAppearance::Textarea:
case StyleAppearance::Menupopup:
case StyleAppearance::MozGtkInfoBar:
result.top = 1;
result.right = 1;
result.bottom = 1;
@ -381,7 +380,6 @@ HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
case StyleAppearance::Radiomenuitem:
case StyleAppearance::Menuseparator:
case StyleAppearance::Menuarrow:
case StyleAppearance::MozGtkInfoBar:
return !IsWidgetStyled(aPresContext, aFrame, aAppearance);
case StyleAppearance::MozMenulistArrowButton:
return (!aFrame ||

View File

@ -308,7 +308,6 @@ static const char sColorPrefs[][41] = {
"ui.-moz-visitedhyperlinktext",
"ui.-moz-comboboxtext",
"ui.-moz-combobox",
"ui.-moz-gtk-info-bar-text",
"ui.-moz-colheadertext",
"ui.-moz-colheaderhovertext"};