Commit Graph
330 Commits
Author SHA1 Message Date
Sylvestre Ledru 4f6b8b516d Bug 2023419 - Remove Emacs/Vim modelines from widget/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287877
2026-03-16 17:22:02 +00:00
Emilio Cobos Álvarez d244bcf539 Bug 1967569 - Use the non-native theme on windows. r=desktop-theme-reviewers,win-reviewers,dao,handyman
This is to be landed after the soft-freeze of course. This patch aligns
with Linux, removing the ability to draw native-looking buttons and
progress-bars on Windows.

Note that checkboxes, menus, and a bunch of other things already use
non-native drawing (including virtually all our main browser UI), so
this only affects "secondary" UI: the old profile manager, a couple
dialogs, the bookmarks sidebar panel searchbox, page info window...

Also, we already effectively fallback to the non-native theme in dark
mode, and our non-native theme looks reasonably windows-like.

Advantages (apart from not having to maintain all this code) is that the
non-native theme is also faster, and this paves the way towards making
the layout side of theming simpler.

In order to make buttons still react to hover feedback, fix the
button{hover/active} system colors to match the windows task manager.
Also adjust the padding to match what the non-native theme returned.

Things that I've tested:

 * Buttons (profile manager, create profile wizard, page info window).
 * Trees and other listboxes (profile manager, page info window).
 * <input type=text> (bookmarks sidebar)
 * <menulist> (ask to save dialog, note it needs D250006 to show the
   dropmarker and have the right spacing).

Things that were supported but are unused (to the best of my ability):

 * <progress> (there are a few like the downloads popup but they're
   custom).
 * <input type=range>

Note that the places window already uses non-native painting.

IMHO the only thing that _could_ be considered a regression is the
button rendering (debatable tho). I think longer term we might want to
move to our design system's button tokens and such, but over all things
look a bit more consistent and I'm happy to look at improving the colors
here in a follow-up to match the Win32 blue or something else if we deem
it worth it.

Differential Revision: https://phabricator.services.mozilla.com/D250325
2025-05-29 08:29:15 +00:00
iulian moraru 5fec3e70d0 Revert "Bug 1967569 - Use the non-native theme on windows. r=desktop-theme-reviewers,win-reviewers,dao,handyman" for causing bc failures on browser_1003588_no_specials_in_panel.js.
This reverts commit 1b644d2384.
2025-05-29 02:44:03 +00:00
Emilio Cobos Álvarez 1b644d2384 Bug 1967569 - Use the non-native theme on windows. r=desktop-theme-reviewers,win-reviewers,dao,handyman
This is to be landed after the soft-freeze of course. This patch aligns
with Linux, removing the ability to draw native-looking buttons and
progress-bars on Windows.

Note that checkboxes, menus, and a bunch of other things already use
non-native drawing (including virtually all our main browser UI), so
this only affects "secondary" UI: the old profile manager, a couple
dialogs, the bookmarks sidebar panel searchbox, page info window...

Also, we already effectively fallback to the non-native theme in dark
mode, and our non-native theme looks reasonably windows-like.

Advantages (apart from not having to maintain all this code) is that the
non-native theme is also faster, and this paves the way towards making
the layout side of theming simpler.

In order to make buttons still react to hover feedback, fix the
button{hover/active} system colors to match the windows task manager.
Also adjust the padding to match what the non-native theme returned.

Things that I've tested:

 * Buttons (profile manager, create profile wizard, page info window).
 * Trees and other listboxes (profile manager, page info window).
 * <input type=text> (bookmarks sidebar)
 * <menulist> (ask to save dialog, note it needs D250006 to show the
   dropmarker and have the right spacing).

Things that were supported but are unused (to the best of my ability):

 * <progress> (there are a few like the downloads popup but they're
   custom).
 * <input type=range>

Note that the places window already uses non-native painting.

IMHO the only thing that _could_ be considered a regression is the
button rendering (debatable tho). I think longer term we might want to
move to our design system's button tokens and such, but over all things
look a bit more consistent and I'm happy to look at improving the colors
here in a follow-up to match the Win32 blue or something else if we deem
it worth it.

Differential Revision: https://phabricator.services.mozilla.com/D250325
2025-05-29 00:16:22 +00:00
Emilio Cobos Álvarez 60ef90b355 Bug 1967551 - Remove native tabbox support. r=desktop-theme-reviewers,mac-reviewers,win-reviewers,tabbrowser-reviewers,gstoll,mstange,dao
Eventually I want to simplify a lot of how the theming code deals with
overriding border / padding, and this helps with that.

Since bug 1765076 this isn't used anywhere, so I think simplifying this
is the right trade-off. Thunderbird also doesn't use it.

