Commit Graph

64 Commits

Author SHA1 Message Date
Martin Stransky
0a0c720a69 Bug 1443481 - [Linux/Titlebar] Construct widget tree to get correct titlebar icon style before we render the actual icon, r=jhorak
MozReview-Commit-ID: DEb2pU31os9

--HG--
extra : rebase_source : f68034829b16c9def34436dc6e33b393865348bc
2018-03-06 16:45:19 +01:00
Martin Stransky
066945c7bc Bug 1434646 - Titlebar rendering - Place titlebar buttons in GtkBox, r=jhorak
Some themes (Ambiance for instance) uses first-child/last-child css selectors
to style titlebar buttons. Ubuntu Ambiance theme places titlebar buttons closer
by negative margin applied to them.

We put titlebar buttons to GtkBox as well as Gtk+ does and also keep
the button order here to match first-child/last-child selectors. It also means
we must have maximize/restore as one button to keep the correct order.

MozReview-Commit-ID: 9mqljOa4Vu7

--HG--
extra : rebase_source : 9c31a2073d1bb247ce9d0240333143661b8ae4b8
2018-02-23 21:28:37 +01:00
Martin Stransky
fb13e4d63d Bug 1433068 - Titlebar/Linux - load and draw HiDPI titlebar icons on HiDPI screens, r=jhorak
MozReview-Commit-ID: KxbBvf6mgo1

--HG--
extra : rebase_source : f1c3b083d4e83684b1046a3c439d802de6547c21
2018-02-20 16:16:23 +01:00
Martin Stransky
afa356a144 Bug 1408335 - Render titlebar icons as themed ones, r=jhorak
Render titlebar button icons as a part of -moz-window-button-* appearence. It allows us to
theme the icons accordingly. We add a GtkImage widget to header bar buttons as Gtk+ does and
store icon pixel data there and render it at moz_gtk_header_bar_button_paint() as a part
of the buttons. It means that the toolbar buttons are not containers and
moz_gtk_get_widget_border() returns zero border for them.

Also implement GetToolbarButtonMetrics() per button.

MozReview-Commit-ID: gkAu3VmE3q

--HG--
extra : rebase_source : d1df34537901342969d1e33524b414a2786df541
2018-01-25 11:13:12 +01:00
Martin Stransky
0594ae2db5 Bug 1427999 - Use GetToolbarButtonMetrics() to get correct titlebar button size at nsNativeThemeGTK::GetMinimumWidgetSize, r=jhorak
MozReview-Commit-ID: HfPUk30LaJn

--HG--
extra : rebase_source : ef406e78e686a6ae190a0fbdb9aa945e40503ac6
2018-01-22 12:09:09 +01:00
Sylvestre Ledru
2c6660f219 Bug 1278282 - Ride along Remove some trailing whitespaces r=lsalzman
MozReview-Commit-ID: 8W6VKIW8PQV

--HG--
extra : rebase_source : 23b5c300dd4bebe2b8808bdb03373073aab80b9f
2017-12-19 11:38:59 +01:00
Martin Stransky
2c1a8317ac Bug 1364843 - Allow MOZ_GTK_HEADER_BAR* widget creation, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: 18U3GBrTyVW

--HG--
extra : rebase_source : 7a203d5c4d1856d24f08c2ea42ad4519d283ab73
2017-09-19 20:34:31 +02:00
Martin Stransky
089986546e Bug 1364843 - Implement GtkHeaderBar widgets at WidgetCache, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: HzzXDqE0s5n

--HG--
extra : rebase_source : d929e03d7ab84229101b9c11cdb35396547860e4
2017-09-19 18:20:48 +02:00
Karl Tomlinson
00beb33110 bug 1396722 remove no-op ReleaseStyleContext() r=stransky+263117
MozReview-Commit-ID: DgKM0wrStrk

--HG--
extra : rebase_source : a26fdc5e5d6c63e21bb98a19ee7bf58042f9b3ba
2017-09-05 09:16:01 +12:00
Martin Stransky
9ed3f34e0f Bug 1389133 - don't invalidate style content for missing widgets, r=karlt
MozReview-Commit-ID: 2KfjYGvsiVv

--HG--
extra : rebase_source : 86984393bb22a7708089b5ed6da1201f9458e6e7
2017-08-10 18:07:41 +02:00
Karl Tomlinson
7f6c7692a4 bug 1365556 invalidate widget style contexts after their ancestors are set r=stransky+263117
Although this is only known to affect buttons with builtin child widgets, it
is difficult to audit all GTK widgets for similar situations, and so the same
defense is applied to all widgets.

MozReview-Commit-ID: LMVXX3UYqR9

