Commit Graph

67 Commits

Author SHA1 Message Date
Martin Stransky
faa37756ed Bug 1456898 - Implement and use solid-csd decoration style to get window offset when solid-csd is used by mShell toplevel window, r=jhorak
Implement and use solid-csd decoration style to get window offset when solid-csd is used by mShell toplevel window.
Also does not apply margin (resize handler sizes) on popup window as well as Gtk+ do in get_shadow_width().

MozReview-Commit-ID: 9xozp9CCVJj
2018-04-26 13:55:41 +02:00
Martin Stransky
fcf1c88bd5 Bug 1441665 - [Gtk] Update window offset explicitly when titlebar is disabled in CSD mode, r=jhorak
When system titlebar rendering is disabled and we're in CSD window mode, the window decorations are
rendered by client (application/Gtk) and we don't get _NET_FRAME_EXTENTS property (decoration size) update
for our toplevel window.

So we need to calculate the decoration/shadow size as Gtk+ does, we emulate get_shadow_width()
which is not exported by Gtk+.

MozReview-Commit-ID: K7o2rUPt6Yc
2018-04-24 10:10:16 +02:00
Martin Stransky
d47c4baa9d Bug 1355143 - Implement CreateStyleContextWithStates to style with fully stated css path, r=jhorak
MozReview-Commit-ID: ENWBekzq4Oq
2018-04-18 11:03:39 +02:00
Martin Stransky
f70753a6f8 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
2018-03-06 16:45:19 +01:00
Martin Stransky
da72326115 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
2018-02-23 21:28:37 +01:00
Martin Stransky
167f051845 Bug 1433068 - Titlebar/Linux - load and draw HiDPI titlebar icons on HiDPI screens, r=jhorak
MozReview-Commit-ID: KxbBvf6mgo1
2018-02-20 16:16:23 +01:00
Martin Stransky
c3d1eeedfc 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
2018-01-25 11:13:12 +01:00
Martin Stransky
e709c16fbd Bug 1427999 - Use GetToolbarButtonMetrics() to get correct titlebar button size at nsNativeThemeGTK::GetMinimumWidgetSize, r=jhorak
MozReview-Commit-ID: HfPUk30LaJn
2018-01-22 12:09:09 +01:00
Sylvestre Ledru
1dc3061203 Bug 1278282 - Ride along Remove some trailing whitespaces r=lsalzman
MozReview-Commit-ID: 8W6VKIW8PQV
2017-12-19 11:38:59 +01:00
Martin Stransky
b9eb258941 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
2017-09-19 20:34:31 +02:00
Martin Stransky
5824466429 Bug 1364843 - Implement GtkHeaderBar widgets at WidgetCache, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: HzzXDqE0s5n
2017-09-19 18:20:48 +02: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
Martin Stransky
05236e9304 Bug 1389133 - don't invalidate style content for missing widgets, r=karlt
MozReview-Commit-ID: 2KfjYGvsiVv
2017-08-10 18:07:41 +02:00
Karl Tomlinson
3871fc02aa 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
2017-08-01 09:17:46 +12:00
Karl Tomlinson
814bcafddf 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
2016-12-02 12:39:23 +13:00
Karl Tomlinson
d8e3de2d68 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
2016-12-14 19:22:28 +13:00
Karl Tomlinson
d9a76a0fbd bug 1320860 adjust textarea style contexts for GTK 3.20 theming ABI changes r=stransky+263117+263117
MozReview-Commit-ID: JTQO5bK5Yvv
2016-12-30 13:44:55 +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
Karl Tomlinson
65b8ca084e bug 1320860 Back out changeset a6aabcb07a6e for causing bug 1322120 or bug 1324262 2016-12-29 18:05:42 +13:00
Karl Tomlinson
963c750761 bug 1323860 implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache r=stransky
MozReview-Commit-ID: 1VOZKRw3gj4
2016-11-25 17:51:13 +13:00
Sebastian Hengst
ad85257172 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
b7113b347f Backed out changeset 70d7c1534715 (bug 1319650) 2016-12-01 22:38:36 +01:00
Karl Tomlinson
21c1158c78 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
2016-11-23 16:41:57 +13:00
Karl Tomlinson
e3fb1b16a8 bug 1319650 implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache r=stransky+263117
MozReview-Commit-ID: 1VOZKRw3gj4
2016-11-25 17:51:13 +13:00
Karl Tomlinson
e88b7b9354 bug 1320860 adjust textarea style contexts for GTK 3.20 theming ABI changes r=stransky+263117
MozReview-Commit-ID: 9aW61kMkKcb
2016-11-29 17:58:00 +13:00
Phil Ringnalda
8e037f5d9e Backed out changeset eb4be9ed211e (bug 1319650) for reftest and chrome bustage
CLOSED TREE
2016-11-24 19:30:48 -08:00
Karl Tomlinson
bc19bf8a4a 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
2016-11-23 16:41:57 +13:00
Karl Tomlinson
4f292064c0 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
2016-06-21 19:07:45 +12:00
Martin Stransky
52e97a953d Bug 1319066 - Move complete GtkTooltip stack to WidgetCache. r=karlt 2016-11-23 21:14:58 -05:00
Karl Tomlinson
9f7da10abd bug 1319355 remove unused MOZ_GTK_IMAGEMENUITEM r=stransky+263117
Unused since e7680c5fead3.