Differential Revision: https://phabricator.services.mozilla.com/D250314
2025-05-25 12:31:48 +00:00
Emilio Cobos Álvarez f26eb3915c Bug 1967530 - Remove AssumeThemePartAndStateAreTransparent. r=win-reviewers,handyman
We no longer draw native menus.

Differential Revision: https://phabricator.services.mozilla.com/D250288
2025-05-20 20:08:28 +00:00
Emilio Cobos Álvarez c6c3fc84c0 Bug 1967530 - Remove some xpcom gunk from nsITheme. r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D250282
2025-05-20 20:08:25 +00:00
agoloman 5cbe8c23b6 Revert Bug 1967530 - for causing build bustages.
This reverts commit 9ea62cb6aa.

Revert "Bug 1967530 - Remove AssumeThemePartAndStateAreTransparent. r=win-reviewers,handyman"

This reverts commit f036ae0fdb.

Revert "Bug 1967530 - Remove some xpcom gunk from nsITheme. r=win-reviewers,gstoll"

This reverts commit 9c54c6c68a.

Revert "Bug 1967530 - Clean-up a bit nsNativeThemeGTK. r=stransky"

This reverts commit d040aadf24.
2025-05-20 19:44:50 +00:00
Emilio Cobos Álvarez f036ae0fdb Bug 1967530 - Remove AssumeThemePartAndStateAreTransparent. r=win-reviewers,handyman
We no longer draw native menus.

Differential Revision: https://phabricator.services.mozilla.com/D250288
2025-05-20 18:18:49 +00:00
Emilio Cobos Álvarez 9c54c6c68a Bug 1967530 - Remove some xpcom gunk from nsITheme. r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D250282
2025-05-20 18:18:23 +00:00
Emilio Cobos Álvarez 6ea983210f Bug 1967137 - Remove some leftover usage of StyleAppearance::Tabpanel from windows theme. 2025-05-19 13:53:23 +00:00
Emilio Cobos Álvarez 81d6becfd1 Bug 1967137 - Remove unused appearance: tabpanel. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D249896
2025-05-19 11:55:50 +00:00
Sylvestre Ledru 8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
Emilio Cobos Álvarez 736c521ce8 Bug 1964518 - GTK theme needs the combobox dropmarker after bug 1963446. r=stransky
Since now we rely on the non-native combobox button, we need the same
dropmarker.

Remove a useless override for the native windows theme too.

Differential Revision: https://phabricator.services.mozilla.com/D247838
2025-05-06 08:27:02 +00:00
Emilio Cobos Álvarez 084a9256fd Bug 1956626 - Merge nsUXThemeData into nsLookAndFeel. r=dshin
There's no reason this is a separate singleton. This makes sure they are in sync.

THEMECHANGED already triggers LookAndFeel updates via WinEventObserver.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D243342
2025-03-28 15:54:26 +00:00
Cristian Tuns 0a2813f099 Backed out 4 changesets (bug 1956626) for causing bc failures in browser_pdfjs_hcm.js CLOSED TREE
Backed out changeset f142a8ccc8cd (bug 1956626)
Backed out changeset c3ca3f7bd01a (bug 1956626)
Backed out changeset 69eea36a53e7 (bug 1956626)
Backed out changeset 51cb3861c345 (bug 1956626)
2025-03-27 17:04:07 -04:00
Emilio Cobos Álvarez a29d4df063 Bug 1956626 - Merge nsUXThemeData into nsLookAndFeel. r=dshin
There's no reason this is a separate singleton. This makes sure they are in sync.

THEMECHANGED already triggers LookAndFeel updates via WinEventObserver.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D243342
2025-03-27 18:27:40 +00:00
Emilio Cobos Álvarez 3d1806d8f8 Bug 1938683 - Don't support menulist-button as a proper widget. r=dshin
Use it only to enable the combobox dropmarker. This matches wpt and
blink.

Differential Revision: https://phabricator.services.mozilla.com/D240314
2025-03-04 15:21:34 +00:00
Otto Länd dbac92b75b Bug 1946161: apply code formatting via Lando
# ignore-this-changeset
2025-02-06 00:20:26 +00:00
Emilio Cobos Álvarez 32fcd9b466 Bug 1946161 - Simplify spinner-related appearance values. r=stransky,mac-reviewers,spohl
* Spinner and spinner-textfield are totally unused.
 * up/down buttons are only used for <input type=number>. The only
   number inputs we have in our UI use the non-native theme already (the
   print preview dialog).
 * Windows already always uses non-native spinner up/down unconditionally, and
   linux does it on mismatched color scheme.

We can probably live without native theme support for these. It's
completely unused right now.

Differential Revision: https://phabricator.services.mozilla.com/D236904
2025-02-05 22:05:38 +00:00
Emilio Cobos Álvarez 3e829bc2f0 Bug 1918762 - Simplify theme attribute/state change invalidation. r=jwatt
We had the same list of attributes in multiple places, put it in
Theme.cpp.

