Граф коммитов

242 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew 080117611f Bug 1717556 - Give gfxContext::UserToDevicePixelSnapped an option to prioritize the rect dimensions over snapping each individual edge, and use this for GTK widget painting. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D119885
2021-07-16 11:20:26 +00:00
Emilio Cobos Álvarez e5950572b4 Bug 1710873 - Keep unconditionally returning true for nsNativeThemeGTK::ThemeSupportsScrollbarButtons. r=stransky
See bug 1710324 comment 9.

Differential Revision: https://phabricator.services.mozilla.com/D114987
2021-05-14 16:20:39 +00:00
Emilio Cobos Álvarez e2075d6bdd 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
2021-05-12 19:13:21 +00:00
Emilio Cobos Álvarez 2ecfa192c1 Bug 1710324 - Use non-native scrollbar drawing in nsNativeThemeGTK. r=stransky
Right now we paint scrollbars using gtk in nsNativeThemeGTK, and that
makes them look a bit inconsistent if the non-native implementation ends
up drawing them differently. I think scrollbars should look the same
regardless of where they're drawn.

This simplifies the code, and also brings proper scrollbar-{width,color}
support to the native theme, which is nice because Thunderbird uses it
if you use a theme there.

I opted for removing the code, but let me know if you'd rather keep it
behind the widget.non-native-theme.enabled pref or such.

Differential Revision: https://phabricator.services.mozilla.com/D114699
2021-05-11 13:57:18 +00:00
Emilio Cobos Álvarez fea89732e3 Bug 1710324 - nsNativeThemeGTK shouldn't need to be an nsIObserver. r=stransky
This is just cleanup. We have better ways to run code on shutdown (the pointer
to the theme object gets cleared on shutdown anyways).

Depends on D114697

Differential Revision: https://phabricator.services.mozilla.com/D114698
2021-05-11 13:57:18 +00:00
Csoregi Natalia e000635504 Backed out 3 changesets (bug 1710324) for causing mass failures and crashes. CLOSED TREE
Backed out changeset 7328372519f1 (bug 1710324)
Backed out changeset aa852464d828 (bug 1710324)
Backed out changeset 238a4cfcdc86 (bug 1710324)
2021-05-11 03:27:51 +03:00
Emilio Cobos Álvarez c25a3146e9 Bug 1710324 - nsNativeThemeGTK shouldn't need to be an nsIObserver. r=stransky
This is just cleanup. We have better ways to run code on shutdown (the pointer
to the theme object gets cleared on shutdown anyways).

Depends on D114697

Differential Revision: https://phabricator.services.mozilla.com/D114698
2021-05-10 23:33:34 +00:00
Emilio Cobos Álvarez 4f3265f65e Bug 1707992 - Don't use native drawing for menupopups. r=stransky
It's not like our menupopups look anything like native ones other than
the color, anyways, so this will allow us to improve all our menupopups
at the same time.

Differential Revision: https://phabricator.services.mozilla.com/D113556
2021-04-27 22:36:44 +00:00
Emilio Cobos Álvarez 9f6e1b077e Bug 1707992 - Remove support for some useless appearance values in nsNativeThemeGTK. r=stransky
We use the same background-color with CSS anyways, so this shouldn't
change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D113554
2021-04-27 22:35:43 +00:00
stransky 46ab88783d Bug 1706520 [Linux] Add missing WidgetUtilsGtk.h headers to widget/gtk, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D112913
2021-04-21 10:13:03 +00:00
stransky 5acc584ad2 Bug 1706022 [Linux] Use GdkIsWaylandDisplay()/GdkIsX11Display() instead of gfxPlatformGtk::GetPlatform() variants, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D112525
2021-04-20 12:29:01 +00:00
Emilio Cobos Álvarez 390c6943fe Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 12:22:14 +00:00
Narcis Beleuzu e9fb777466 Backed out changeset 597b9606c3ca (bug 1702676) for reftest failures on mq_prefers_reduced_motion_reduce.html CLOSED TREE 2021-04-02 09:34:53 +03:00
Emilio Cobos Álvarez f7f84a3c53 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 00:21:37 +00:00
Emilio Cobos Álvarez f91affad79 Bug 1699088 - Use a single system font definition rather than two. r=cmartin
Follow the pattern we use for system colors.

Differential Revision: https://phabricator.services.mozilla.com/D108822
2021-03-24 22:57:37 +00:00
Emilio Cobos Álvarez 75e5766b67 Bug 1699930 - Don't let GTK text scale affect non-native scrollbar sizes. r=mstange
This matches the native theme. We plumb it via LookAndFeel to avoid
having to load GTK settings in child processes.

Differential Revision: https://phabricator.services.mozilla.com/D109275
2021-03-22 16:11:33 +00:00
Emilio Cobos Álvarez 5cbba9b317 Bug 1699937 - Don't draw focus outlines for box-shadow in the non-native theme. r=mstange
This is a relatively easy way to improve the rendering with the
non-native theme while not regressing anything.

