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

287 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 4354146592 Bug 1432090 - Honor GTK button layout. r=stransky,desktop-theme-reviewers,dao
This is based off work by smurfd. But this patch doesn't support buttons
both at the left and right, which simplifies a lot the implementation.

Also, clean-up the existing env variables while at it.

Co-authored-by: Nicklas Boman <smurfd@gmail.com>

Differential Revision: https://phabricator.services.mozilla.com/D132073
2021-11-26 11:37:52 +00:00
Stephen A Pohl b739277c24 Bug 1719427: Refactor scrollbar drawing code across platforms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129265
2021-11-15 12:39:38 +00:00
criss 8ace361058 Backed out 4 changesets (bug 1719427) for causing build bustages. CLOSED TREE
Backed out changeset d6948ef7f495 (bug 1719427)
Backed out changeset 4df7017f6bc9 (bug 1719427)
Backed out changeset 8c5bb08f80e9 (bug 1719427)
Backed out changeset e32004dd2014 (bug 1719427)
2021-11-15 13:46:20 +02:00
Stephen A Pohl 0468798e53 Bug 1719427: Refactor scrollbar drawing code across platforms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129265
2021-11-15 11:15:54 +00:00
Emilio Cobos Álvarez e7d56f56b7 Bug 1713920 - Fall back to non-native colors if thumb and track are the same opaque color. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D130345
2021-11-08 14:04:24 +00:00
Emilio Cobos Álvarez c308704902 Bug 1738614 - Remove other Widget* colors. r=mstange
These are only used for frameset painting and the non-e10s <select>
dropdown focus codepath. We have other more appropriate standard
colors for this.

Differential Revision: https://phabricator.services.mozilla.com/D129992
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez 923cf5df84 Bug 1738614 - Remove TextForeground/Background system colors. r=mstange
Same thing, there's nor reason these should be different from other
CSS-exposed colors.

Differential Revision: https://phabricator.services.mozilla.com/D129991
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez ac14d7e42d Bug 1738614 - Remove WindowBackground/Foreground system colors. r=mstange
There's no reason for these to be different to the CSS-exposed
Window/WindowText.

Differential Revision: https://phabricator.services.mozilla.com/D129990
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez f9f04528a1 Bug 1738613 - Implement MozNativevisitedhyperlinktext on GTK. r=stransky
This is just drive-by, I noticed we implement one color but not the
other which is unfortunate.

Depends on D129993

Differential Revision: https://phabricator.services.mozilla.com/D129994
2021-11-02 10:45:05 +00:00
Emilio Cobos Álvarez 5b31eea4fd Bug 1737676 - Use GTK menu radius on native context menus and panels. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D129439
2021-10-28 10:52:31 +00:00
Emilio Cobos Álvarez 0ae349efa7 Bug 1736518 - Fix CSD check in nsLookAndFeel. r=stransky
This is a regression from bug 1681356. nsWindow::GtkWindowDecoration()
default-initializes a GtkWindowDecoration, which ends up being
GTK_DECORATION_SYSTEM since that's the first variant.

Fix the check by using the proper function
GetSystemGtkWindowDecoration(). Quite a footgun...

Differential Revision: https://phabricator.services.mozilla.com/D129005
2021-10-21 09:07:13 +00:00
Emilio Cobos Álvarez f317384568 Bug 1736518 - Make browser.tabs.drawInTitlebar a tri-state. r=stransky,Gijs
To more properly support Linux having a different default at runtime.

Expose the resolved value in appinfo for convenience, and use it in the
front-end as needed.

Differential Revision: https://phabricator.services.mozilla.com/D129004
2021-10-21 09:07:12 +00:00
stransky aecdcaacb9 Bug 1736795 [Linux] Export titlebar radius as int from LookAndFeel, r=emilio
Titlebar radius is exported as integer from Gtk so there's no need to use floats here.

Differential Revision: https://phabricator.services.mozilla.com/D128993
2021-10-20 18:01:02 +00:00
Emilio Cobos Álvarez 736cd85309 Bug 1736141 - Derive a content theme from newtab page background, and use it for non-chrome docshells. r=mstange,dao
We use "is-in-chrome-docshell" rather than "is a chrome doc" so that about:
pages that are loaded in the content area (like about:addons etc) follow the
general content theme as well.

Cache the relevant color schemes since having that many branches on the default
system theme made me a bit uncomfortable, and this code can be called quite a
lot... Though it probably isn't such a huge deal. This makes us initialize the
theme right away, so make sure subclasses do the right thing. This in practice
was only an issue for GTK, which does cache the "system theme is dark" bit.

