Commit Graph

58625 Commits

Author SHA1 Message Date
Matthias Clasen
724f315ae6 Stop exporting gtk_popover_bind_model
We can't improve popover menus as long as we
have to be able to work with any old popover
we're given. Remove this, so we can make
gtk_popover_new_from_model return a subclass.
2019-06-09 17:38:54 +00:00
Matthias Clasen
59ed4da717 box layout: Handle native children
These need to be skipped in measuring,
and we need to call gtk_native_check_resize
on them during allocation.

This was showing up as the new-style
context menu in widget-factory forcing
its relative-to box to grow when its
shown.
2019-06-09 17:38:53 +00:00
Matthias Clasen
640c7939ea modelbutton: Sizing fixes
We only want to reserve indicator size if
there are any checks or radios in the popover.
Unfortunately, GtkIcon has a hardcoded min-size
of 16, defeating this use. Work around by
wrapping each indicator in a box, and showing/
hiding the actual indicator.
2019-06-09 17:38:53 +00:00
Matthias Clasen
0755491b77 widget factory: Add a context menu example
This is also taken from
https://gitlab.gnome.org/Teams/Design/os-mockups/blob/master/menus/menu-design-patterns.png
2019-06-09 17:38:53 +00:00
Matthias Clasen
698e39bcac popover menu: Fix style classes
We want the same style classes that are produced
when creating a popover from a menu model.
2019-06-09 17:38:53 +00:00
Matthias Clasen
06470c2378 widget factory: Improve manual popover menu example
Set up the size group, so things line up.
2019-06-09 17:38:53 +00:00
Matthias Clasen
84243d0f55 widget-factory: Redo the new-style menu
Do this from a menu model first, since that
is easier to get right.
2019-06-09 17:38:53 +00:00
Matthias Clasen
e080f35d25 menu section box: Add style classes for display hints
This makes it easier to realize some of the new
styles for popover menus.
2019-06-09 17:38:53 +00:00
Matthias Clasen
3313322864 menu section box: Introduce more section variants
Allow display-hint to be circular-buttons or
inline-buttons, to produce variations of horizontal
button layouts.
2019-06-09 17:38:53 +00:00
Matthias Clasen
dd572ed10a model button: Look up accels if needed
When we are not given an explicit accel (as is
the case when the popover is constructed from
a model), then look it up from the GtkApplication
at map time.
2019-06-09 17:38:53 +00:00
Matthias Clasen
fc3d3fb3af model button: Show shortcuts
Most of the machinery for this is already
in place. We just need to add an accel property
to GtkMenuButton and pass it through.
2019-06-09 17:38:53 +00:00
Matthias Clasen
eda31dff5d model button: Redo layout
Move checks to the left, and introduce a size group
to align things. The size group is provided by the
parent, using the new ::indicator-size-group property.
2019-06-09 17:38:53 +00:00
Matthias Clasen
b4aac42605 widget-factory: Add another popover menu example
This one is taken from
https://gitlab.gnome.org/GNOME/gtk/issues/1824
2019-06-09 17:38:53 +00:00
Matthias Clasen
30f6bea25f model button: Drop centered, inverted properties
These properties were only useful for titles,
and we have a role for that now.
2019-06-09 17:38:53 +00:00
Matthias Clasen
fc6010be37 model button: Add a role for titles
This gets us out of using direct presentational
markup like 'inverted' and 'centered' and will
make it easier to play with different layout.

Use the new role when creating popover
menus from models.
2019-06-09 17:38:53 +00:00
Matthias Clasen
0d59ece4a4 model button: Small fixes
Make iconic model buttons work better.
2019-06-09 17:38:53 +00:00
Piotr Drąg
4494884f9a Update POTFILES.skip 2019-06-09 17:29:12 +02:00
Christian Hergert
4a954a9a1c gtkapplication: track changes to profiler D-Bus API
Recently, to make things more forward-portable, Sysprof and Mutter altered
the API for org.gnome.Sysprof3.Profiler. This tracks those changes.
2019-06-06 17:24:33 -07:00
Christian Hergert
868e13e471 config.h: fix stray # 2019-06-06 16:08:36 -07:00
Matthias Clasen
a10ce07437 Merge branch 'wip/chergert/set-va-marshallers' into 'master'
va_marshaller: add various va_marshallers

See merge request GNOME/gtk!917
2019-06-06 22:39:44 +00:00
Christian Hergert
828c36636c va_marshaller: add various va_marshallers
We don't need to cover every case with a va_marshaller, but there are a
number of them that are useful because they will often only be connected
to by a single signal handler.

Generally speaking, if I opened into a file to add a va_marshaller, I just
set all of them.
2019-06-06 15:30:42 -07:00
Matthias Clasen
c168116e64 Merge branch 'wip/matthiasc/shared-glyph-cache' into 'master'
Share the glyph cache