--HG--
extra : rebase_source : d327addad8d2b0e070c6ca86c6e38271c8431a23
2017-08-01 09:17:46 +12:00
Karl Tomlinson
fb0c2feb3e bug 1319650 mimic gtk_style_context_save() in WidgetStyleCache with a new context r=stransky+263117
This makes balancing with gtk_style_context_restore()/ReleaseStyleContext()
unnecessary, and the style resolution cached in the style contexts is not
invalidated so frequently.

MozReview-Commit-ID: BKwyqoQsjv2

--HG--
extra : rebase_source : 4733d66f8265007555cc17568033ece09e6cb2dc
2016-12-02 12:39:23 +13:00
Karl Tomlinson
ff46e3c8cb bug 1362170 force a style resolution on context creation to set GTK 3.4 theming_engine r=stransky+263117
This works around a GTK bug that led to the default engine being used instead
for the first draw.

MozReview-Commit-ID: 4r48HNUgVBE

--HG--
extra : rebase_source : 83a964e02dba97cb0b52acde6b692d241c03ed57
2016-12-14 19:22:28 +13:00
Karl Tomlinson
9e1122a84a bug 1320860 adjust textarea style contexts for GTK 3.20 theming ABI changes r=stransky+263117+263117
MozReview-Commit-ID: JTQO5bK5Yvv

--HG--
extra : rebase_source : beb69dd204d7459eca52ad8f995f60651f3d6188
2016-12-30 13:44:55 +13:00
Karl Tomlinson
5f631b2b35 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

--HG--
extra : rebase_source : 279c8b15e58c3f0fff51f41a4afacfebfbfa5739
2016-12-30 13:37:51 +13:00
Karl Tomlinson
2041039808 bug 1320860 Back out changeset a6aabcb07a6e for causing bug 1322120 or bug 1324262
--HG--
extra : rebase_source : c77a5627ebb851b3f70da2917c68b9ae3683247b
2016-12-29 18:05:42 +13:00
Karl Tomlinson
7aedf3100d bug 1323860 implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache r=stransky
MozReview-Commit-ID: 1VOZKRw3gj4

--HG--
extra : amend_source : 4b1b21c8f0173b4968df7f2c46a7bd840f429ef0
2016-11-25 17:51:13 +13:00
Sebastian Hengst
eab6639cc7 Backed out changeset 83021e7eb511 (bug 1319650) for various form styling issues on Linux. r=backout 2016-12-01 22:39:20 +01:00
Sebastian Hengst
1e778d566b Backed out changeset 70d7c1534715 (bug 1319650) 2016-12-01 22:38:36 +01:00
Karl Tomlinson
ae355be799 bug 1319650 mimic gtk_style_context_save() in WidgetStyleCache with a new context r=stransky+263117
This makes balancing with gtk_style_context_restore()/ReleaseStyleContext()
unnecessary, and the style resolution cached in the style contexts is not
invalidated so frequently.

MozReview-Commit-ID: BKwyqoQsjv2

--HG--
extra : rebase_source : 44c82ff74e1e52046799659f3bfa37c7faafeb58
2016-11-23 16:41:57 +13:00
Karl Tomlinson
8caa8a2459 bug 1319650 implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache r=stransky+263117
MozReview-Commit-ID: 1VOZKRw3gj4

--HG--
extra : rebase_source : 97cf866ee58a6b06b0bcfa850a50e3a24304d70d
2016-11-25 17:51:13 +13:00
Karl Tomlinson
33ed3a5c42 bug 1320860 adjust textarea style contexts for GTK 3.20 theming ABI changes r=stransky+263117
MozReview-Commit-ID: 9aW61kMkKcb

--HG--
extra : rebase_source : 61f7699933735710ed8e516e5206900cff5c6fc0
2016-11-29 17:58:00 +13:00
Phil Ringnalda
2160edf69f Backed out changeset eb4be9ed211e (bug 1319650) for reftest and chrome bustage
CLOSED TREE
2016-11-24 19:30:48 -08:00
Karl Tomlinson
777838332c bug 1319650 mimic gtk_style_context_save() in WidgetStyleCache with a new context r=stransky+263117
This makes balancing with gtk_style_context_restore()/ReleaseStyleContext()
unnecessary, and the style resolution cached in the style contexts is not
invalidated so frequently.

MozReview-Commit-ID: BKwyqoQsjv2

--HG--
extra : rebase_source : 2091fc84a9ecb8b55e7d3e36e72cbd03ea826ac8
2016-11-23 16:41:57 +13:00
Karl Tomlinson
5ce06744be bug 1319957 don't realize widgets for their style r=stransky+263117
This was needed in GTK2 to get the style of the widget, but styles are almost
independent of widgets with GTK3, where realizing is not necessary to get the
style context.

