Commit Graph

121 Commits

Author SHA1 Message Date
Karl Tomlinson
f1922f112b 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-23 18:17:49 +13:00
Karl Tomlinson
24a36881af 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-22 15:53:49 +13:00
Karl Tomlinson
d1d72ec136 bug 1343802 swap vertical scrollbar button dimensions for horizontal scrollbars r=jhorak+328198
MozReview-Commit-ID: 4fK0hFRWn1p
2017-03-21 20:50:36 +13:00
Karl Tomlinson
874a854e17 bug 1343802 adjust scrollbar track border to prevent thumb expanding to fill available breadth r=jhorak+328198+328198
MozReview-Commit-ID: 7KJGnds0ngL
2017-03-23 18:31:16 +13:00
Karl Tomlinson
85e3a14782 bug 1343802 update notebook_has_tab_gap and scrollbar metrics after theme changes r=jhorak+328198
MozReview-Commit-ID: IRPXNwLe5Ey
2017-03-21 17:27:41 +13:00
Karl Tomlinson
45c5847b42 bug 1343802 remove have_arrow_scaling, which was always true r=jhorak+328198
MozReview-Commit-ID: AeM2oKoPCTs
2017-03-21 17:12:34 +13:00
Karl Tomlinson
8d971e1f22 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-21 17:14:55 +13:00
Karl Tomlinson
6f148620a6 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-23 18:23:26 +13:00
Karl Tomlinson
b65d4b6c9f 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-08 18:24:19 +13:00
Karl Tomlinson
052bfaf806 bug 1343802 remove unused moz_gtk_enable_style_props r=jhorak+328198
MozReview-Commit-ID: KbAIRCyqmJ8
2017-03-06 17:19:26 +13:00
Karl Tomlinson
1853623311 bug 1346961 draw opaque scrollbar background on outermost scrollbar element even for GTK versions >= 3.20 r=jhorak+328198
MozReview-Commit-ID: BHsD1h4UQbs
2017-03-16 18:02:27 +13:00
Martin Stransky
13ac7911aa Bug 1335705 - For Gtk > 3.20 determine scale trough size from trough CSS node and also add border/padding/margin, r=karlt
MozReview-Commit-ID: BhS9xkagvMp
2017-02-22 11:56:28 +01:00
Martin Stransky
0e47a9fd3c Bug 1335705 - Consider also margin when determine range widget slider size, r=karlt
MozReview-Commit-ID: 49UgRJFjvns
2017-02-23 10:52:55 +01:00
Karl Tomlinson
3f53d3d265 bug 1328899 don't use GTK prelight and active state flags when drawing textfield-multiline background r=stransky+263117
This is consistent with GTK not setting these flags with GtkTextView
and GtkScrolledWindow.

The active flag was triggering @selected_bg_color with Ambiance.

This patch almost reverts the state flags to the logic prior to
cd7544affe40 but keeps the focused flag in the scrolled window.

MozReview-Commit-ID: IVY1sI2Hllw
2017-01-17 14:48:55 +13:00
Karl Tomlinson
d3050c613c bug 1324886 with GTK versions < 3.8 draw menuitem background and frame only when in hover and not a separator r=stransky+263117
MozReview-Commit-ID: JdZbuXRbP9X
2017-01-04 09:57:48 +13:00
Karl Tomlinson
7010d46d4a bug 1320860 consider textview root node background in addition to text node for -moz-appearance:textfield-multiline r=stransky+263117
This is necessary for GTK versions > 3.18 because windows no
longer clear their backgrounds since
https://git.gnome.org/browse/gtk+/commit/?id=580ea227a6bb19ad6c6d4766b3a36dbad24583f3
and Ambiance for 3.20 has a transparent background for the "text" window.
See bug 1324262.