Only a few states can change widget state. Just hardcode them in
RestyleManager.cpp (where there was already some of it) instead of
reusing a weird API.

Shouldn't have any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D222160
2024-09-16 22:02:05 +00:00
Iulian Moraru 39f742bf8e Backed out changeset 62cb18f600a3 (bug 1918762) for causing build bustages related to nsITheme. CLOSED TREE 2024-09-16 22:10:00 +03:00
Emilio Cobos Álvarez 5498f47c8e Bug 1918762 - Simplify theme attribute/state change invalidation. r=jwatt
We had the same list of attributes in multiple places, put it in
Theme.cpp.

Only a few states can change widget state. Just hardcode them in
RestyleManager.cpp (where there was already some of it) instead of
reusing a weird API.

Shouldn't have any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D222160
2024-09-16 17:38:52 +00:00
Sylvestre Ledru a3ea006705 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Emilio Cobos Álvarez 2c8136e86b Bug 1889429 - Remove most native tree code. r=mac-reviewers,desktop-theme-reviewers,places-reviewers,win-reviewers,dao,handyman,mstange
Most of this code is already dead. The native appearance on macOS
doesn't work on dark mode, and on Windows and Linux we are already
overriding it.

Add a first-column tree property to be able to align the inner borders
on macOS properly.

Differential Revision: https://phabricator.services.mozilla.com/D206526
2024-05-06 19:22:35 +00:00
Emilio Cobos Álvarez 7de669cb54 Bug 1750072 - Allow to opt-out of password reveal using appearance: textfield. r=jwatt
Much like we do for the number input spinners.

Differential Revision: https://phabricator.services.mozilla.com/D208673
2024-05-06 15:13:35 +00:00
Emilio Cobos Álvarez 7a0992e032 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-30 12:17:57 +00:00
Norisz Fay 813d8a5f99 Backed out changeset 2f7b9a6f09ca (bug 1888203) for causing file conflict while backing out Bug 1887063 2024-03-28 00:30:13 +02:00
Emilio Cobos Álvarez 4fe0b9b0ee Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-27 18:00:07 +00:00
Emilio Cobos Álvarez 1b1835b4aa Bug 1866022 - Teach GTK to render non-native tree columns and toolbars. r=dao,stransky,desktop-theme-reviewers
This fixes various things, like sort arrows not working, even in regular
non-mixed-color-scheme settings, and is a lot less code.

The toolbarbutton appearance on the problematic case described in
comment 0 could get some work (the extra borders aren't exactly pretty),
but it's still a much better improvement.

Differential Revision: https://phabricator.services.mozilla.com/D195345
2023-12-04 18:57:35 +00:00
Emilio Cobos Álvarez 24fe7cd3cc Bug 1858349 - Remove now-unused menuarrow code. r=spohl,mac-reviewers,win-reviewers,rkraesig
The windows bits were already unused.

Depends on D190663

Differential Revision: https://phabricator.services.mozilla.com/D190664
2023-10-11 19:37:40 +00:00
Emilio Cobos Álvarez 47296916c6 Bug 1846782 - Fix nsNativeTheme*::GetWidget{Border,Padding} for always-non-native widgets. r=aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D185186
2023-08-02 20:30:21 +00:00
Emilio Cobos Álvarez 8e6e9cd35b Bug 1845623 - Make some form controls always non-native on Windows. r=mhowell,desktop-theme-reviewers,dao
In particular, spinner buttons, checkboxes, radio buttons, and the
menulist arrow.

These are all windows-style anyways, and look better than the native
counter-parts because they support webrender, zooming and scaling, etc.

The easiest way to see some of this in action is using ./mach run -P.

Differential Revision: https://phabricator.services.mozilla.com/D184648
2023-07-28 11:06:47 +00:00
Emilio Cobos Álvarez f9e8ec8dc6 Bug 1845636 - Allow browser chrome to enable the non-native theme. r=dshin
I tried to reftest this, but actually the non-native-theme is already
enabled on all reftests, so...

Differential Revision: https://phabricator.services.mozilla.com/D184740
2023-07-27 22:09:10 +00:00
Natalia Csoregi 270146a4ed Backed out changeset 5939e79c9c50 (bug 1845636) for causing multiple failures moz-theme related. CLOSED TREE 2023-07-27 22:32:23 +03:00
Emilio Cobos Álvarez 30f3f65894 Bug 1845636 - Allow browser chrome to enable the non-native theme. r=dshin
I tried to reftest this, but actually the non-native-theme is already
enabled on all reftests, so...

Differential Revision: https://phabricator.services.mozilla.com/D184740
2023-07-27 18:08:01 +00:00
Emilio Cobos Álvarez a75763ea20 Bug 1845623 - Fix windows build because of wrongly-split patch.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-07-27 17:54:47 +02:00
Emilio Cobos Álvarez 13fba10a6b Bug 1845623 - Remove more dead native appearance values. r=mhowell
Everytime I look at this code I find more stuff to remove... :)