MozReview-Commit-ID: GtL2FLDl9uA

--HG--
extra : rebase_source : 926e6b7fee9a15fe5c86be7327c60b146db11316
2016-06-21 19:07:45 +12:00
Martin Stransky
55195fe393 Bug 1319066 - Move complete GtkTooltip stack to WidgetCache. r=karlt
--HG--
extra : rebase_source : ba5b1f0bfc279a64328486de8a0cd63b8a44b08f
2016-11-23 21:14:58 -05:00
Karl Tomlinson
dae2522336 bug 1319355 remove unused MOZ_GTK_IMAGEMENUITEM r=stransky+263117
Unused since e7680c5fead3.

MozReview-Commit-ID: DYgeoJDxna9

--HG--
extra : rebase_source : 711a050a98594df315a63c7ffb3606b81e11f53b
2016-11-22 09:17:34 +13:00
Karl Tomlinson
42b8d039df bug 1319353 CreateCSSNode: Copy classes from the parent style context to its corresponding node in the path r=stransky+263117
This is necessary for GTK to match CSS rules against classes on ancestor nodes
of style contexts constructed from paths.

It can be tested with the following in ~/.config/gtk-3.0/gtk.css

tooltip.background label {padding: 100px;}

MozReview-Commit-ID: EUQ9ndeSl1Z

--HG--
extra : rebase_source : 95c267c5495791a40e755aacf14a80c750fbedd2
2016-11-16 16:55:13 +13:00
Karl Tomlinson
759a5af4c7 bug 1317574 rename radio/check menuitem and indicator as used with ClaimStyleContext r=stransky+263117
The same name is retained for moz_gtk_widget_paint(), which is now more
consistent.

MozReview-Commit-ID: 9RtW66JQVGX

--HG--
extra : rebase_source : 3067daa4e9347cf689e9dccbd7e07578b52cf59c
2016-11-18 13:01:27 +13:00
Karl Tomlinson
f1b0f33678 bug 1315668 construct menuitem style contexts from paths r=stransky+263117
instead of using the context belonging to a widget.
Only the style context is cached, instead of the whole widget.

Using the style context from a widget meant that rendering displayed the
initial appearance of animations after state changes, but there was no
invalidation to trigger the final rendering in the animations.

Style contexts constructed from paths do not incorporate animations.
(See gtk_css_path_node_update_style() in GTK.)  Therefore they provide the
appropriate rendering for Gecko's model, which is not expecting animations.

There is no mechanism available to display animations when using style
contexts constructed from paths, but the GtkWidget animation design is also
not suitable for rendering potentially multiple elements each in a different
state of their animation.

This contexts-from-paths approach can be extended also to other widget types,
but this is a smaller change intended for uplift to other branches to address
a regression in menuitem rendering.

MozReview-Commit-ID: EFV7swWQtm4

--HG--
extra : rebase_source : 689f7340007c889ce0eaeb3b4acd228d45ad0d6d
2016-11-15 17:11:14 +13:00
Karl Tomlinson
58fe36c651 bug 1315668 CreateStyleForWidget: store classes on context instead of path r=stransky+263117
CreateStyleForWidget() then provides the same behavior with
g_style_context_save() as contexts from widget root style nodes.

MozReview-Commit-ID: 6lRCp3XOoRr

--HG--
extra : rebase_source : ad161eef11e0dc70c8a487c204f109eceac3b1c4
2016-11-15 15:29:06 +13:00
Martin Stransky
4eaa17a7e4 Bug 1282753 - implement combo boxes by WidgetCache, r=?karlt
MozReview-Commit-ID: FrMbxT2D5p0

--HG--
extra : rebase_source : 4a9205597101ca283a05e92a15c0a1d188dae7cd
2016-10-19 15:13:25 +13:00
Jan Horak
b1c2f1be2f Bug 1289148 - Fixing scrollbar metrics for GTK >= 3.20 r=karlt
The Gtk 3.20 scrollbars has moved towards usual box model. The scrollbar,
trough,thumb and scrollbar button can now have margin, padding and border set,
different for each direction (ie. left, right, bottom, top). The scrollbar
metrics become ignored in Gtk 3.20 and later.

* Draw scrollbar element [for GTK 3.20+]
* The border for scrollbar, trough, thumb and scrollbar buttons is newly
  calculated as margin+padding+border [for GTK 3.20+].
* The margin is subtracted for scrollbar, trough and sb buttons during paint
  function [for GTK 3.6+]
