Commit Graph

76 Commits

Author SHA1 Message Date
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
Sebastian Hengst
536c7dd264 Backed out changeset 8c45140a2819 (bug 1343802) 2017-03-27 18:00:18 +02:00
Kan-Ru Chen
59bfd6e8d3 Bug 1194751 - Part 5. Implement ScreenHelperGTK and delete old nsScreenManagerGtk/nsScreenGtk. r=karlt
ScreenHelperGTK is the platform dependent part of the original
nsScreenManagerGtk and nsScreenGtk. It registers monitors-changed
event listener from gtk and pushes updates to ScreenManager. See patch
part 4. for how ScreenManager works.

MozReview-Commit-ID: KBo7ZLFTjM3
2017-03-09 19:29:44 +08: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
68114944c8 bug 1324256 consider scrollbar trough borders even for GTK versions < 3.20 r=jhorak+328198
This is needed for GTK themes with non-zero trough-border such as Greybird.

MozReview-Commit-ID: 8ERxq5Nia6F
2017-01-09 19:33:27 +13:00
Jan Horak
7be4f2cc98 Bug 1310850 - Zero scrollbar size could also happen when running GTK 3.20 so we need to set the minimum size of the scrollbar to the minimum size of a thumb. r=karlt 2016-10-25 11:27:00 -04:00
Carsten "Tomcat" Book
2f7e55f794 Backed out changeset 67c74a5cfcda (bug 1310850) for bustage 2016-10-25 10:17:34 +02:00
Jan Horak
e5c9acbacc Bug 1310850 - Zero scrollbar size could also happen when running GTK 3.20 so we need to set the minimum size of the scrollbar to the minimum size of a thumb. r=karlt 2016-10-20 02:40:00 +02:00
Karl Tomlinson
30781dfb45 bug 1311604 consider block flow direction in vertical writing mode native widget layout r=jfkthame
This follows the same approach of considering block flow for all widgets
(in addition to resizers) as done for other toolkits in
https://hg.mozilla.org/mozilla-central/rev/4a65cacf8a37#l3.10

MozReview-Commit-ID: Ca3SMs1k2Tj
2016-10-20 17:57:55 +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
Martin Stransky
fa1ccd5b2b Bug 1271524 - Move tab widget to WidgetCache. r=acomminos 2016-08-21 23:13:00 -04:00
Lee Salzman
344ae0c7df Bug 1291856 - push clip before drawing GTK3 widgets. r=acomminos
MozReview-Commit-ID: 84Y8sBg7NzF
2016-08-03 20:24:39 -04:00
Andi-Bogdan Postelnicu
f90845c058 Bug 1273423 - removed useless null pointer check on |aFrame|. r=karlt+@karlt.net
MozReview-Commit-ID: 1HCh1pKVUh1
2016-05-23 11:04:51 +03:00
Martin Stransky
b46fc7201e Bug 1261576 - render scrollbar thumb as "hovered" to emulate active Gtk thumb style. r=karlt 2016-07-11 12:29:00 +02:00
Keith Yeung
198e624d27 Bug 1274339 - Align resizerpanel and caret in -moz-appearance. r=bobbyholley 2016-05-19 10:58:00 +02:00
Jonathan Kew
b87792ac80 Bug 1274368 - Draw resizer as RTL for elements with vertical-rl writing mode. r=dholbert 2016-05-21 13:59:25 +01:00
Karl Tomlinson
838da096ad bug 1272194 replace MOZ_TOPLEVEL_MENU_ITEM flag with MOZ_GTK_MENUBARITEM node r=stransky+263117
This provides a better mapping between WidgetNodeType and GtkWidgets.

