If the foreground color has an alpha != 1 we used to just pass that into
the svg. This is useful to e.g. render an insensitive icon. However,
that is not an ideal model for symbolics. For instance, if the icon uses
overlapping areas when drawing, expecting these to be opaque then the
transparent color will result in a different alpha value for the overlapping
area. Also, non-foreground symbolic colors are still rendered opaque, and
the recoloring of pngs can't handle transparent colors.
So, instead we extract any alpha from the foreground, render using the
opaque colors and then apply the foreground alpha to the entire result.
This means we get an even transparency, even for other colors, and we
can apply alpha for the pngs too.
https://bugzilla.gnome.org/show_bug.cgi?id=734668
_gtk_icon_helper_get_size() is often used during size request and may
not necessary mean that the icon will be displayed immediately. In
many common cases we know the size without having to ensure a surface.
In many cases this means we can avoid loading an icon until needed, and
in the case of stateless IconHelpers such as GtkCellRendererPixbuf this
is very important as otherwise it will constantly be reloading icons
if the displayed set is larger than the in-memory icon cache.
https://bugzilla.gnome.org/show_bug.cgi?id=734651
If a child has set_has_window == FALSE, it purely relies on the events set on
the parent window, for which the bin window used to just ensure the exposure
mask, eating all input events.
https://bugzilla.gnome.org/show_bug.cgi?id=734357
gtk_widget_get_events() must indeed tell about events enabled purely through
a GtkEventController, those events will most surely trigger event handlers.
https://bugzilla.gnome.org/show_bug.cgi?id=734357
This check used to be present in the pre-gestures code, but was unintentionally
removed when splitting code into drag/multiclick gestures. The policy used to
be that if clicking happened on an already selected node, DnD would happen
instead of rubberband selection, so this behavior is resuscitated.
https://bugzilla.gnome.org/show_bug.cgi?id=734143
gtk_gesture_drag_get_start_point and gtk_gesture_drag_get_offset
have out args that need to be annotated.
This commit adds the (out) and (nullable) annotations as appropriate.
https://bugzilla.gnome.org/show_bug.cgi?id=734292
For that to happen the libgtk3 is embedded with a manifest that requests
common controls library 6.x, and GTK lazily calls InitCommonControlsEx()
to initialize those. Then this manifest is used to temporarily override
the process activation contest when loading comdlg32 (which contains the
code for the print dialog), ensuring that it too depends on common
controls 6.x, even if the application that uses GTK does not.
https://bugzilla.gnome.org/show_bug.cgi?id=733773
handle_x always corresponds to the visible position of the handle,
which is where we want to start the animation. Without this, repeated
keyboard activation will not always animate.
Since we are storing positions here that depend on the allocation,
we need to update them in size-allocate. This fixes incorrect
positioning of the handle if the switch is active initially.
https://bugzilla.gnome.org/show_bug.cgi?id=734213
Rows are not necessarily selected via select_row_internal(), add
the missing signal emissions there. Also the signal should be emitted
when removing the selection altogether.
https://bugzilla.gnome.org/show_bug.cgi?id=729809
This counterpart to gtk_application_get_accels_for_action() lets you
find out if a particular accelerator has one or more actions associated
with it. This might be useful from an accelerator editor or plugin
system to prevent the the installation of conflicting accelerators.
https://bugzilla.gnome.org/show_bug.cgi?id=721367
Currently, jhbuild-ing GTK+ on Ubuntu 14.04 LTS and gcc 4.8.2 errors out with
/usr/bin/ld: encodesymbolic.o: undefined reference to symbol 'g_file_new_for_path'
/opt/gnome/lib/libgio-2.0.so.0: error adding symbols: DSO missing from command line
when trying to build gtk-encode-symbolic-svg. This is because $(GTK_DEP_LIBS) isn't defined in $(gtk_encode_symbolic_svg_LDADD) in gtk/Makefile.am. This patch should fix that.
Thanks to b4n and gregier in irc.gimp.net/#gtk+ for help.
https://bugzilla.gnome.org/show_bug.cgi?id=734201
An animation may be scheduled while the textview content changed in size, so the resize
queued would just unset the animation and set the adjusments with a current value,
defeating gtk_text_view_scroll_to_iter(). In this case, just avoid the adjustment change,
as there is a target value on the way.
https://bugzilla.gnome.org/show_bug.cgi?id=733406
Popovers may get relocations optimized away if only x/y changed
in the GtkAllocation. So make sure the toplevel updates popover
positions on all situations.
https://bugzilla.gnome.org/show_bug.cgi?id=729140
It is bad if the image that is used as a fallback for missing
images goes missing itself, so include it as a resource. This
way, it will always be available.
The rules-hint property has always been a fairly bad application API, as
it set some wrong expectations for the developers; deferring to the
theme makes it impossible to design application reliably, and if this is
a usability setting we should either impose this setting on every theme,
or simply drop it.
Our own default theme does not honour the zebra striping, which makes
this function even more questionable.
In practice, usability studies on zebra striping have demonstrated that
alternating colors on a list it improves readability just as much as
clear ruling between rows, or by visually differentiating the selected
row. Zebra striping improves readability (or, at least, it does not
hinder it) on static displays, like a table on paper or a document; on a
dynamic display, like an application's UI, there are different
strategies that yield similar, if not better, results.
https://bugzilla.gnome.org/show_bug.cgi?id=733312
The next call to gtk_list_box_get_selection_mode just expected the
GtkListBoxRow's parent to be a GtkListBox and failed when the row was
added to something other than a GtkListBox.
https://bugzilla.gnome.org/show_bug.cgi?id=733782
If an icon theme has a file called "foo-symbolic.symbolic.png" which
was converted from svg using gtk-encode-symbolic-svg we will read
it in an recolor, allowing symbolic icons without using librsvg.
https://bugzilla.gnome.org/show_bug.cgi?id=730450
If the same position is requested on a popover, it should at least ensure
the window is realized and raised, even if no resizes are queued on the
content. Otherwise other widgets being mapped might raise the windows over
the popover's if its original position is unchanged.
https://bugzilla.gnome.org/show_bug.cgi?id=734129
It turns out that when we were painting the shadows, we painted the them
with the base color once, which contained the alpha, and then blurred it
and used it as a mask for the fill, which has the fill again.
To fix this, always paint the base surface with full alpha. The existing
code applies the blur conditionally sometimes in weird ways, so the code
shuffling fix may not look correct, but be assured it is. If the blur
happens, the new cr we return has the *default* color applied, which is
fully opaque black, which works perfectly against the A8 surface.
The fallback spinner code needs some modification, since it is
intentionally using the alpha to paint the lobes which are "in the past".
Since we shouldn't be hitting this fallback path very often, we use a
temporary group and paint it with paint_with_alpha, even though it is
slow.
Introduce a new debug category "actions" and write some messages from
GtkActionHelper about if we can find the actions or not.
We will probably soon want to add some similar messages to
GtkMenuTrackerItem.
https://bugzilla.gnome.org/show_bug.cgi?id=733965
This leads to an assertion failure, because parent window is never registered
in the first place, widget's own GdkWindow is. But that window is unregistered
in a generic fashion by GtkWidget code, so there's nothing for us to do here.
https://bugzilla.gnome.org/show_bug.cgi?id=733766
So far, gtk_window_set_focus just did not work when called on
a hidden window. Change it to record the desired focus widget
for hidden windows, and apply it when the window gets shown.
This is similar to how we tread other window properties that
can't be set before the window is realized, like maximized
or fullscreen.
This is related to
https://bugzilla.gnome.org/show_bug.cgi?id=734033
The previous code for computing the clip rectangle forgot to respect
the text-shadow CSS property. This is usually not very visible because
text shadows usually don't extend the ink rectangle by very much.
See attached testcase for an example.
Although there is the "changed" signal, it is more correct to notify the
"text" property too. It can be useful for a small text view, where the
text is saved e.g. to gsettings with a binding to the text property.
The "text" property includes only the text, not child widgets or images,
so the notify signal is sent too many times (also for child widgets and
images), but it's not a big problem.
https://bugzilla.gnome.org/show_bug.cgi?id=624791
Currently, when loading an image from a GResource or file we don't take
the scale factor of the display into consideration, and let
GtkIconHelper scale it accordingly.
While this in general works for non-scalable images, we can take
advantage of the native loader's scaling for e.g. SVG images, and load
them at the right scale factor automatically.
This is achieved by switching to a pixbuf loader instead of using the
native function.
https://bugzilla.gnome.org/show_bug.cgi?id=733416
This allows subclasses to render things below and above the text
in the text view. This allows e.g. GtkSourceView to highlight the
cursor row and to render overlays for colum 80. This used to be done
by rendering before/after chaining up to the parent, but that doesn't
work anymore since the view now renders a background, and due to the
use of the pixel cache.
This reverts commit 1ac13435b7.
We want to instead replace this with special vfunc for drawing
below/above the main text so that gtksourceview can use it.
This was silently broken - the code was just assuming that the
text cell renderer is item no. 6 on the list of all cells. That
doesn't work so well if the cell renderers are set up elsewhere
and get rearranged.
Fix this by keeping an explicit pointer to the the text cell.
For images without a concrete size but with an aspect ratio, we took the
wrong code path.
(I even copied the documentation that said "Otherwise" but didn't put an
else clause there, go me!)
Now that widget paths are allowed to have a state, use that state when
querying style properties. This uses a fast path in gtkcssprovider.c and
that is great.
Header-bar and action-bar buttons used to be bigger then others
now everything is as big as those, maintaining two different sizes
for default widgets depending on the placement is a maintainance
nightmare and having controls the same size is good from a usability
point of view.
The toplevel_window was never set, and the only place where it
was used was causing us to hide tooltips needlessly. So removing
it is a double win.
https://bugzilla.gnome.org/show_bug.cgi?id=733321
Add yet another tab for showing information about a widget that
does not quite fit into any of the other tabs (not a property,
not style information, etc...).
For now, we show the widget state, as well as the default and
focus widget for windows.
GtkArrow is deprecated and is not used internally anymore by the
menu button. Document also the fact that if no direction is specified
then the view-context-menu icon is shown.
https://bugzilla.gnome.org/show_bug.cgi?id=733441
People expect to be able to call gtk_widget_show_all on the dialog
to make action widgets visible, as seen e.g. in
https://bugzilla.gnome.org/show_bug.cgi?id=733431
To keep this working, we can't always set no-show-all on the
action_box. Only set it when the action_area is not used and empty.
The accel label in menus was getting a small allocation that
caused its draw code to always omit the accelerator string.
Fix that by setting halign to fill. To keep the menu label
left-aligned, set xalign to 0 to compensate.
Make gtk_widget_path_append_for_widget() add the state flags of the
widget, too.
This enables the ability to select pseudoclasses on all elements in a
selector.
Don't take a state when constructing the CSS matcher. Instead, rely on
the newly introduced state in the widget path.
This way, the state can be queried not only on the first element, but on
all elements of the widget path.
Set the widget path state flags with the state flags of the style
context.
We do not update the state flags but replace the previous one because we
want to be able to have save()/restore() unset state flags.
Make backdrop insensitive state more similar to the focused
windows one, mostly to make dark variant more usable and
focused -> backdrop transition less distracting.
Add left/right/top/bottom style classes according to which edge(s)
of the progressbar the progress is adjacent to. Only for a fraction
of 1.0 will we set more than one edge.
Don't shadow existing variables. Instead of sharing the allocation and
then overwriting the width/height when convenient, declare it in the
block we use it in, as, really, the three different paths are all
extremely different, and there's no sense in sharing the variable.
We can't avoid calling set_titlebar in buildable_add_child, since
GtkBuilder assumes that it can e.g. call grab_default at the end,
which only works if the widget is inside a toplevel at that point.
Instead, drop the titlebar and clean up priv->headerbar in constructed
if we find that we don't want a headerbar.
find_by_log_attrs() can return true only in this case:
return moved && !gtk_text_iter_is_end (arg_iter);
So if the iter moved (i.e. something has been found), but is the end
iter, find_by_log_attrs() returns false.
Now the same checks are made in find_visible_by_log_attrs(). The public
functions using find_visible_by_log_attrs() say in their documentation
that false is returned for the end iter, hence the check with
gtk_text_iter_is_end().
https://bugzilla.gnome.org/show_bug.cgi?id=618852
attrs[len] is the last PangoLogAttr available, at the iter position after the
last character of the line.
For a line in the middle or the start of the buffer, the '\n' is taken
into account by 'len'. For example the is_word_end is generally reached
before the '\n', not after. But for the last line in the buffer, where
there is no trailing '\n', it is important to test until attrs[len].
The bug didn't occur before because find_by_log_attrs() worked directly
on the iter passed as the function argument. But now it is no longer the
case.
https://bugzilla.gnome.org/show_bug.cgi?id=618852
- Return true (found) and false (not found) explicitly.
- Set found_offset only when something has been found.
find_backward_cursor_pos_func() was a bit different, the while loop had
the condition "offset > 0" but the return was "offset >= 0". Probably a
micro-optimization, since offset == 0 is always a cursor position.
Anyway now the code is the same as the other functions.
https://bugzilla.gnome.org/show_bug.cgi?id=618852
Do not work with the iter passed as the function argument. Work with
another iter, and set it back to the function argument only if something
has been found.
This fixes a few unit tests. But there are regressions for a few others.
https://bugzilla.gnome.org/show_bug.cgi?id=618852
The Adwaita icon theme ships spinners in a scalable directory
with MaxSize=32 and Scale=1. One way to make them scale up in
hi-dpi would be to add an @2 directory with MaxSize=32 and Scale=2,
but that directory would also be consulted in non hi-dpi situations
and give us an effective spinner max size of 64.
Instead, treat svg icons implicitly as hi-dpi, and scale them
up to MaxSize * 2 when in hi-dpi.
This was causing menus to show up in the wrong position in case the menu
popped up towards the top and/or left.
The change to the requisition was in error; it is the allocated size
of the menu, not the toplevel, and doesn't include the shadow.
https://bugzilla.gnome.org/show_bug.cgi?id=591258
This had originally been added to Adwaita in the gnome-themes-standard
commit 7bf01517bc2 but was lost during 3.13 theme changes, causing bug
591258 to reappear.
We now apply the .button style class to rows that are either
activatable or selectable. Selectable rows only get the .button
if the listbox allows selection. This implies that we need to
update row styles when the selection mode changes, or when the
row gets added to a listbox.
Having an explicit property for this will make it easier
to have a hover style only for rows which are activatable
or selectable.
Rows are selectable by default, to preserve compatibility.
It's hard to figure out what the "expected_reply" means except under
close examination -- it's actually talking about whether this was a
reply to a ConfigureRequest or not. The inversion in the check doesn't
help either.
Make the code cleaner by moving it above the freeze/thaw case, and
making the check more explicit and without a confusing variable. If we
haven't sent any ConfigureRequests out, then it must be a gratuitous
ConfigureNotify.