* All scrollbar widget's borders transfered from
  nsNativeThemeGTK::GetWidgetBorder to the moz_gtk_get_widget_border.
* Added helper function NativeThemeToGtkTheme for mapping mozilla's widget type
  to the gtk widget type.
* Scrollbar troughs are now drawn even when there is not enough room for
  the thumb [GTK 3.20+]

MozReview-Commit-ID: jd2q67gKM1

--HG--
extra : rebase_source : ecc8b85401845113d84c6c5a48219a0c3d4f8de3
2016-10-17 11:37:13 +13:00
Karl Tomlinson
6b22cee582 bug 1301194 be more careful to only invalidate style context when state changes r=stransky+263117
Previously oldState differed from aStateFlags just because it contained
direction flags.

MozReview-Commit-ID: DuGpHdt9EuX

--HG--
extra : rebase_source : 05a06d130a51c7a1830804254ec87c6697ade4a8
2016-09-08 10:12:55 +12:00
Martin Stransky
727a172dcd Bug 1271524 - Move tab widget to WidgetCache. r=acomminos
--HG--
extra : rebase_source : 4f9b654b745934054f0ec2509ec3c21996aa2e68
2016-08-21 23:13:00 -04:00
Martin Stransky
db4ee506fc Bug 1278108 - Implement <input type="range"> on gtk 3.20. r=karlt 2016-08-19 05:20:00 -04:00
Martin Stransky
44b84273d1 Bug 1266914 - cache newly created style, r=karlt 2016-08-08 03:10:00 +02:00
Martin Stransky
0bbcee935c Bug 1289763 - Move gImageMenuItemWidget/gCheckMenuItemWidget to WidgetCache, r=acomminos 2016-07-28 03:54:00 +02:00
Martin Stransky
d055a30b27 Bug 1289764 - Move gHPanedWidget/gVPanedWidget to WidgetCache, r=acomminos 2016-07-29 05:30:00 +02:00
Martin Stransky
ec30e6e963 Bug 1288413 - Move GtkTreeView widgets to WidgetCache, r=acomminos 2016-07-29 05:15:00 +02:00
Martin Stransky
ce52ea148e Bug 1290048 - Remove gtk_style_context_set_state/gtk_style_context_set_direction after ClaimStyleContext() call. r=acomminos 2016-07-28 04:13:00 -04:00
Andrew Comminos
8093ecd54b Bug 1266914 - Use the border subnode for GtkFrame to fetch border colours. r=karlt
MozReview-Commit-ID: 4muOcOStA7A

--HG--
extra : rebase_source : de3b8e44ac3b67565b1c885b201be1f076c811a3
2016-07-25 10:32:12 -04:00
Martin Stransky
0c9bdc3477 Bug 1288696 - Move MenuSeparatorWidget to WidgetCache, r=acomminos 2016-07-25 05:40:00 +02:00
Martin Stransky
87696b003b Bug 1288412 - Move GtkScrolledWindow to WidgetCache, r=acomminos
Land Bug 1282753 before this one.
2016-07-25 06:46:00 +02:00
Martin Stransky
1130b1827c Bug 1282753 - move button and entry widgets from gtk3drawing to WidgetCache, r=andrew@comminos 2016-07-20 01:57:00 +02:00
Martin Stransky
a344deacb1 Bug 1287085 - Move GtkInfoBar from gtk3drawing to WidgetCache. r=acomminos 2016-07-19 00:03:00 -04:00
Martin Stransky
23f7a86584 Bug 1287080 - Move Toolbar, Frame and Gripper widgets from gtk3drawing to WidgetCache, r=acomminos 2016-07-18 05:29:00 +02:00
Martin Stransky
70d7e929fe Bug 1287082 - Move GtkExpander widget from gtk3drawing.cpp to WidgetCache, r=acomminos 2016-07-18 04:27:00 +02:00
Karl Tomlinson
4cd71ef94b bug 1280951 copy tooltip style context and cache that instead of widget r=stransky+263117
MozReview-Commit-ID: 6thXro9uYHn

--HG--
extra : rebase_source : 9b43f563bb433753e18d0f98d1541fcdae828ba3
2016-06-22 16:46:24 +12:00
Martin Stransky
150a870af2 Bug 1275407 - Adds CSS contents node to have correct scrollbar background on Gtk >= 3.20. r=karlt
Also derive default widget style from widget path. r=?karlt
Patch from Bug 1250704 needs to land prior to this one.

--HG--
extra : rebase_source : b831bb11a7a0a00c4bf51f93e07a41f432c78ec1
2016-06-13 03:35:00 +01:00