In the future, once non-native-theme is shipped and default everywhere,
I think we could provide something like:

  bool nsITheme::GetShadowRect(nsIFrame*, StyleAppearance, LayoutDeviceRect&, RectCornerRadii&)

or such, where we can provide a precise rect + radii, and we would avoid
painting the shadow if the function returned false. That would allow us
to remove the native theme box shadow code path, and avoid WR fallback,
all at once.

Differential Revision: https://phabricator.services.mozilla.com/D109209
2021-03-20 23:08:11 +00:00
Emilio Cobos Álvarez 30cf04d26c Bug 1696988 - Add backgrounds for non-native tooltips on Linux and OSX. r=ntim
The Linux styles match Adwaita trunk[1], so it's a bit smaller than the
native ones but I think that's fine (it matches other themes more
closely, like Arc).

On OSX the system color needs to be tweaked (will do in a follow-up)
since it is windows-style yellow right now, which is rather ugly. But
this is a progression regardless.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/issues/3352

Differential Revision: https://phabricator.services.mozilla.com/D107548
2021-03-09 00:33:06 +00:00
Emilio Cobos Álvarez 4b4ff83478 Bug 1689253 - Add a more sensible scrollbar size API to nsITheme, and use it to replace ScrollbarNonDisappearing. r=spohl
There's no reason we should need an scrollbar box to query the size of a
scrollbar. I plan to use this in the following patch to make the size of a
resizer not vary depending on whether the container has scrollbars or not,
which is what ultimately causes the reftest failure.

Differential Revision: https://phabricator.services.mozilla.com/D103302
2021-01-28 22:11:54 +00:00
Bogdan Tara 4a649093b9 Backed out changeset 3e90a3759639 (bug 1679208) for scrollbars-no-margin.html failures CLOSED TREE 2020-12-03 01:11:32 +02:00
Emilio Cobos Álvarez aa15236426 Bug 1679208 - Don't assume int return values in nsITheme. r=mstange
This doesn't hold with fractional scale values. Right now GTK truncates
the scale factor, Windows rounds, and non-native theme rounds as well.

With this native theme will propagate correctly the floating point
values.

I tried to not change behavior meaningfully in any of the other themes,
mostly to avoid risk. GTK and Windows can be trivially tweaked to
support fractional scale factors properly if we wanted to, but seems
better to not do that as part of this patch.

Depends on D98099

Differential Revision: https://phabricator.services.mozilla.com/D98100
2020-12-02 21:40:05 +00:00
Markus Stange af68ac4a30 Bug 1673132 - Use the -moz-default-appearance values "scrollbar-horizontal" and "scrollbar-vertical" on macOS and remove the now-unused value "scrollbar". r=emilio
Other platforms were already converted to scrollbar-horizontal and scrollbar-vertical in bug 1205643.

Differential Revision: https://phabricator.services.mozilla.com/D94674
2020-10-27 12:37:44 +00:00
Markus Stange cb8968058f Bug 1673132 - Remove "scrollbar-small" -moz-default-appearance value and replace its single use with scrollbar-width: thin. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D94673
2020-10-27 12:37:44 +00:00
Julian Seward cbaaa09c79 Bug 1665553 - Undefined value use in `moz_gtk_button_paint()`. r=stransky@redhat.com.
nsNativeThemeGTK::GetGtkWidgetAndState looks as if it should write to
out-parameters `*aState` and `*aWidgetFlags` any time it returns `true`.  But
it is possible to observe that `*aWidgetFlags` is uninitialised when `true` is
returned.  This simple patch zero-initialises `*aWidgetFlags` at the start, in
the same way that `*aState` is already zero-initialised at the start.

Differential Revision: https://phabricator.services.mozilla.com/D90697
2020-09-18 17:32:13 +00:00
Botond Ballo 01b3c7969d Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Robert Mader 0d74f2d95f Bug 1617002 - Remove checks for unsupported GTK3 versions. r=stransky
Cleans up the code a bit to make actually used fallback code easier to spot
and update the required GTK version so deprecation warnings are more accurate.

Also make `gdk_window_set_opaque_region` always available - we can now assume
it to be present in all supported versions.

Differential Revision: https://phabricator.services.mozilla.com/D82804
2020-07-20 15:43:30 +00:00
Cameron McCormack af3cb9efc8 Bug 1620467 - Part 5: Remove appearance values not used by the browser or Web content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83431
2020-07-16 22:04:14 +00:00
Cameron McCormack c40850b854 Bug 1650256 - Remove unused StyleAppearance values. r=emilio
The parsing of these values was disabled in bug 1554150.