Differential Revision: https://phabricator.services.mozilla.com/D128674
2021-10-20 08:25:57 +00:00
Emilio Cobos Álvarez 2cdb78d6a6 Bug 1509931 - Remove -moz-gtk-csd-transparent-background. r=stransky,desktop-theme-reviewers,dao
We always use alpha visual for WebRender, and appearance: none is
unnecessary (root element has no intrinsic appearance).

Differential Revision: https://phabricator.services.mozilla.com/D128682
2021-10-18 18:51:41 +00:00
Emilio Cobos Álvarez b742f680db Bug 1509931 - Expose titlebar radius as a chrome-only CSS environment variable. r=stransky
Mostly plumbing.

Differential Revision: https://phabricator.services.mozilla.com/D128680
2021-10-18 16:22:13 +00:00
Emilio Cobos Álvarez fb8e2b5796 Bug 1736038 - Simplify some color-scheme handling in core. r=mstange
Remove the follow-firefox-theme pref as now that's default everywhere,
and document better the behavior of the color-scheme property by
reworking and commenting the logic on it a bit.

Differential Revision: https://phabricator.services.mozilla.com/D128610
2021-10-15 16:53:08 +00:00
Emilio Cobos Álvarez ca970e3818 Bug 1735083 - Clean up GTK titlebar colors. r=desktop-theme-reviewers,dao
Apparently ActiveCaption/CaptionText/InactiveCaption/InactiveCaptionText
are supposed to be used for titlebars, so implement them properly and
remove the GTK-specific colors.

Differential Revision: https://phabricator.services.mozilla.com/D128028
2021-10-11 22:16:58 +00:00
Emilio Cobos Alvarez 067255ed45 Bug 1735078 - Clean up some unused LookAndFeel code on Windows. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D128025
2021-10-11 17:11:27 +00:00
Emilio Cobos Alvarez 51b1017370 Bug 1734226 - Use a single pref to determine whether system colors follow the Firefox theme. r=desktop-theme-reviewers,dao
Now that windows is going to support dark colors, we want to make it
behave like other platforms in this regard.

Having a single pref for this seems better.

Differential Revision: https://phabricator.services.mozilla.com/D127624
2021-10-06 15:29:59 +00:00
Emilio Cobos Álvarez e50c80851e Bug 1734115 - Add basic support for dark form controls to nsNativeBasicTheme. r=mstange
For that:

 * Tweak the standin system colors to match the non-native theme.

 * Use those system colors for button and field backgrounds.

 * Rename the "should use system colors" bit to "is high contrast",
   which is what it really is (specially now that we use system colors
   also in non-high-contrast).

Border colors and other colors like the <input type=range> and such
might need some extra tweaking perhaps, but this is a decent start and
looks good in https://crisal.io/tmp/form-controls.html afaict (dark mode
toggle needs the color-scheme pref enabled of course).

Differential Revision: https://phabricator.services.mozilla.com/D127533
2021-10-05 14:40:52 +00:00
Emilio Cobos Alvarez 21a3f0049f Bug 1733565 - Clean up button active system colors. r=mstange,desktop-theme-reviewers,dao
This patch does three things:

 * Unifies mac and gtk's buttonactivetext system colors (unships mac's from
   content, but it was never meant to be exposed).

 * Simplifies the forms.css rules, since <input type=color>'s color property
   value doesn't affect its rendering in any meaningful way.

 * Adds a buttonactiveface color, which we'll use to provide dark backgrounds
   for buttons in Windows dark mode (and is good practice, since generally
   every text system color should have a corresponding background).

So as-is it shouldn't change content-exposed behavior (except we stop exposing
the -moz-mac-buttonactivetext to content), but it's a worthy cleanup.

Depends on D127246

Differential Revision: https://phabricator.services.mozilla.com/D127259
2021-10-01 19:42:16 +00:00
Stephen A Pohl 87f63ab1b8 Bug 1633860: Place window control buttons on the right side on macOS when using an RTL system locale, regardless of the Firefox locale. r=mstange,emilio,harry
Differential Revision: https://phabricator.services.mozilla.com/D116921
2021-09-22 18:51:20 +00:00
Emilio Cobos Álvarez 8b10d3a89d Bug 1693222 - Implement SelectedItem and SelectedItemText system colors. r=mstange
Since Highlight / HighlightText are now equivalent to the text selection
ones, remove those too.

