Commit Graph

91 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
41b553596d Bug 1406631: Remove the color-picker-available system metric. r=xidorn
All our widgets support it with a constant true.

MozReview-Commit-ID: JMEItUsxYWq
2017-10-07 14:06:44 +02:00
Sebastian Hengst
31ab915b94 Backed out changeset f70d6fcdb760 (bug 1406631) for failing color related reftests like layout/reftests/writing-mode/ua-style-sheet-input-color-1.html on Android. r=backout 2017-10-07 20:08:12 +02:00
Emilio Cobos Álvarez
ac4350b60d Bug 1406631: Remove the color-picker-available system metric. r=xidorn
All our widgets support it with a constant true.

MozReview-Commit-ID: JMEItUsxYWq
2017-10-07 14:06:44 +02:00
Brad Werth
1a3ca2a62b Bug 1401063: Cache remaining gtk window and button colors to eliminate on-demand gtk calls in ::NativeGetColor. r=karlt
MozReview-Commit-ID: HbZqBUG0w7y
2017-09-19 13:00:28 -07:00
Karl Tomlinson
e376ffbf74 bug 1396722 remove no-op ReleaseStyleContext() r=stransky+263117
MozReview-Commit-ID: DgKM0wrStrk
2017-09-05 09:16:01 +12:00
Karl Tomlinson
9d2f00dbbd bug 1384701 get system fonts in EnsureInit() which is on main thread even with servo r=manishearth
GTK should be used only from the main thread, but the specific symptom before
this change was that creating a GtkEntry causes
pango_cairo_font_map_get_default() to be called.  This function returns a
different font map on each thread.  The font map is leaked when StyleThreads
are leaked at exit.

Font caches are usually expensive and so using the existing font map on the
main thread is preferable.

A GtkEntry already exists on the main thread, as well as style contexts for
most other system fonts, and so it is more efficient to create these on the
main thread while the style contexts exist.

Doing this also avoids the need for Gecko_nsFont_InitSystem() to hold a global
lock to avoid concurrently calling into GTK through LookAndFeel::GetColor().

MozReview-Commit-ID: DSOwEUeYmtV
2017-09-04 18:29:04 +12:00
Karl Tomlinson
e7d47b77ad bug 1384701 get system font name and size from widget style context instead of GtkSettings r=manishearth
gtk_widget_get_settings() returns the same settings for all widgets [1] but
GTK actually uses specific fonts for each widget [2].

[1] https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.19#n11637
[2] https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.19#n10334

Changing to GtkStyleContext* will also make this easier to use from code where
the GtkStyleContext exists but not the GtkWidget, such as EnsureInit() in a
future patch.

MozReview-Commit-ID: 3NuTL5wRzm5
2017-09-04 21:33:21 +12:00
Karl Tomlinson
1e53f5773b bug 1384701 remove MOZ_WIDGET_GTK == 2 code from nsLookAndFeel r=manishearth
This old code no longer builds and is superseded by the GTK3 port.
See also bug 1278282.

MozReview-Commit-ID: 9KyrPuNAluv
2017-09-04 17:36:17 +12:00
Martin Stransky
2278e26885 Bug 1314928 - get link text color by GTK_STATE_FLAG_LINK on Gtk3 >= 3.12, r=karlt
MozReview-Commit-ID: BPR2AgoUx5H
2017-08-25 10:30:28 +02:00
Sebastian Hengst
2d44a20a04 Backed out changeset 1f349caf1814 (bug 1314928) for bustage at widget/gtk/nsLookAndFeel.cpp:47: invalid conversion from 'int' to 'GtkStateFlags'. r=backout on a CLOSED TREE 2017-08-25 10:51:20 +02:00
Martin Stransky
22d0d52a6c Bug 1314928 - get link text color by GTK_STATE_FLAG_LINK on Gtk3 >= 3.12, r=karlt
MozReview-Commit-ID: BPR2AgoUx5H
2017-08-25 10:30:28 +02:00
Manish Goregaokar
91f4d493c1 Bug 1386915 - Add nsLookAndFeel::NativeInit() virtual call for initializing native-side state; r=jfkthame
MozReview-Commit-ID: 8XKSC1AOI0N
2017-08-06 15:41:08 -07:00
Manish Goregaokar
4e04e1a156 Bug 1386915 - Assert when nsLookAndFeel calls GTK off main thread; r=bholley
MozReview-Commit-ID: 9H9dE02bZel
2017-08-06 15:41:05 -07:00
Nicholas Nethercote
09493fcbcf Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj. 2017-07-31 14:28:48 +10:00
Samael Wang
093c09ab69 Bug 1350643 - Part 1: Rename gfxPlatformGtk::GetDPI/GetDPIScale to GetFontScaleDPI/GetFontScaleFactor to better distinguish from nsIWidget::GetDPI. r=karlt
MozReview-Commit-ID: 4fxMG1FBlM8
2017-06-14 16:54:21 +08:00
Martin Stransky
a1e8b3742b Bug 1353147 - Allow Gtk+ theme override, r=karlt
Allow to override Gtk+ theme for content process when e10s is enabled.

