Commit Graph

121 Commits

Author SHA1 Message Date
Samuel Thibault
12e178e15f Bug 1376756 - gtk: while drawing nsTreeBodyFrame, fetch current row attributes for proper style rendering. r=karlt 2018-06-27 05:11:00 +03:00
Martin Stransky
bfa15b9377 Bug 1461203 - use GetScrollbarMetrics() to access scrollbar metrics, r=jhorak
MozReview-Commit-ID: 3gnFNfxQJZi
2018-05-17 14:40:21 +02:00
Martin Stransky
32d32922b5 Bug 1457194 - [Gtk+\CSD] Don't estimate window offset for Gtk+ < 3.20, r=jhorak
MozReview-Commit-ID: JtxujODEHBO
2018-04-27 12:30:13 +02:00
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
dcb8186bcf Bug 1454897 - Ubuntu/Ambiance - Render scrollbar thumb with different sizes in active/normal state, r=jhorak
This patch implements a workaround which alows us to emulate
overlay scrollbars for some Gtk+ themes (Ubuntu/Ambiance),
when an inactive scrollbar thumb is smaller than the active one.

We calculate thumb margin as thumb class margin + difference margin
between active and inactive scrollbars.

Also remove boolean parameter from GetScrollbarMetrics() and implement
GetActiveScrollbarMetrics() to get metrics for active scrollbar.