Differential Revision: https://phabricator.services.mozilla.com/D123964
2021-09-02 11:38:01 +00:00
Narcis Beleuzu 92fc260af2 Backed out changeset 28a0487d0291 (bug 1693222) for reftest failure on themed-widget.html. CLOSED TREE 2021-09-02 02:26:12 +03:00
Emilio Cobos Álvarez c3eb845bbf Bug 1693222 - Implement SelectedItem and SelectedItemText system colors. r=mstange
Since Highlight / HighlightText are now equivalent to the text selection
ones, remove those too.

Differential Revision: https://phabricator.services.mozilla.com/D123964
2021-09-01 18:21:57 +00:00
Andrew Osmond 50d789dd6a Bug 1724936 - Remove XRender support. r=jrmuizel
This has been deprecated for a long time, and it doesn't work in
conjuction with WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D122368
2021-08-25 19:35:23 +00:00
Bob Owen 8434181376 Bug 1701796: Move IsTouchDeviceSupportPresent to LookAndFeel remoting to prevent win32k usage in the content process. r=emilio,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D123497
2021-08-25 14:32:13 +00:00
Karl Tomlinson 33a62f48af Bug 1725917 use the same logic for chrome ColorScheme in MatchFirefoxThemeIfNeeded() as in ColorSchemeForDocument() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122807
2021-08-18 07:45:15 +00:00
Iulian Moraru d56b6f5b06 Backed out changeset e40234e5ffde (bug 1725917) for causing linux build bustages on nsLookAndFeel.cpp. CLOSED TREE 2021-08-18 09:52:04 +03:00
Karl Tomlinson 3c44e06310 Bug 1725917 use the same logic for chrome ColorScheme in MatchFirefoxThemeIfNeeded() as in ColorSchemeForDocument() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122807
2021-08-18 00:58:57 +00:00
Emilio Cobos Álvarez 624584c368 Bug 1724405 - Make ui.caretBlinkCount a proper widget int, and make it respect GTK settings. r=stransky
And make sure the caret ends up being visible, rather than _not_
visible.

This should be implementable on windows as well. It seems macOS doesn't
have a timeout thing.

Differential Revision: https://phabricator.services.mozilla.com/D122132
2021-08-10 14:39:27 +00:00
Emilio Cobos Álvarez a5128d1ebd Bug 1722480 - Ensure nsLookAndFeel::EnsureInit doesn't trigger any reentrant invalidation. r=stransky
RestoreSystemTheme() can trigger gtk theme name changes which can
trigger invalidations again. The other theme changes
(WithAltThemeConfigured and MatchFirefoxThemeIfNeeded) already did this
correctly.

Differential Revision: https://phabricator.services.mozilla.com/D120958
2021-07-28 10:29:19 +00:00
Emilio Cobos Álvarez 08dccdd536 Bug 1721347 - Add OS theme info to about:support. r=Gijs,fluent-reviewers
I'm not sure what information would be useful in other OSes, so ifdef
the row for GTK for now, but I made this trivial to show in Windows /
macOS / Android as soon as they return useful information.

Differential Revision: https://phabricator.services.mozilla.com/D120331
2021-07-20 20:09:09 +00:00
Emilio Cobos Álvarez a9bbfe66c2 Bug 1720874 - Try to find menupopup background with :backdrop pseudo-class. r=stransky
This theme only styles menus with menu:backdrop (which always seems to
match for context menus).

Try that before giving up. Also, fall back to the window background if
that would ever fail (which seems better than just rendering
transparent).

Differential Revision: https://phabricator.services.mozilla.com/D120199
2021-07-19 20:28:33 +00:00
Emilio Cobos Álvarez 85e2ca0dd0 Bug 1716462 - Set right theme name when switching to Adwaita Dark. r=stransky
This doesn't change behavior on GNOME because we already set
"gtk-application-prefer-dark-theme" to dark, and the fallback theme is
Adwaita, but on KDE we get the wrong close icons if we don't do this.

Differential Revision: https://phabricator.services.mozilla.com/D117724
2021-06-23 07:53:43 +00:00
Emilio Cobos Álvarez 6126b0b75d Bug 1717077 - Prefer blending with theme_bg_color rather than white to compute accent color. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D118310
2021-06-23 07:52:57 +00:00
Emilio Cobos Álvarez c0dd8a5908 Bug 1717077 - Make RestoreSystemTheme call a bit more fine-grained. r=stransky
While testing the above patch on a variety of gtk themes, I noticed that
selection colors were inconsistent (as in, from the old theme) when
switching gtk themes, and tracked that down to this call.

Since we only need to restore the theme when actually overridden, track
that instead.

Differential Revision: https://phabricator.services.mozilla.com/D118311
2021-06-23 07:52:25 +00:00
Emilio Cobos Álvarez d7fb957271 Bug 1716462 - Add a bit more logging. r=stransky
And reuse an already-computed name rather than calling GetGtkTheme
again.

