Commit Graph

23444 Commits

Author SHA1 Message Date
Arc Riley
15c73a2b1a Add gtk_widget_set_font_options and gtk_widget_get_font_options
This allows a widget to override global font_options, such as hinting and
subpixel order. The widget's PangoContext is updated when this is set.

Some update code from gtk_widget_update_pango_context was moved to
update_pango_context so that gtk_widget_update_pango_context runs it.

http://bugzilla.gnome.org/show_bug.cgi?id=751677
2015-07-01 07:34:32 -07:00
Cosimo Cecchi
9913b02e3b switch: add a style property for the switch height
Instead of hardcoding an aspect ratio.
This will be replaced by min-height/max-height when we have them.

https://bugzilla.gnome.org/show_bug.cgi?id=751689
2015-06-30 13:28:26 -07:00
Jasper St. Pierre
04e727709d window: Don't send startup notifications for offscreen / popup windows
The WM isn't aware of O-R (popup) or offscreen windows. If somebody
maps an offscreen or a popup GTK+ window before the main window, we'll
complete the sequence before a "real" window is mapped. Make sure to
ignore these for startup notifies.
2015-06-29 14:26:45 -07:00
nick
802b006b37 settings: Include pangofc-fontmap.h header on Wayland
In case the X11 backend is not enabled, we still need to include the
pangofc-fontmap.h header file, as we use the Pango/FontConfig API in
both the X11 and Wayland case.

https://bugzilla.gnome.org/show_bug.cgi?id=751625
2015-06-29 20:41:04 +01:00
Benjamin Otte
cd3f24d579 cssvalue: Change color transitions to run premultiplied
Previously, the unpremultiplied values from the GdkRGBA were taken. Now
we premultiply the color values as specified by the CSS specs.
This is only relevant when transitioning with translucent colors.

An example is the halfway transition between transparent (0, 0, 0, 0)
and white (1, 1, 1, 1). Previously, all 4 values where transitioned
separately and the result was semi-transparent gray (0.5, 0.5, 0.5,
0.5).
By depending on the alpha value, the result is now semi-transparent
white (1, 1, 1, 0.5) which is what one would naively expect.

New reftest: color-transition
2015-06-26 21:12:50 +02:00
Benjamin Otte
142abce46a cssvalue: Special case resulting color for transparency
Again, preparation for using premultiplied color transitions.
2015-06-26 20:54:57 +02:00
Benjamin Otte
e3d8f03b3a cssvalue: Restructure RGBA transitions
Split out a function to make the code clearer for the changes ahead.
2015-06-26 19:06:02 +02:00
Lapo Calamandrei
029800c426 Adwaita: entry linking fixes
Set the right border color on the linked entry after the focused
one.
2015-06-25 20:04:32 +02:00
Lapo Calamandrei
56a3fd888a Adwaita: rubberbands!
Darken the rubberband a bit to make it visible on the selected
color background, fix treeview rubberband border issue.
2015-06-25 19:57:07 +02:00
Carlos Garnacho
0606b525b4 gtkdnd: Plug a leak
We create a cairo_t in order to find out the surface extents, but it
was being leaked, dragging the whole drag surface with it through
extra refs.
2015-06-25 15:09:56 +02:00
Carlos Garnacho
33f9cbafcd gtkmodelbutton: Plug a leak
The private struct had some data that needed freeing, but this widget
didn't have any destroy/dispose/finalize handlers.
2015-06-25 15:09:56 +02:00
Carlos Garnacho
6de82c9be3 gtkmenusectionbox: plug a leak
The list returned by gtk_container_get_children() wasn't being freed.
2015-06-25 15:09:56 +02:00
Matthias Clasen
f8b7623b3c builder-tool: Don't strip h/vexpand
Setting these properties has the side-effect of setting the
corresponding -set properties, which makes GTK+ behave subtly
different. So don't mess with these.
2015-06-25 07:01:26 -04:00
Matthias Clasen
e9e9dfade6 GtkSearchBar: Don't vexpand
It turns out that setting vexpand to its default value has
side-effects that we need.

https://bugzilla.gnome.org/show_bug.cgi?id=751447
2015-06-25 07:00:13 -04:00
cedlemo
d31e1fbef0 GtkImage: Make resource property work properly
gtk_image_set_from_resource was setting the resource_path,
only to have it overwritten again before returning. That
is not as it should be, so change things to set the resource
path late.

https://bugzilla.gnome.org/show_bug.cgi?id=751443
2015-06-25 06:50:44 -04:00
Christoph Reiter
48ea0cbe4b GtkWindow: some min/nat size corrections.
Don't add the container border to the title request size; it
is only used for the child widget.