MozReview-Commit-ID: 1Kd2jLpBavA
2017-04-04 22:30:12 +02:00
Martin Stransky
e90e261991 Bug 1158076 - postpone nsLookAndFeel module initialization, r=karlt
MozReview-Commit-ID: JY83xiXT1xf
2017-03-30 15:03:50 +02:00
Martin Stransky
526504cd3c Bug 1158076 - add prefs to enable GTK dark themes in each process, r=karlt
Add two new prefs (widget.chrome.allow-gtk-dark-theme and widget.content.allow-gtk-dark-theme) to enable dark
themes in chrome and content when e10s is enabled.

When e10s is disabled then widget.chrome.allow-gtk-dark-theme controls both chrome and web content settings.

That may be a bit confusing but it's going to be here for two releases only (Firefox 57 is going to have e10s enabled by default) and actually matches recent state when only one ENV pref is used for both chrome and web content.

The existing MOZ_ALLOW_GTK_DARK_THEME environment variable is still considered, but, now is like widget.chrome.allow-gtk-dark-theme, no longer affecting separate content processes.

MozReview-Commit-ID: CCwriA66CNj
2017-03-31 10:40:07 +02:00
Karl Tomlinson
19a2b54f9a bug 1343802 update notebook_has_tab_gap and scrollbar metrics after theme changes r=jhorak+328198
MozReview-Commit-ID: IRPXNwLe5Ey
2017-03-27 20:32:38 +02:00
Karl Tomlinson
f6a03a5d0f bug 1343802 remove moz_gtk_get_scrollbar_widget() r=jhorak+328198
This was used with GTK2, but is now unnecessary as discussed in bug 1278282.

moz_gtk_init() is now called from only one place and so will be called only
once.

MozReview-Commit-ID: 2KwJop6qsV9
2017-03-27 20:32:29 +02:00
Sebastian Hengst
61c3d88381 Backed out changeset af279778b154 (bug 1343802) 2017-03-27 18:00:14 +02:00
Sebastian Hengst
4a885f60d2 Backed out changeset 45330fa58671 (bug 1343802) 2017-03-27 18:00:05 +02:00
Kan-Ru Chen
59bfd6e8d3 Bug 1194751 - Part 5. Implement ScreenHelperGTK and delete old nsScreenManagerGtk/nsScreenGtk. r=karlt
ScreenHelperGTK is the platform dependent part of the original
nsScreenManagerGtk and nsScreenGtk. It registers monitors-changed
event listener from gtk and pushes updates to ScreenManager. See patch
part 4. for how ScreenManager works.

MozReview-Commit-ID: KBo7ZLFTjM3
2017-03-09 19:29:44 +08:00
Karl Tomlinson
85e3a14782 bug 1343802 update notebook_has_tab_gap and scrollbar metrics after theme changes r=jhorak+328198
MozReview-Commit-ID: IRPXNwLe5Ey
2017-03-21 17:27:41 +13:00
Karl Tomlinson
8d971e1f22 bug 1343802 remove moz_gtk_get_scrollbar_widget() r=jhorak+328198
This was used with GTK2, but is now unnecessary as discussed in bug 1278282.

moz_gtk_init() is now called from only one place and so will be called only
once.

MozReview-Commit-ID: 2KwJop6qsV9
2017-03-21 17:14:55 +13:00
Karl Tomlinson
d4af5b3a9d bug 1328352 set alpha component appropriately in operator over for -moz-field r=stransky+263117
MozReview-Commit-ID: AP9JfZTKDse
2017-01-04 08:43:20 +13:00
Karl Tomlinson
f58ab04926 bug 1320860 consider textview root node background in addition to text node for -moz-field r=stransky+263117
This is necessary for GTK versions > 3.18 because windows no
longer clear their backgrounds since
https://git.gnome.org/browse/gtk+/commit/?id=580ea227a6bb19ad6c6d4766b3a36dbad24583f3
and Ambiance for 3.20 has a transparent background for the "text" window.
See bug 1324262.

MozReview-Commit-ID: FL16Gx1EQR
2017-01-03 13:08:07 +13:00
Karl Tomlinson
8f181fea80 bug 1320860 introduce MOZ_GTK_TEXT_VIEW_TEXT and move MOZ_GTK_RESIZER to WidgetStyleCache r=stransky+263117+263117
The style context for MOZ_GTK_TEXT_VIEW is now created by copying from the
widget instead of caching a widget and using its context.

No rendering changes are expected, unless themes are animating GtkTextView
backgrounds.