Differential Revision: https://phabricator.services.mozilla.com/D117723
2021-06-16 17:02:09 +00:00
Dorel Luca b5d072edbd Backed out 2 changesets (bug 1716462) for Build bustages. CLOSED TREE
Backed out changeset da9c8170a934 (bug 1716462)
Backed out changeset 42abdfd99cb4 (bug 1716462)
2021-06-16 18:50:02 +03:00
Emilio Cobos Álvarez 8922b5b8aa Bug 1716462 - Add a bit more logging. r=stransky
And reuse an already-computed name rather than calling GetGtkTheme
again.

Depends on D117722

Differential Revision: https://phabricator.services.mozilla.com/D117723
2021-06-16 14:35:29 +00:00
Emilio Cobos Álvarez 7c4a2436ac Bug 1713920 - Add some logging for native GTK colors. r=stransky
Let's see if that allows us to figure out what's going on here.

Differential Revision: https://phabricator.services.mozilla.com/D117893
2021-06-16 14:13:43 +00:00
Emilio Cobos Álvarez bc86920738 Bug 1707872 - Make LookAndFeel log its own module. r=stransky
Also no behavior change intended.

Differential Revision: https://phabricator.services.mozilla.com/D117227
2021-06-10 12:39:00 +00:00
Emilio Cobos Álvarez 2a5c38d4f0 Bug 1707872 - Make GTK theme follow the firefox theme globally. r=stransky
This matches what macOS is doing in bug 1715145, and improves the
situation in the cases the user chooses a light Firefox theme, but a
dark GTK theme, or vice versa.

The nice thing of doing it globally is that we don't need to teach the
GTK code to paint with different color schemes in different windows,
which would be massively annoying.

This is expected to have an slight performance cost on startup for
light-theme users (as we need to read the dark gtk theme colors), but
it's hopefully ok.

Depends on D117227

Differential Revision: https://phabricator.services.mozilla.com/D117228
2021-06-10 11:43:00 +00:00
Emilio Cobos Álvarez 7bd8e59992 Bug 1707872 - Factor out some code in Gtk's LookAndFeel. r=stransky
No behavior change intended.

Differential Revision: https://phabricator.services.mozilla.com/D117226
2021-06-10 11:08:06 +00:00
Emilio Cobos Álvarez 52363d42aa Bug 1714103 - Fallback to unthemed scrollbars if the thumb wouldn't be visible. r=stransky
The right fix for this theme in particular would be for WidgetUsesImage
to check "border-image". However, that doesn't work (instead I get a GTK
warning saying that border-image is not gettable).

So instead, make sure that we fallback to unthemed colors if the thumb
would be invisible in any of its states. This is more resilient anyways.

Depends on D116936

Differential Revision: https://phabricator.services.mozilla.com/D116937
2021-06-08 08:45:44 +00:00
Emilio Cobos Álvarez 62b79cfe22 Bug 1714103 - Simplify a condition in RecordLookAndFeelSpecificTelemetry. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D116936
2021-06-08 08:45:44 +00:00
Emilio Cobos Álvarez 74f3c420ee Bug 1713629 - Tweak light theme detection code to find the right theme on more cases. r=stransky
This was an oversight of mine when originally writing this code. We need
to substitute longer prefixes first, otherwise themes like "Foo-Darker"
would end up with a "Foo-er" theme rather than "Foo", and we'd just fall
back to Adwaita (which is not a huge deal, but not the intent of this
code).

Differential Revision: https://phabricator.services.mozilla.com/D116392
2021-06-01 18:04:51 +00:00
Masayuki Nakano 86ac873214 Bug 1712675 - part 2: Make any cpp file under `widget/gtk` stop redefining `LOG` macro r=rmader,stransky
`LOG` is defined by `nsWindow.h` for a shortcut of `MOZ_LOG` for generic use
under `widget/gtk`.  However, some cpp files do `#undef LOG` and redefine it.
This causes the CPP file order important in unified cpp files since a CPP
file's `LOG` may be redefined unexpectedly with changing the unified order
and/or group.  Therefore, each cpp file should define its own macro name
instead of redefining `LOG`.

Differential Revision: https://phabricator.services.mozilla.com/D115978
2021-05-26 22:53:30 +00:00
Emilio Cobos Álvarez 93cad9391f Bug 1710967 - Move global gtk settings change observation to nsLookAndFeel. r=stransky
They more logically belong there, and this should result in less signal
handlers etc as a side effect (not that it matters much anyways).

Differential Revision: https://phabricator.services.mozilla.com/D115037
2021-05-14 16:18:51 +00:00