MozReview-Commit-ID: DYgeoJDxna9
2016-11-22 09:17:34 +13:00
Karl Tomlinson
f6af52b923 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
2016-11-16 16:55:13 +13:00
Karl Tomlinson
25a4e92e9d 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
2016-11-18 13:01:27 +13:00
Karl Tomlinson
34f7188765 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
2016-11-15 17:11:14 +13:00
Karl Tomlinson
40e82b62d0 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
2016-11-15 15:29:06 +13:00
Martin Stransky
df94139f63 Bug 1282753 - implement combo boxes by WidgetCache, r=?karlt
MozReview-Commit-ID: FrMbxT2D5p0
2016-10-19 15:13:25 +13:00
Jan Horak
f71df8475d 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
2016-10-17 11:37:13 +13:00
Karl Tomlinson
a3e5a650c7 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
2016-09-08 10:12:55 +12:00
Martin Stransky
fa1ccd5b2b Bug 1271524 - Move tab widget to WidgetCache. r=acomminos 2016-08-21 23:13:00 -04:00
Martin Stransky
15688726bc Bug 1278108 - Implement <input type="range"> on gtk 3.20. r=karlt 2016-08-19 05:20:00 -04:00
Martin Stransky
4f6fd28ddd Bug 1266914 - cache newly created style, r=karlt 2016-08-08 03:10:00 +02:00
Martin Stransky
41cb9a2b59 Bug 1289763 - Move gImageMenuItemWidget/gCheckMenuItemWidget to WidgetCache, r=acomminos 2016-07-28 03:54:00 +02:00
Martin Stransky
35eae4bc84 Bug 1289764 - Move gHPanedWidget/gVPanedWidget to WidgetCache, r=acomminos 2016-07-29 05:30:00 +02:00
Martin Stransky
5d4cb9f38e Bug 1288413 - Move GtkTreeView widgets to WidgetCache, r=acomminos 2016-07-29 05:15:00 +02:00
Martin Stransky
5bbaa243a0 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
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
Martin Stransky
d10708ff29 Bug 1288696 - Move MenuSeparatorWidget to WidgetCache, r=acomminos 2016-07-25 05:40:00 +02:00
Martin Stransky
6b8c589191 Bug 1288412 - Move GtkScrolledWindow to WidgetCache, r=acomminos
Land Bug 1282753 before this one.
2016-07-25 06:46:00 +02:00
Martin Stransky
98afb70192 Bug 1282753 - move button and entry widgets from gtk3drawing to WidgetCache, r=andrew@comminos 2016-07-20 01:57:00 +02:00
Martin Stransky
b5347794dc Bug 1287085 - Move GtkInfoBar from gtk3drawing to WidgetCache. r=acomminos 2016-07-19 00:03:00 -04:00
Martin Stransky
80b969dc5e Bug 1287080 - Move Toolbar, Frame and Gripper widgets from gtk3drawing to WidgetCache, r=acomminos 2016-07-18 05:29:00 +02:00