Don't call gtk_widget_get_preferred_width_for_height() for
the title bar with an unrelated height and subtract the title
bar height before querying the child widget width.

Guard against negative size requests after substracting the
borders/shadows and the title bar.

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-24 10:58:30 +02:00
Matthias Clasen
3b97a0b940 Fix an oversight 2015-06-23 16:46:26 -04:00
Matthias Clasen
7f0606509d GtkPlacesSidebar: Simplify sidebar code
Make this code follow GTK+ styles and conventions better.
2015-06-23 16:35:17 -04:00
Matthias Clasen
ae8c07c67c GktPlacesSidebar: Plug a ton of leaks
If you don't keep in mind that g_object_get() returns references to
objects and copies fo strings, things leak all over the place.
2015-06-23 16:35:17 -04:00
Matthias Clasen
f2a8ddfecf sidebarrow: Avoid object-valued properties
They tend to leak...as these do.
2015-06-23 16:35:17 -04:00
Benjamin Otte
9f27ee7f5a render: Fix ridge/groove border rendering
The typo strikes again!
2015-06-23 22:33:40 +02:00
Christoph Reiter
335c070f9b GtkHeaderBar: reduce minimum title width
The minimum title width affects the minimum window width
for CSD windows. To allow smaller windows like without
CSD reduce it a bit (276px vs 156px min width)

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-23 21:16:37 +02:00
Christoph Reiter
84e99b20ac GtkWindow: fix default empty window size with CSD
In the non-CSD case we checked for 0x0 window size requisition
and replaced it with 200x200 so the window was still visible.
This no longer works in case of CSD as the shadow and title bar
are always added to the requisition resulting in a titlebar/shadow
only window in case there is no child widget (this is currently
visible under wayland or when setting GTK_CSD=1).

Instead of special casing the final window size, special case
the child requisition paths instead. This gives us the same
requisition in both, CSD and non-CSD cases (the header bar
has a too large minimum width atm so the resulting window is
still not the same)

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-23 21:16:14 +02:00
Lapo Calamandrei
ec9a39977a Adwaita: scale marks visible on the dark variant 2015-06-23 19:11:15 +02:00
Matthias Clasen
1ed21ad3d4 GtkScale: More work on mark spacing
Try harder not to push the scale out of balance by marks. With
this change, the remaining difference in the drawing is down
to asymmetric assets and margins coming out of the theme.
To fully support such asymmetric rendering, we need implement
baseline alignment for scales.

https://bugzilla.gnome.org/show_bug.cgi?id=749650
2015-06-23 09:36:14 -04:00
Matthias Clasen
7ce96cb6ac GtkStack: Avoid some unnecessary complication
We already have an in-destruction flag, so use it.
2015-06-23 06:45:07 -04:00
Christoph Reiter
3c9cca596f Fix calculation of edge input window size in case the real window is too small.
This error resulted in warnings like
"pixman_region32_init_rect: Invalid rectangle passed"

In case the window is smaller than handle_size * 2 the resulting
edge window got a negative size. Prevent that by limiting the
handle size to half the respective edge length. This also
prevents the corner windows from overlapping in case the window
is too small.
2015-06-22 14:22:50 +01:00
Emmanuele Bassi
97e728580c Revert "window: Check if we can use CSD before enabling them"
This reverts commit c5e5ee6749.

It turns out that this commit breaks the default sizing of GtkWindow,
which in turn causes the window to be smaller than the handle size,
which ends up sending invalid rectangles to Cairo.

We'll have to find another way to fix the CSD issue.

See also: https://bugzilla.gnome.org/show_bug.cgi?id=751140

https://bugzilla.gnome.org/show_bug.cgi?id=750343
2015-06-22 14:21:47 +01:00
Paolo Borelli
4e155d784d Avoid spurious operations on destroy
When the stack is destroyed we do not want to waste time running
animations and notifying listeners about which is our current
visible child.

This is not only an optimization, but it is important for the stack
switcher widgets: since they are in another branch of the hieratchy
we do not want to get notifications while the stack is being destroyed.

Based on a patch by Paolo Borelli
https://bugzilla.gnome.org/show_bug.cgi?id=724506
2015-06-21 11:32:31 -04:00
Matthias Clasen
3b43951ba4 Pacify gobject-introspection
gobject-introspection complains about the parameter names of
vfuncs. Why, you ask ? No idea.
2015-06-20 20:29:18 -04:00
Matthias Clasen
93f9a81ac5 GtkRange: Improve zoom handling a bit
The calculation to update the initial slider position on zoom
changes was not working correctly when using keys to toggle
zoom on and off for scales. Avoid it by updating the position
beforehand.
2015-06-20 20:26:42 -04:00
Matthias Clasen
27dabaefa6 GtkRange: Make drag gesture less agressive
Moving the mouse while pressing one of the steppers was making
the slider jump to the end, unexpectedly. This was caused by the
drag gesture kicking in when it shouldn't. Fix this by making
all drag gesture signal handlers only do something if we are in
a drag thats started on the slider.