MozReview-Commit-ID: 2zje5OZskYw
2018-04-24 12:27:38 +02:00
Martin Stransky
e1ad5b8a78 Bug 1453930 - Use gtk_style_context_get_state() instead of GTK_STATE_FLAG_NORMAL to get widget border/margin/padding, r=jhorak
MozReview-Commit-ID: 6FaUpaaBt2Q
2018-04-13 13:41:27 +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
11b6110c2b Bug 1355143 - Provide ScrollbarGTKMetrics for active (mouse over) scrollbars, r=jhorak
MozReview-Commit-ID: 95d1jeQ8mXd
2018-04-18 11:05:46 +02:00
Martin Stransky
1090de1903 Bug 1439834 - Draw titlebar with some extent, r=dao
Some themes (Adwaita for instance) draws bold dark line at
titlebar bottom. It does not fit well with Firefox tabbar UI so
draw themed titlebar with some extent to make the titlebar
bottom part invisible (it's clipped by cairo).

MozReview-Commit-ID: 3rs4UzFJdPa
2018-02-28 14:28:40 +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
919aa6fedd Bug 1433092 - Add spacing around titlebar buttons, r=jhorak
GtkHeaderBar has property "spacing" which defines space between buttons at titlebar.
Get this property and apply as margin to titlebar buttons when there's more than one.
Also cache this value for furter use at titlebar metrics cache.

MozReview-Commit-ID: J7qAIWEnK4Y
2018-02-23 10:37:07 +01:00
Gurzau Raul
ab858f3518 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-02-21 19:32:45 +02:00
Martin Stránský
59ea2b7a04 Bug 1434621 - part 2: ignore vertical titlebar padding from the Gtk+ theme since we set it with CSS on #titlebar-buttonbox. r=dao
MozReview-Commit-ID: ETrNNianj3e
2018-02-21 16:43:11 +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
c9b27b1486 Bug 1433068 - Reload WidgetstyleCache when theme changes, r=jhorak
MozReview-Commit-ID: 1cZmJNWjS4N
2018-02-20 13:15:52 +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
7fff6139ee Bug 1427999 - Implement GetToolbarButtonMetrics() to get titlebar button size and border, r=jhorak
Titlebar button on Gtk+ >= 3.20 can have defined its size as min-width and min-height
and can leave CSS styles border/padding empty. To render the button icon at center we need to
calculate button widget border from gap between icon and button.

This is done by GetToolbarButtonMetrics() which also stores final values to
ToolbarButtonGTKMetrics cache.

MozReview-Commit-ID: 5sMJATWHUNX
2018-01-22 12:14:13 +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
lochang
2ccf5537f1 Bug 1417751 - Implement a new value inner-spin-button to -moz-appearance on all platforms except Android. r=mats
MozReview-Commit-ID: 7jpLCOWZA2x
2017-11-29 10:43:13 +08:00
Cosmin Sabou
22abad7206 Backed out changeset 423f4e43a975 (bug 1417751) for xpcshell failures at devtools/shared/tests/unit/test_css-properties-db.js r=backout on a CLOSED TREE 2017-11-28 13:50:59 +02:00
lochang
5f16b8da64 Bug 1417751 - Implement a new value inner-spin-button to -moz-appearance on all platforms except Android. r=mats
MozReview-Commit-ID: 3I1LBLbCfmF
2017-11-28 10:39:50 +08:00
lochang
815c306219 Bug 1406268 - Use rect width/height instead of minimum width/height and clamp the rect on Linux. r=mats
MozReview-Commit-ID: B7KjnO9uaef
2017-11-17 14:20:42 +08:00
Martin Stransky
d69dd68df0 Bug 1412010 - Add missing includes to gtk(3)drawing files, r=jhorak
MozReview-Commit-ID: B1RiTldOenE
2017-10-26 20:14:53 +02:00
Martin Stransky
cfe2a08665 Bug 1410885 - Implement border/padding helpers, r=jhorak
MozReview-Commit-ID: 24WU58W43n6
2017-10-23 15:16:02 +02:00
Martin Stransky
0c17fcc9b7 Bug 1364843 - Implement drawing and size query of MOZ_GTK_HEADER_BAR*, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: 2d8BgLyOS5u
2017-09-19 21:15:12 +02:00
Jan Horak
ddb7299236 Bug 1381815 - fixing dimensions of radio and checkbox for GTK 3.20+; r=karlt
In the GTK < 3.20 the size of radio and checkbox toggle is determined by indicator
spacing and indicator size. By  GTK 3.20+ it is replaced by standard box model
(padding, margin, border). The patch fixes that while keeping the functionality
for older GTK. The values are also cached by similar way as scrollbar metrics
are cached now.

The focus is no longer rendered by GTK but by Mozilla code, so the extra
size for toggles has been removed from GetExtraSizeForWidget and toggles
no longer render focus indicator.

MozReview-Commit-ID: 1Wg5AgHy1Vz
2017-10-10 13:35:56 +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
L. David Baron
8c8460e30f Bug 1367576 - Cache results of getting GTK widget borders. r=karlt
See comments in the header file.

This also clears out mSafeWidgetStates in ThemeChanged since that seems
like a good thing to do, and marks nsNativeThemeGTK as final.

MozReview-Commit-ID: 5Zne4eGbGlh
2017-06-06 22:27:18 -07:00
L. David Baron
4a544d6894 Bug 1367576 - Remove unused ishtml parameter to moz_gtk_get_widget_border. r=karlt
This was needed for the (now-unused) GTK2 version of the code.

MozReview-Commit-ID: GocgC4OZ76p
2017-06-06 22:27:17 -07:00
Karl Tomlinson
722d25bd4d bug 1319650 draw tab gap with tabpanel style context r=stransky+263117
This is more consistent with moz_gtk_tabpanels_paint() and avoids
modifying the tab style context.

MozReview-Commit-ID: HpKSVrpvO9b
2016-11-29 18:50:20 +13:00
Karl Tomlinson
e631e37505 bug 1343802 draw trough centered instead of filling the scrollbar r=jhorak+328198
to follow the behavior of version 3.20 GtkRange's contents_gadget.

MozReview-Commit-ID: BQE6mQqsan8
2017-03-27 20:32:55 +02:00
Karl Tomlinson
f2fe71826e bug 1343802 consider scrollbar trough min-width/min-height properties r=jhorak+328198
in determining breadth of trough and scrollbar.

MozReview-Commit-ID: 3orNXdv6uZh
2017-03-27 20:32:51 +02:00
Karl Tomlinson
3d163df659 bug 1343802 swap vertical scrollbar button dimensions for horizontal scrollbars r=jhorak+328198
MozReview-Commit-ID: 4fK0hFRWn1p
2017-03-27 20:32:47 +02:00
Karl Tomlinson
dc021d2a1d bug 1343802 adjust scrollbar track border to prevent thumb expanding to fill available breadth r=jhorak+328198+328198
MozReview-Commit-ID: 7KJGnds0ngL
2017-03-27 20:32:42 +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
17cc6e0beb bug 1343802 remove have_arrow_scaling, which was always true r=jhorak+328198
MozReview-Commit-ID: AeM2oKoPCTs
2017-03-27 20:32:33 +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
Karl Tomlinson
691886dbbc bug 1343802 calculate scrollbar metrics in one place r=jhorak+328198
Changes in behavior are intended to be minimal, but this adds distinct
metrics for horizontal and vertical scrollbars even with GTK versions < 3.20.

Updates on theme changes will be restored in a subsequent patch.

MozReview-Commit-ID: 4vi2nKxCxW7
2017-03-27 20:32:25 +02:00
Karl Tomlinson
a694a2451f bug 1343802 remove code for native scrollbar thumb border sizes r=jhorak+328198
There is no need to calculate thumb borders because thumb border-box sizes are
determined with GetMinimumWidgetSize, which includes GTK margin, border, and
padding, and the interior border width is irrelevant because thumbs have no
children.

MozReview-Commit-ID: K2N2RBJBRsB
2017-03-27 20:32:20 +02:00
Karl Tomlinson
a40e0b09b1 bug 1343802 remove unused moz_gtk_enable_style_props r=jhorak+328198
MozReview-Commit-ID: KbAIRCyqmJ8
2017-03-27 20:32:16 +02:00
Sebastian Hengst
2330f02481 Backed out changeset bc81d40f3290 (bug 1343802) for likely causing bug 1350875 and reviving bug 1332040. r=backout 2017-03-27 18:01:58 +02:00
Sebastian Hengst
e202dd9345 Backed out changeset 5dc7564d651b (bug 1343802) 2017-03-27 18:00:23 +02:00
Sebastian Hengst
536c7dd264 Backed out changeset 8c45140a2819 (bug 1343802) 2017-03-27 18:00:18 +02:00
Sebastian Hengst
61c3d88381 Backed out changeset af279778b154 (bug 1343802) 2017-03-27 18:00:14 +02:00
Sebastian Hengst
3aeefaddfa Backed out changeset 88ea23ae0627 (bug 1343802) 2017-03-27 18:00:10 +02:00
Sebastian Hengst
4a885f60d2 Backed out changeset 45330fa58671 (bug 1343802) 2017-03-27 18:00:05 +02:00
Sebastian Hengst
8a2acab448 Backed out changeset 9abd87cd2dff (bug 1343802) 2017-03-27 18:00:01 +02:00
Sebastian Hengst
fc1d07730c Backed out changeset 7abbf6d092eb (bug 1343802) 2017-03-27 17:59:56 +02:00
Sebastian Hengst
f49955b23a Backed out changeset 22f4dc6bb4db (bug 1343802) 2017-03-27 17:59:52 +02:00
Sebastian Hengst
57b626ffe7 Backed out changeset db84a68eaaec (bug 1343802) 2017-03-27 17:59:48 +02:00