MozReview-Commit-ID: 7HCCwfOv0LP
2016-12-30 12:54:28 +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
Thomas Wisniewski
154e6ec149 Bug 140562 - Part 2: Remove the 2px extra padding on buttons for a prospective -moz-focus-inner ring, and just size that ring the same as the content frame (inflated by its CSS padding). r=dbaron 2016-12-02 01:11:48 -05: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
Martin Stransky
52e97a953d Bug 1319066 - Move complete GtkTooltip stack to WidgetCache. r=karlt 2016-11-23 21:14:58 -05:00
Karl Tomlinson
a5da289861 bug 1317574 adjust menuitem padding and check/radio indicator position for changes in GTK 3.20 r=stransky+263117
MozReview-Commit-ID: DXTbezxpcqM
2016-11-21 17:27:11 +13:00
Karl Tomlinson
62185c64ed bug 1317574 rename subtract_margin and rectangle_inset to Inset* and swap InsetByMargin parameters for consistency r=stransky+263117
MozReview-Commit-ID: 8vgsoj4TGz0
2016-11-21 17:16:37 +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
b7e4aa01fe bug 1317574 use menuitem padding between menuitem and check indicator r=stransky+263117
MozReview-Commit-ID: JZSIVf8xppi
2016-11-15 15:57:46 +13:00
Karl Tomlinson
d71b851551 bug 1303964 draw only background and frame of separator menuitems in GTK versions > 3.20 r=stransky+263117
In GTK 3.20, gtk_menu_item_draw() just draws the root widget gadget, depending
on the theme to style menu items with CSS name "separator" appropriately.

MozReview-Commit-ID: 6AIxPzFe0Rg
2016-11-17 11:08:33 +13:00
Karl Tomlinson
7fd2020211 bug 1287036 draw separator menuitem background and frame behind separator in menu r=stransky+263117
as does gtk_menu_item_draw().

MozReview-Commit-ID: DgYVFklmTO2
2016-11-17 11:04:13 +13:00
Karl Tomlinson
4ddb8064e2 bug 1287036 draw menuitem background even when not in hover r=stransky+263117
MozReview-Commit-ID: tuf5WXY0d4
2016-07-21 12:49:31 +12:00
Karl Tomlinson
93d5a12315 bug 1315668 use style context instead of widget for menuitem dimensions r=stransky+263117
This is necessary to switch from caching GtkWidgets to caching
GtkStyleContexts only.

MozReview-Commit-ID: 6Rwinr4AY8l
2016-11-15 16:11:38 +13:00
Karl Tomlinson
d4701b76b5 bug 1315668 remove use of gtk_container_get_border_width from menuitems r=stransky+263117
The GtkContainer border-width property defaults to zero.  It is not influenced
by theme CSS.  While theme engines can theoretically modify default values for
properties of any class, I don't think that is something that needs to be
supported.

Removing this code is necessary to switch from caching GtkWidgets to caching
GtkStyleContexts only.

MozReview-Commit-ID: IxgM8qjfK3a
2016-11-14 16:13:50 +13:00
Jan Horak
3f8c6cc043 Bug 1308936 - Draw tooltips correctly r=karlt
Tooltip widget is made in GTK3 as following tree:
* Tooltip window
 * Horizontal Box
   * Icon (not supported by Firefox)
   * Label
Each element can be fully styled by CSS of GTK theme so we have to draw all
elements with appropriate offset and full box model.

MozReview-Commit-ID: E9yYd5UWBu4
2016-11-11 11:31:29 +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
Makoto Kato
40260bd4bb Bug 1287278 - dropmaker-icon direction is wrong in RTL locale on Linux. r=karlt
Change only right arrows to left arrows when direction is RTL

MozReview-Commit-ID: 3mMCAGCIUYP
2016-10-14 13:37:08 +09:00
Jonathan Kingston
80b9bef57d Bug 1302157 - Remove images-in-menu and images-in-button code (& associated icons) since it's deprecated in GTK. r=bz,dholbert
MozReview-Commit-ID: IIj8PvgdaRp
2016-09-29 00:22:32 +01: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
e25d3ca315 Bug 1291769 - use correct "checked" state for treeview expanders, r=acomminos 2016-08-03 14:53: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
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
Martin Stransky
d00e7467cf Bug 1287082 - Move GtkExpander widget from gtk3drawing.cpp to WidgetCache, r=acomminos 2016-07-18 04:27:00 +02:00
Martin Stransky
1280471838 Bug 1276534 - don't save/restore style context on arrows on menu, r=karlt 2016-06-13 05:28:00 +01:00