Commit Graph

92 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
57880152d6 Bug 1643474 - Cleanup and validate input in button layout placement code. r=stransky,smurfd
It is not clear whether this is the cause of the crash, but it seems
plausible as it is both recent code and it clearly doesn't validate the
length of the stack-allocated buffer, so a bad gconf could plausibly
cause this.

Clean stuff up a bit and validate the buffer length.

Differential Revision: https://phabricator.services.mozilla.com/D78405
2020-06-05 10:02:58 +00:00
Emilio Cobos Álvarez
8d8d416c63 Bug 1638107 - Scale gtk entry min height by the font-size for smaller-than-default font-sizes. r=karlt
This makes inputs not remain very big at small font sizes, which is
needed for compat both with other browsers and platforms, while keeping
the right native appearance at normal / large font sizes.

Differential Revision: https://phabricator.services.mozilla.com/D76256
2020-05-26 01:34:25 +00:00
Nicklas Boman
c6d034eba4 Bug 1432090 - [CSD] Button layout not according to settings - Widget background work r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73453
2020-05-24 09:22:58 +00:00
Emilio Cobos Álvarez
8fb3d13c4e Bug 1624436 - Don't include GTK widget padding in outline: auto size. r=karlt,stransky
To paint outline: auto, we paint the focused border of a GTK_ENTRY_PAINT.

We're also adding the padding of the entry, and that's wrong and causes
undesirable padding that looks bogus.

Differential Revision: https://phabricator.services.mozilla.com/D68191

--HG--
extra : moz-landing-system : lando
2020-03-26 10:23:39 +00:00
Martin Stransky
9d06e4311a Bug 1603419 [Linux] Cache GetCSDDecorationSize() results, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D56915

--HG--
extra : moz-landing-system : lando
2019-12-13 07:44:48 +00:00
Jan Horak
1e8f702108 Bug 1553825 - Fix blurry radio and checkbox indicators in menus; r=stransky
This fix wrong rendering of radio and checkbox indicators in menus by
correcting the dimensions acording to used theme.

Differential Revision: https://phabricator.services.mozilla.com/D32316

--HG--
extra : moz-landing-system : lando
2019-05-28 06:54:44 +00:00
Martin Stransky
8ddc948f81 Bug 1433667 - Honour system titlebar button left/right placement, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D16466

--HG--
extra : moz-landing-system : lando
2019-01-18 13:52:29 +00:00
Martin Stransky
8449b576c3 Bug 1507423 - Implement StyleAppearance::MozWindowButtonBox on widget/gtk, r=mconley
Depends on D14242

Differential Revision: https://phabricator.services.mozilla.com/D14243

--HG--
extra : moz-landing-system : lando
2018-12-18 19:06:08 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Mike Conley
606458ffcd Bug 1506248 - Backout bug 1498356 (d2b32aa2055f) since bug 1503272 makes it unnecessary now. r=stransky
Depends on D11523

Differential Revision: https://phabricator.services.mozilla.com/D11524

--HG--
extra : moz-landing-system : lando
2018-11-12 12:15:28 +00:00
Jonathan Watt
b5bfd3a7ea Bug 1505316 p2. Rename aWidgetType to aAppearance in widget code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D11156

--HG--
extra : rebase_source : c908a6d6419c6462453cb8b745effc583d767902
extra : source : 07e12bc71a8d96b52b1a1bbc8dc7545ae4454a4f
2018-10-24 16:24:57 +01:00
Martin Stransky
53bbcc32fb Bug 1498356 - Move border and padding from -moz-window-titlebar* to -moz-window-button-box on GTK backend, r=dao
This is based on patch by Mike Conley (:mconley)

The left/right toolbox placement can be adjusted later as we know at toolkit level where the buttons are
so we can set border/padding accordingly.

Depends on D8529

Differential Revision: https://phabricator.services.mozilla.com/D8549

--HG--
extra : moz-landing-system : lando
2018-10-12 16:16:50 +00:00
Martin Stransky
f46e2e428f Bug 1442755 - Redraw titlebar widgets when application focus changes and draw inactive titlebar with GTK_STATE_FLAG_BACKDROP state, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D5582

--HG--
extra : moz-landing-system : lando
2018-09-12 11:03:56 +00:00
Cosmin Sabou
3a76399ecb Backed out changeset 19e2c611e889 (bug 1442755) for wpt reftest failures. CLOSED TREE 2018-09-11 15:11:02 +03:00
Martin Stransky
3d7f73594c Bug 1442755 - Redraw titlebar widgets when application focus changes and draw inactive titlebar with GTK_STATE_FLAG_BACKDROP state, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D5409

--HG--
extra : moz-landing-system : lando
2018-09-11 11:01:26 +00:00
Martin Stransky
30b73cfa58 Bug 1408360 - Create GtkHeaderBar widget at once, r=jhorak
To get correct style of GtkHeaderBar widget we need to get style of fully
occupied widget with child buttons.

When GtkHeaderBar Gtk+ style is requested create also all child elements
and then return the style.