-moz-default-appearance: groupbox is not used anywhere.

menulist-text is, but it does nothing (it only would prevent drawing a
background, but we don't specify another background anyways).

Differential Revision: https://phabricator.services.mozilla.com/D184647
2023-07-27 14:39:09 +00:00
Emilio Cobos Álvarez e59a831ff4 Bug 1845540 - Remove some unused win-specific system colors and appearance values. r=mstange,devtools-reviewers,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D184597
2023-07-26 20:57:47 +00:00
Masatoshi Kimura a3e419385e Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-26 08:52:54 +00:00
Natalia Csoregi 42e803a2dd Backed out 19 changesets (bug 1844908) for causing win bustage on AvailableMemoryTracker.cpp. CLOSED TREE
Backed out changeset 44c66f2233cf (bug 1844908)
Backed out changeset a8010ff534bf (bug 1844908)
Backed out changeset 225dc3aeb220 (bug 1844908)
Backed out changeset a1414db64e33 (bug 1844908)
Backed out changeset 7f1e0a527839 (bug 1844908)
Backed out changeset 6dc7646d1ffa (bug 1844908)
Backed out changeset 8d715131510f (bug 1844908)
Backed out changeset 4b6fe8a4e7db (bug 1844908)
Backed out changeset 2b419fabf1e8 (bug 1844908)
Backed out changeset af84e701d616 (bug 1844908)
Backed out changeset 2fa203969ec5 (bug 1844908)
Backed out changeset 2b3d2df94db3 (bug 1844908)
Backed out changeset 7eca452f5fd7 (bug 1844908)
Backed out changeset 3d961cf25afe (bug 1844908)
Backed out changeset 3c59143f8dd7 (bug 1844908)
Backed out changeset ab50c6c5425a (bug 1844908)
Backed out changeset b2c5636df673 (bug 1844908)
Backed out changeset e9a0f1c6760c (bug 1844908)
Backed out changeset 945ccbedde0b (bug 1844908)
2023-07-25 19:55:35 +03:00
Masatoshi Kimura 4182954d50 Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-25 14:41:05 +00:00
Emilio Cobos Álvarez f80408fefa Bug 1844242 - Remove now unused windows appearance code. r=handyman,devtools-reviewers
After bug 1843663 these aren't used on Windows.

Some values aren't used anywhere so I removed them as well.

Differential Revision: https://phabricator.services.mozilla.com/D183945
2023-07-20 19:50:11 +00:00
Emilio Cobos Álvarez 3b3b822f77 Bug 1844242 - Clean-up windows titlebar set-up now that buttons are always non-native. r=dao,handyman
Differential Revision: https://phabricator.services.mozilla.com/D183986
2023-07-20 13:33:19 +00:00
Emilio Cobos Álvarez 5524090db0 Bug 1844241 - Remove now-dead graphics glass code. r=tnikkel,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D183942
2023-07-19 12:44:34 +00:00
Emilio Cobos Álvarez ab25174385 Bug 1843663 - Remove pre windows-10-specific media queries and styles. r=dao,Gijs,handyman,settings-reviewers
Some basic clean-up. I want to do this before doing bigger changes in
bug 1843044.

There's tons more code that can get cleaned-up on the widget side, but
let's start with this.

Differential Revision: https://phabricator.services.mozilla.com/D183622
2023-07-18 14:11:33 +00:00
Razvan Cojocaru d313765c33 Bug 1840485 - Change the type of BaseMargin::{top,right,bottom,left} to Coord. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182328
2023-07-01 02:23:21 +00:00
Emilio Cobos Álvarez 8e6367b37d Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
I was looking into simplifying our scrollbar styles:

 * StyleAppearance::Resizer is not used in content, and some of the
   values were only for <xul:window> which are not supported anymore.

 * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
   once on macOS so we only need to keep it there.

Differential Revision: https://phabricator.services.mozilla.com/D178374
2023-05-24 11:13:58 +00:00
Iulian Moraru 9c594bd090 Backed out changeset f020820671c4 (bug 1833403) for causing reftest failures on resizer-bottomend.xhtml. CLOSED TREE 2023-05-24 01:48:48 +03:00
Emilio Cobos Álvarez 3bc9e17a57 Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
I was looking into simplifying our scrollbar styles:

 * StyleAppearance::Resizer is not used in content, and some of the
   values were only for <xul:window> which are not supported anymore.

 * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
   once on macOS so we only need to keep it there.

Differential Revision: https://phabricator.services.mozilla.com/D178374
2023-05-23 15:43:45 +00:00