https://bugzilla.gnome.org/show_bug.cgi?id=751050
2015-06-20 18:37:15 -04:00
Caolán McNamara
b4a88c7287 file chooser: Avoid tall combos
The filter combo box in the file chooser was stretching to match
the height of the extra widgets next to it. Since, stretched combo
boxes are not a pretty sight, make it stick to the top instead.

Patch by Caolán McNamara,

https://bugzilla.gnome.org/show_bug.cgi?id=751227
2015-06-20 10:55:02 -04:00
Matthias Clasen
b684e70dd5 GtkOverlay: Sync up parameter names
gtk-doc gets confused if the parameter names between header,
source and doc comment don't match up.
2015-06-20 10:52:44 -04:00
Matthias Clasen
3c711cc98a Fix a typo
gtk-doc complained about a multi-line Since: tag, but the
real culprit was a typo in the Deprecated: tag.
2015-06-20 10:52:01 -04:00
Matthias Clasen
d642ae78fc GtkWindow: Small documentation addition 2015-06-20 10:36:09 -04:00
Matthias Clasen
5981e15115 GtkTextView: Small documentation addition 2015-06-20 10:33:56 -04:00
Matthias Clasen
2caa1deb5b Fix up index for some 3.14 symbols
Marking these as "Since: 3.14.1" may be more accurate, but
it causes gtk-doc to not put these symbols in any versioned
index at all (it generates an unused index for 3.14.1). So,
lets lie a little, and say these symbols were added in 3.14.
2015-06-20 10:28:03 -04:00
Matthias Clasen
2f8e4f2685 GtkAssistant: Fix criticals on dispose
After the recent change thta introduced boxes between the pages
and the notebook, we were no longer careful enough when disposing
the assistant. Fix that up.
2015-06-19 21:56:29 -04:00
Matthias Clasen
a4dcc6bc52 file chooser: Small cleanup
Ask the search model if it is empty, instead of maintaining this
information manually in the file chooser widget.
2015-06-19 01:04:42 -04:00
Matthias Clasen
66b5d2e523 GtkSearchEngineTracker: Fix SPARQL syntax
The function is called tracker:uri-is-descendant, not
tracker-uri-is-descendant.
2015-06-19 01:04:18 -04:00
Matthias Clasen
489b48d0b5 Forgotten file 2015-06-19 01:03:28 -04:00
Matthias Clasen
9426fb08ce GtkSearchEngineSimple: Avoid a private struct
We can just make this type final, and avoid the private struct.
2015-06-19 00:48:29 -04:00
Matthias Clasen
ca31662630 GtkSearchEngineTracker: Avoid a private struct
We can just make this type final, and avoid the private struct.
2015-06-19 00:41:10 -04:00
Matthias Clasen
d9a22e7e30 Avoid an unnecessary check
We create the indexed_locations array unconditionally.
2015-06-19 00:34:28 -04:00
Matthias Clasen
ed50772b41 GtkSearchEngine: Avoid a crash
Add a destroy notify for the data of the callback, so we don't
end up leaving a dangling pointer behind for a short while if
the native engine is finalized before the simple one. This
was showing up as crash when typing and backspacing in the
search entry of the file chooser.
2015-06-19 00:32:49 -04:00
Matthias Clasen
d12c7186b6 GtkSearchEngine: Avoid crawling indexed locations
Implement the IsIndexed callback for tracker. This requires
reading settings of the tracker file miner. We are careful
to avoid a hard dependency on the tracker schemas.
2015-06-19 00:12:46 -04:00
Matthias Clasen
c7d86ef4e4 GtkSearchEngine: Avoid crawling indexed locations
Add a framework to the simple engine that allows to skip
locations which are indexed by the native engine.
2015-06-19 00:11:01 -04:00
Matthias Clasen
33e2d12e90 GtkSearchEngine: Initialize recursive flag
Otherwise all our searches become non-recursive, which was not
the intention.
2015-06-19 00:06:51 -04:00
Matthias Clasen
a3a58fa7d9 GtkSearchEngine: Add recursive flag
Add a flag for recursive search, and implement non-recursive
search in both the tracker and simple search engines.

This is not currently used in the file chooser.
2015-06-18 22:59:44 -04:00