Differential Revision: https://phabricator.services.mozilla.com/D4663

--HG--
extra : moz-landing-system : lando
2018-09-06 11:52:19 +00:00
Samuel Thibault
01084d60d8 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
81b1272512 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

--HG--
extra : rebase_source : 687993d60b8f2063ed31f07ba2d7ab9f1faa09c8
2018-04-26 13:55:41 +02:00
Martin Stransky
659fc0cc75 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

--HG--
extra : rebase_source : dd50dc52d9d0942c9dcfbf72d217f3c6ee82c21a
2018-04-24 12:27:38 +02:00
Martin Stransky
efb19d9d96 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

--HG--
extra : rebase_source : 86a3f12e760194b5828afed784f6aa02c352e017
2018-04-24 10:10:16 +02:00
Martin Stransky
04bb88d159 Bug 1355143 - Provide ScrollbarGTKMetrics for active (mouse over) scrollbars, r=jhorak
MozReview-Commit-ID: 95d1jeQ8mXd

--HG--
extra : rebase_source : 44fd8d0df747b0ad6f8f4c6cbee442f5710d4006
2018-04-18 11:05:46 +02: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
6e94e535b0 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

--HG--
extra : rebase_source : 73f0f605444cf4e4ada3da335ff003e9df05c9c4
2018-02-23 10:37:07 +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
e77fe4bfe2 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

--HG--
extra : rebase_source : b0bda7c78106088a819b98c197cbb0cd099e47df
2018-01-22 12:14:13 +01:00
Sylvestre Ledru
424664ff30 Bug 1278282 - Remove the 'MOZ_WIDGET_GTK == 2' defines r=karlt,lsalzman
MozReview-Commit-ID: 3v8D600g8St

--HG--
extra : rebase_source : 34ea6f9868c1b322076c24daa75dc33e27b6704e
2018-01-10 08:52:04 +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
lochang
e889dbe685 Bug 1417751 - Implement a new value inner-spin-button to -moz-appearance on all platforms except Android. r=mats
MozReview-Commit-ID: 7jpLCOWZA2x

--HG--
extra : rebase_source : d2a4d160d26e6f6996ed1cb3a673576236b8ef23
2017-11-29 10:43:13 +08:00
Cosmin Sabou
7d7b59dd0b 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
416f319bb8 Bug 1417751 - Implement a new value inner-spin-button to -moz-appearance on all platforms except Android. r=mats
MozReview-Commit-ID: 3I1LBLbCfmF

--HG--
extra : rebase_source : f9a356d592eac90d91a59de0c7ab0ded6ab80ab2
2017-11-28 10:39:50 +08:00
Martin Stransky
b64b69ebdb Bug 1412010 - Add missing includes to gtk(3)drawing files, r=jhorak
MozReview-Commit-ID: B1RiTldOenE

--HG--
extra : rebase_source : 195bd1ea9f5c5ee9b744bfadcbe2589d801abb18
2017-10-26 20:14:53 +02:00
Martin Stransky
3af9407ecc Bug 1364843 - Added WidgetNodeType entries for GtkHeaderBar implementation, r=jhorak,jimm,karlt
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: GA3CDhCeqfD

--HG--
extra : rebase_source : 0bdccafcfbd84475442503abb6b2e11b6670c37d
2017-09-19 18:24:13 +02:00
Jan Horak
165fab2f85 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

--HG--
extra : rebase_source : 81437f45b7d32555942d21fccc9de4a561d85111
2017-10-10 13:35:56 +02:00
L. David Baron
d1ddf5e48e 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
06ad92ffc6 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
a1f02152df 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
e9f17ddd35 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
35bae617b5 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
577cadd9fb 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
4a203a1408 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
2af68f54bd 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
334b8a2719 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
579ea8c74c Backed out changeset 8c45140a2819 (bug 1343802) 2017-03-27 18:00:18 +02:00
Sebastian Hengst
9baf1aac8b Backed out changeset af279778b154 (bug 1343802) 2017-03-27 18:00:14 +02:00
Sebastian Hengst
0dd66abf1e Backed out changeset 45330fa58671 (bug 1343802) 2017-03-27 18:00:05 +02:00
Sebastian Hengst
d2abc82e65 Backed out changeset 7abbf6d092eb (bug 1343802) 2017-03-27 17:59:56 +02:00
Sebastian Hengst
18de691a0f Backed out changeset db84a68eaaec (bug 1343802) 2017-03-27 17:59:48 +02:00
Karl Tomlinson
4cf270684e 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

--HG--
extra : rebase_source : ee0f35da45f3da2248f50ee925fb7f8e9b848636
2017-03-23 18:17:49 +13:00
Karl Tomlinson
cb62e93514 bug 1343802 swap vertical scrollbar button dimensions for horizontal scrollbars r=jhorak+328198
MozReview-Commit-ID: 4fK0hFRWn1p

--HG--
extra : rebase_source : 5342134f69a210f2afdcd835dbb4bbbde429b506
2017-03-21 20:50:36 +13:00