Commit Graph

161 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
Mike Hommey
579ab8fd6f Bug 1635990 - Fix leak when gtk-decoration-layout setting is set. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D74167
2020-05-07 04:30:33 +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
e9b20e15ac Bug 1605253 [Linux/Gtk] Set widget preferred size to some minimal value when it's returned as zero, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D61834

--HG--
extra : moz-landing-system : lando
2020-02-08 18:11:59 +00:00
Martin Stransky
da8ea3387b Bug 1600414 [Wayland] Get CSD decoration styles from MOZ_GTK_HEADERBAR_WINDOW, r=jhorak
- Use MOZ_GTK_HEADERBAR_WINDOW to get decoration style at moz_gtk_header_bar_paint()
- Don't return decoration size for solid-csd as it behaves as a regular window frame.

Depends on D59850

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

--HG--
extra : moz-landing-system : lando
2020-01-14 14:21:15 +00:00
Vlad Zahorodnii
30aa62894e Bug 1497066 - [Linux/HiDPI] Draw header bar buttons at correct scale on HiDPI, r=stransky
Set the style scale in order to be in line with GetStyleContext().

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

--HG--
extra : moz-landing-system : lando
2020-01-05 10:30:36 +00:00
Martin Stransky
b579b97bc6 Bug 1606601 - [Linux/HiDPI] Set scale factor to GtkStyleContext when WidgetStyleCache is not used, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D58507

--HG--
extra : moz-landing-system : lando
2020-01-03 07:42:49 +00:00
Emilio Cobos Álvarez
0c1f14102b Bug 1031662 - Use more const in gtk3drawing. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D58132

--HG--
extra : moz-landing-system : lando
2019-12-24 02:02:09 +00:00
Emilio Cobos Álvarez
bc8b0b4aae Bug 1031662 - correct outset positioning of GTK auto-style outline. r=karlt
The x and y tweaks weren't getting used, because they were not being copied to
the local `x` and `y` variables too. With that fixed, this seems to work
nicely.

I want to enable outline-style: auto both for parity with other browsers but
also because it unblocks stuff like bug 1583381 / bug 1311444.

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

--HG--
extra : moz-landing-system : lando
2019-12-24 02:03:32 +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
Sylvestre Ledru
96da5036ad Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-28 09:30:05 +00:00
Martin Stransky
a8d915f450 Bug 1319838 - [Linux/HiDPI] Set scale factor on styles created at WidgetStyleCache, r=jhorak
Call gtk_style_context_set_scale() on styles created by WidgetStyleCache module on Gtk 3.20+
Also modify moz_gtk_widget_paint_* routines to pass the scale info to CreateStyleContext()
from WidgetStyleCache.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 13:18:49 +00:00
Sylvestre Ledru
14486004b6 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-02-04 19:10:18 +00:00
Martin Stransky
4138f8ce3b Bug 1521310 - [Linux/Gtk] Use ':' separator to place titlebar buttons left/right, r=dao
Use only ':' separator instead of 'menu:' to place titlebar buttons as the menu may not be always present.

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

--HG--
extra : moz-landing-system : lando
2019-01-24 10:54:28 +00:00
Martin Stransky
4452be5cba Bug 1519606 - [Linux/Gtk] Compute correct margin for left titlebar buttons placement, r=dao
Depends on D17347

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

--HG--
extra : moz-landing-system : lando
2019-01-24 09:22:30 +00:00
Martin Stransky
c9db5cb4d3 Bug 1519606 - [Linux/Gtk] Don't add margin to icon position at titlebar buttons as it's already applied at drawing, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D17347

--HG--
extra : moz-landing-system : lando
2019-01-23 16:17:26 +00:00
Cosmin Sabou
7ccc9d8b0b Merge mozilla-inbound to mozilla-central. a=merge 2019-01-19 11:57:49 +02: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
a9e92a6023 Bug 1497002 - [Linux/CSD] Position headerbar button icons according to the actual button, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D16193

--HG--
extra : moz-landing-system : lando
2019-01-11 11:24:06 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01: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
Martin Stransky
2e33d16018 Bug 1507423 - Don't return border/padding from MOZ_GTK_HEADER_BAR/MOZ_GTK_HEADER_BAR_MAXIMIZED, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D14242

--HG--
extra : moz-landing-system : lando
2018-12-18 10:47:48 +00:00
Tooru Fujisawa
7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09: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
b299e6e7ad Bug 1506248 - Backout bug 1498356 (3df978f11b6d) since bug 1503272 makes it unnecessary now. r=stransky
Depends on D11524

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

--HG--
extra : moz-landing-system : lando
2018-11-12 12:16:50 +00: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
Jonathan Watt
3922f1cb96 Bug 1500423. Make '-webkit-appearance: menulist-textfield' behave like Chrome. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D9339

--HG--
extra : rebase_source : afa3c037857838be2e18d4b47eaf64d318747de7
2018-10-19 18:12:15 +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
6a1af65492 Bug 1498356 - Remove padding/border from -moz-window-titlebar*, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D8529

--HG--
extra : moz-landing-system : lando
2018-10-12 16:16:57 +00:00
Martin Stransky
3595f59e15 Bug 1489963 - Draw scrollbars with Gtk widget state and use backdrop state for inactive scrollbars, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D6763

--HG--
extra : moz-landing-system : lando
2018-09-25 11:57:53 +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
7aca24afe9 Bug 1489499 - Don't call gtk_header_bar_get_decoration_layout() to get titlebar layout, r=jhorak
We don't set gtk_header_bar_set_decoration_layout() so we don't need to query the layout
by gtk_header_bar_get_decoration_layout(). That means we don't need to create the GtkHeaderBar
at startup when titlebar rendering is disabled.

Also unify window/header bar construction at CreateHeaderBarWidget() and assert when the widgets
are already created.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 08:56:13 +00:00
Martin Stransky
a8d81f3a0b Bug 1408360 - Draw window decoration as a part of the GtkHeaderBar widget, r=jhorak
GtkWindow decoration is a part of GtkHeaderBar widget so we need to include
that in our GtkHeaderBar paint.

Depends on D4663

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

--HG--
extra : moz-landing-system : lando
2018-09-06 11:52:33 +00:00
Emilio Cobos Álvarez
517256e365 Bug 1478391: Autogenerate StyleAppearance. r=jwatt
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.

Really sorry for the size of the patch.

There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.

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

MozReview-Commit-ID: DiSmMWK7Krp
2018-07-26 17:06:17 +02: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
e12dbaec51 Bug 1461203 - use GetScrollbarMetrics() to access scrollbar metrics, r=jhorak
MozReview-Commit-ID: 3gnFNfxQJZi

--HG--
extra : rebase_source : 86174c8a28eb4737885fe4e4c5dc00e08811b0da
2018-05-17 14:40:21 +02:00
Martin Stransky
8a535137df Bug 1457194 - [Gtk+\CSD] Don't estimate window offset for Gtk+ < 3.20, r=jhorak
MozReview-Commit-ID: JtxujODEHBO

--HG--
extra : rebase_source : ff6a571ae1a882556cdc8074c35847c8e71ecdb6
2018-04-27 12:30:13 +02: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
fb7161e5e2 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

--HG--
extra : rebase_source : d18abdcd89edc01dcae0218a03ad7afd1860e68b
2018-04-13 13:41:27 +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
41ee718162 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

--HG--
extra : rebase_source : ca9270f549a3106711afac8ee0c7a30839ab2bf3
2018-02-28 14:28:40 +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