See merge request GNOME/gtk!912
2019-06-05 12:10:24 +00:00
Matthias Clasen
0dcb71722a Cosmetics
Rename some arguments, since atlases->atlases is awful.
2019-06-05 12:03:39 +00:00
Matthias Clasen
d90143d09c texture atlas: Add a missing initialization
Pointed out by Timm.
2019-06-05 12:00:53 +00:00
Matthias Clasen
e7cb88b710 Merge branch 'theme-load' into 'master'
Add a theme loading benchmark

See merge request GNOME/gtk!913
2019-06-05 10:56:25 +00:00
Matthias Clasen
69016825aa render node: Optimize type checks
The GSK_IS_RENDER_NODE macro is a bit silly,
and not worth having in g_return_if_fail checks
in trivial getters.
2019-06-05 04:25:43 +00:00
Matthias Clasen
e08bab012c surface: Use surface->display directly
No need to go through a public getter
for internal uses.
2019-06-05 04:25:14 +00:00
Matthias Clasen
1a93ab053c Add a theme loading benchmark 2019-06-05 04:20:31 +00:00
Matthias Clasen
e961943508 Fix a refcounting mishap
We were missing a ref, causing caches to go missing
when a window is opened twice.
2019-06-05 02:49:07 +00:00
Matthias Clasen
0aa9e16294 Bring brink skip_allocate
This was removed by accident in 580aa8204f,
together with some no longer needed popover
special-casing.
2019-06-05 00:31:53 +00:00
Matthias Clasen
054b5216a1 Remove debug spew 2019-06-04 23:11:18 +00:00
Timm Bäder
ecb353f4af Consider all offscreen drawings for the icon cache 2019-06-04 23:00:02 +00:00
Matthias Clasen
259bbdcb09 Share glyph and icon caches
Use the same texture atlases to back both
the glyph and icon caches, and unify their
sizes and management. Store big glyphs
in separate textures, so all atlases have
the same size. Tweak some of the eviction
parameters.

We share the caches across all GL contexts
on a display, unless the GSK_NO_SHARED_CACHES
env var is set.
2019-06-04 23:00:02 +00:00
Matthias Clasen
1f70bc4bf3 gdk: Create a global shared GL context
Create a global GL context that connects all
GL contexts on a display and lets us share textures
between them.
2019-06-04 23:00:02 +00:00
Matthias Clasen
7293fd517e glyph cache: Stop storing driver and render
This is the first step towards sharing glyph
caches across renderers.
2019-06-04 23:00:02 +00:00
Matthias Clasen
c9cea36b37 gl: Use pad-extend for icon cache
Repeat the border pixels to avoid artifacts from
linear scaling.
2019-06-04 23:00:02 +00:00
Matthias Clasen
4020399439 gl: Use linear scaling for atlases 2019-06-04 23:00:01 +00:00
Matthias Clasen
efc31161f0 gl: Allow setting min/mag filter on textures
This will be used in the future.
Adapt all callers to pass GL_NEAREST for now.
2019-06-04 23:00:01 +00:00
Matthias Clasen
102cc1c8d3 gl: Add 1 pixel of padding in the icon cache 2019-06-04 23:00:01 +00:00
Matthias Clasen
2529385fe4 glyph cache: Reinstate 1 pixel padding
This is necessary to prevent bleeding.
2019-06-04 23:00:01 +00:00
Matthias Clasen
f37274dbb0 gl: Don't leak texture atlases
We need to free the texture atlases, and the
textures backing them.
2019-06-04 23:00:01 +00:00
Matthias Clasen
a3757936c1 gl: Free icon data 2019-06-04 23:00:01 +00:00
Matthias Clasen
adb5df020c glyph cache: Clarify message
We have different kinds of caches now.
2019-06-04 23:00:01 +00:00
Timm Bäder
cf4ff56ca5 gl renderer: Add & use icon cache
Upload small icons all to the same texture atlas.
2019-06-04 23:00:01 +00:00
Timm Bäder
e2ffad7b07 glimage: Only support uploading one region 2019-06-04 23:00:01 +00:00
Timm Bäder
b74bb90c7d gl renderer: Move texture atlas into its own file
We want to reuse the code later.
2019-06-04 23:00:01 +00:00
Timm Bäder
66b081dc9c glglyphcache: Use stb_rect_pack for better glyph packing 2019-06-04 22:42:00 +00:00
Benjamin Otte
bb5871fd81 docs: Remove mention of queue_draw_area()
and queue_draw_region(). They're gone since 73650c6da2.
2019-06-04 14:59:32 +00:00
Timm Bäder
4b3986ae1f rendernodeimpl: Inline container_node_get_bounds into _new
It's the only caller of the function and we can avoid a second loop over
all child nodes this way.
2019-06-04 16:48:08 +02:00
Timm Bäder
ac333d712d snapshot: Make append_node_internal transfer-full
There is only one case where we do *not* directly unref the node again
after calling this.
2019-06-04 16:48:08 +02:00