MozReview-Commit-ID: 9aW61kMkKcb
2016-12-30 13:37:51 +13:00
Dão Gottwald
026a8b4e76 Backed out changeset 6c2cedbdeb65 (bug 1322120) for causing bug 1324262 2016-12-18 22:27:43 +01:00
Karl Tomlinson
32782da87a bug 1322120 use text node for field and selected colors r=stransky+263117
This adjustment is required for changes to MOZ_GTK_TEXT_VIEW in a6aabcb07a6e.
MOZ_GTK_TEXT_VIEW_TEXT now retrieves the equivalent node from WidgetStyleCache.

MozReview-Commit-ID: 2zfHCKMT0ov
2016-12-08 10:39:36 -10:00
Martin Stransky
8414100759 Bug 1320686 - [nsLookAndFeel] Get styles for menu label, button text and combobox text colors from WidgetCache. r=karlt 2016-12-01 05:09:00 -05:00
Ryan VanderMeulen
1699961a7a Backed out changeset 810b7212a529 (bug 1320686) for causing Valgrind leaks. 2016-11-29 21:16:06 -05:00
Martin Stransky
7eb18538be Bug 1320686 - [nsLookAndFeel] Get styles for menu label, button text and combobox text colors from WidgetCache. r=karlt 2016-11-28 06:44:00 -05:00
Martin Stransky
f0fb6da9f3 Bug 1319753 - Use WidgetCache to get colors at nsLookAndFeelfor menuitems, text and tree view, r=karlt 2016-11-23 04:29:00 +01:00
Martin Stransky
fbd3524fea Bug 1319075 - Use WidgetCache to get colors at nsLookAndFeel for GtkButton, GtkWindow, GtkScrollBar, r=karlt
Needs patch from Bug 1319066 to clean apply.
2016-11-23 02:00:00 +01:00
Martin Stransky
52e97a953d Bug 1319066 - Move complete GtkTooltip stack to WidgetCache. r=karlt 2016-11-23 21:14:58 -05:00
Karl Tomlinson
7aa33ad001 bug 1315527 check root node of frame for border color if no border on the "border" subnode r=stransky+263117
Some themes do not draw the "border" subnode, but instead draw a border on the
frame root node.

MozReview-Commit-ID: Fx67mQhhYmz
2016-11-21 18:07:48 +13:00
Jonathan Kingston
80b9bef57d Bug 1302157 - Remove images-in-menu and images-in-button code (& associated icons) since it's deprecated in GTK. r=bz,dholbert
MozReview-Commit-ID: IIj8PvgdaRp
2016-09-29 00:22:32 +01:00
Thomas Wisniewski
7e0d399ac0 Bug 1302937 - Remove -moz-mac-lion-theme. r=mstange 2016-09-16 14:42:19 -04:00
Benjamin Neff
b590458ead Bug 1272332 - Allow dark gtk theme with environment variable. r=karlt 2016-08-05 15:21:00 +02:00
Carsten "Tomcat" Book
186ae7c42a Merge mozilla-central to fx-team 2016-07-28 17:44:58 +02:00
Dão Gottwald
643a79a03b Backed out changeset 0f052f1a6a05 (bug 1272332) 2016-07-28 08:35:17 +02:00
Martin Stransky
b5347794dc Bug 1287085 - Move GtkInfoBar from gtk3drawing to WidgetCache. r=acomminos 2016-07-19 00:03:00 -04:00
Andrew Comminos
6948f93ec5 Bug 1266914 - Use the border subnode for GtkFrame to fetch border colours. r=karlt
MozReview-Commit-ID: 4muOcOStA7A
2016-07-25 10:32:12 -04:00
Nicolas Silva
118193b043 Bug 1272332 - Allow gtk the global dark theme behind a pref. r=karlt 2016-06-21 14:51:03 +02:00
Karl Tomlinson
d83b8739d3 Bug 1250704 - use same widget heirarchy as GTK for tooltip text color. r=stransky
MozReview-Commit-ID: 41sDYu3IqYq
2016-06-07 18:06:04 +12:00
Karl Tomlinson
4db0ce3bb7 Bug 1250704 - use style from WidgetStyleCache for tooltip colors. r=stransky
MozReview-Commit-ID: 9xzL8ckxTRQ
2016-06-07 16:11:51 +12:00
Carsten "Tomcat" Book
6c5d21f2f7 Backed out changeset f6f125b1088b (bug 1250704) 2016-06-08 13:46:13 +02:00
Carsten "Tomcat" Book
7b7da2aa80 Backed out changeset af36af25ecf4 (bug 1250704) 2016-06-08 13:46:11 +02:00
Karl Tomlinson
3cca0de956 Bug 1250704 - use same widget heirarchy as GTK for tooltip text color. r=stransky
MozReview-Commit-ID: 41sDYu3IqYq
2016-06-07 18:06:04 +12:00