MozReview-Commit-ID: 3YYzK4aZCbP
2016-05-19 16:55:04 +12:00
Keith Yeung
ae9de308f5 Bug 1273424 - Rename -moz-appearance keyword constants to be more consistent with CSS keywords. r=bholley 2016-05-18 11:07:47 -07:00
Karl Tomlinson
2b505c2fd9 bug 1234158 rename GtkThemeWidgetType enum to WidgetNodeType as it will differentiate GTK CSS nodes r=Stránský 2016-04-14 17:47:20 +12:00
Martin Stransky
4bec9657d5 Bug 1263145 - Render multiline input text entries as GtkTextView, r=karlt 2016-04-27 01:07:00 +02:00
Botond Ballo
dfa7522d52 Bug 1255214 - Only repaint GTK scrollbar button if its enablement actually changed. r=mstange
MozReview-Commit-ID: ITLeksQzvVM
2016-04-20 19:49:09 -04:00
Bill Gianopoulos
0063b0fd3b Bug 1262634 - Avoid undefined reference to moz_gtk_get_entry_min_height in builds specifying cairo-gtk2 toolkit. r=karlt 2016-04-07 19:25:24 -04:00
Martin Stransky
61df47f746 Bug 1257811 - set min-height for input widgets. r=karlt 2016-04-01 04:43:00 +02:00
Karl Tomlinson
ac6b2bcbf1 bug 1230065 consider arrow size in dropdown minimum widget size r=acomminos 2016-03-01 13:12:03 +13:00
Chris Peterson
8188617398 Bug 1242135 - Annotate intentional and fix unintentional switch fallthroughs in widget/gtk/. r=karlt
widget/gtk/nsNativeThemeGTK.cpp:1032:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
widget/gtk/nsNativeThemeGTK.cpp:1058:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
widget/gtk/nsNativeThemeGTK.cpp:1274:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
widget/gtk/nsNativeThemeGTK.cpp:1718:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
2016-01-22 22:44:06 -08:00
Lee Salzman
8eafd627d2 Bug 1239040 - Fix DrawTargetCairo/DrawTargetSkia LockBits and BorrowedXlibDrawable to work inside PushLayer. r=jrmuizel 2016-01-13 13:11:07 -05:00
Jan Horak
e50785bc6f Bug 1205643 - Move scrollbar borders to slider to receive button events. r=karlt 2016-01-06 23:55:00 -05:00
Jan Horak
14e6f46e2b Bug 1205643 - "Wrong scrollbar border prevents scrolling to cursor when mouse is on the screen edge". r=karlt 2015-12-22 05:05:00 +01:00
Nicholas Nethercote
45f644982f Bug 1221610 - Remove ToIntMargin(). r=jrmuizel.
It's now a no-op.
2015-11-04 09:40:16 -08:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Nathan Froyd
bf7f6dda03 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Andrew Comminos
064c0a352c Bug 1187203 - Implement GtkInfoBar appearance style on GTK3. r=karlt 2015-08-21 16:38:15 -04:00
Petr Jasicek
0d391295b2 Bug 1160154 - Decrease padding between icons in the personal toolbar with Gtk3 by using "image-button" css style class. r=karlt
CLOSED TREE
2015-08-07 01:09:00 -04:00
Andrew Comminos
67d4139562 Bug 1187237 - Correct range slider drawing on GTK3. r=karlt 2015-07-30 11:29:00 +02:00
Andrew Comminos
28f2160390 Bug 1179780 - Render opaque scrollbar troughs in the root viewport on GTK3. r=karlt 2015-07-14 07:35:00 -04:00
Botond Ballo
3bdeeb088b Bug 1177024 - Fix clang warnings-as-errors in GTK3 build. r=karlt 2015-06-21 15:27:07 -04:00
Andrew Comminos
620b461c0f Bug 1171696 - Require room for scrollbar sliders and draw troughs only when there is room for a slider or buttons on GTK. r=karlt 2015-06-17 07:27:00 -04:00
Andrew Comminos
354815c223 Bug 1167239 - Make GTK button activity require hover. r=karlt 2015-06-16 07:58:00 -04:00
Hubert Figuière
725cd3e8ef Bug 1168527 - Variable was re-declared causing a bustage on gcc 5. r=lsalzman 2015-06-12 14:19:34 -04:00
Andrew Comminos
a2fc9728b2 Bug 1168527 - Replay clips into the system cairo on GTK3. r=lsalzman 2015-06-09 13:46:09 -04:00
Jonathan Kew
1eacbd850d Bug 1113206 patch 2: Disable use of Cocoa and Gtk native-theme dropdown rendering that doesn't play well with vertical writing mode. r=roc 2015-06-08 07:21:42 +01:00
Lee Salzman
2ce9dc19f8 Bug 1165513 - Translate GTK3 widgets with snapped pixel coordinates into identity space. r=jrmuizel 2015-05-19 17:08:35 -04:00
Martin Stransky
57c1d6a5f1 Bug 1144745 - scale border returned by GetWidgetBorder(), r=karlt 2015-04-28 06:22:00 +02:00
Lee Salzman
db27f83933 Bug 1127752 - fixes for using Skia and OMTC with GTK3. r=jrmuizel 2015-05-13 11:54:17 +09:00
Martin Stransky
93b0eebda2 Bug 1073117 - Add support for has_tab_gap notebook style. r=karlt 2015-04-30 01:31:00 -04:00
Martin Stransky
428007cfdc Bug 1144745 - moves gdk_screen_get_monitor_scale_factor() call to nsScreenGtk :: GetGtkMonitorScaleFactor(). r=karlt 2015-04-23 12:35:00 -04:00
Jonathan Kew
8ab6ebfa80 Bug 1028716 part 3 - Widget updates to support the extended set of -moz-orient values. r=roc 2014-06-24 19:26:13 +01:00
Nicolas Silva
d73f54cb00 Bug 1155621 - Make nsIntRect and nsIntPoint typedefs of mozilla::gfx::IntRect and mozilla::gfx::IntPoint. r=Bas 2015-04-21 17:04:57 +02:00
Andrew Comminos
d50511b3c1 Bug 1144745 - Scale GTK widgets properly on HiDPI r=karlt 2015-03-29 18:06:00 +02:00
Mats Palmgren
fe65991446 Bug 1148971 - Make nsITheme::GetMinimumWidgetSize return a LayoutDeviceIntSize result instead of the unit-less nsIntSize type. r=roc 2015-03-30 11:36:14 -04:00