Differential Revision: https://phabricator.services.mozilla.com/D82122
2020-07-03 04:06:13 +00:00
Emilio Cobos Álvarez b9b9e38dd9 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Cosmin Sabou 65d75a47f3 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Emilio Cobos Álvarez 090e3d2409 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-18 13:55:03 +00:00
Emilio Cobos Álvarez 4cb5da08a2 Bug 1640623 - Use an enum class for LookAndFeel::FontID. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D76696
2020-06-11 11:27:58 +00:00
Emilio Cobos Álvarez 8d8d416c63 Bug 1638107 - Scale gtk entry min height by the font-size for smaller-than-default font-sizes. r=karlt
This makes inputs not remain very big at small font sizes, which is
needed for compat both with other browsers and platforms, while keeping
the right native appearance at normal / large font sizes.

Differential Revision: https://phabricator.services.mozilla.com/D76256
2020-05-26 01:34:25 +00:00
Emilio Cobos Álvarez 7a14870e23 Bug 1636998 - Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

Differential Revision: https://phabricator.services.mozilla.com/D74733
2020-05-13 20:38:26 +00:00
Narcis Beleuzu 23b4220599 Backed out changeset f5546bfc9604 (bug 1636998) for reftest failures on 1174332-1.html . CLOSED TREE 2020-05-13 23:22:56 +03:00
Emilio Cobos Álvarez dbbe7901c1 Bug 1636998 - Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

Differential Revision: https://phabricator.services.mozilla.com/D74733
2020-05-13 14:47:07 +00:00
Emilio Cobos Álvarez 0be2a79efd Bug 1571376 - Make all themes support non-disappearing scrollbar sizes. r=mstange
That is, so that the select dropdown button always take the size of a
native scrollbar rather than a potentially custom scrollbar.

Differential Revision: https://phabricator.services.mozilla.com/D73261
2020-05-07 15:28:35 +00:00
Martin Stransky 1536f639a8 Bug 1628711 Remove #ifdef MOZ_WIDGET_GTK from widget/gtk, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D70391

--HG--
extra : moz-landing-system : lando
2020-04-14 12:35:34 +00:00
Jonathan Kew f2b9997dda Bug 1587953 - Improve Gtk theme handling for some widgets in vertical writing-modes. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D67289

--HG--
extra : moz-landing-system : lando
2020-03-19 19:29:55 +00:00
Oana Pop Rus 1f4abcaa1a Backed out changeset b8205184278a (bug 1587953) for crashtests/1547420-1.html on a CLOSED TREE 2020-03-19 20:18:31 +02:00
Jonathan Kew d33a8b4407 Bug 1587953 - Improve Gtk theme handling for some widgets in vertical writing-modes. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D67289

--HG--
extra : moz-landing-system : lando
2020-03-19 15:30:32 +00:00
Simon Giesecke cb0734d274 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:57 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 2d961c08ab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 09:14:12 +00:00
Andrew Osmond 91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

Differential Revision: https://phabricator.services.mozilla.com/D64771

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Emilio Cobos Álvarez 5bba05d7c8 Bug 1620307 - Rename -moz-menulist-button to -moz-menulist-arrow-button. r=spohl
This should be less confusing. This is not supported outside of chrome:// or
user-agent stylesheets so we can name this however we want.

Differential Revision: https://phabricator.services.mozilla.com/D65605

--HG--
extra : moz-landing-system : lando
2020-03-05 21:13:46 +00:00
Emilio Cobos Álvarez 741c54ae79 Bug 1619664 - Decide which theme to use per document, not per-process. r=mstange,spohl
This allows testing much more easily.

There are some edge cases with native theme changes and such (ThemeChanged and
co assume there's only one theme per process). But I don't think they matter
much for our use cases.

Differential Revision: https://phabricator.services.mozilla.com/D65162

--HG--
extra : moz-landing-system : lando
2020-03-03 19:46:41 +00:00
Emilio Cobos Álvarez f63532cf6d Bug 1615056 - Remove layout.css.webkit-appearance.enabled. r=jwatt
I don't think we want to keep the ugly widget hacks forever. Let me know if
you'd rather keep the property behind a pref but I don't think there's a point
in doing that.

Differential Revision: https://phabricator.services.mozilla.com/D62649

--HG--
extra : moz-landing-system : lando
2020-02-19 14:48:43 +00:00
Bogdan Tara d9d7ba1ba9 Backed out changeset 222723ab0b5b (bug 1615056) for bustages complaining about nsNativeThemeWin.cpp CLOSED TREE 2020-02-19 16:10:56 +02:00
Emilio Cobos Álvarez 4675433ccc Bug 1615056 - Remove layout.css.webkit-appearance.enabled. r=jwatt
I don't think we want to keep the ugly widget hacks forever. Let me know if
you'd rather keep the property behind a pref but I don't think there's a point
in doing that.

Differential Revision: https://phabricator.services.mozilla.com/D62649

--HG--
extra : moz-landing-system : lando
2020-02-19 11:27:27 +00:00