Commit Graph

26633 Commits

Author SHA1 Message Date
Olivier Fourdan
c134d52dd7 gtkmenu: ignore emulated scroll events
On X11, we get both smooth and emulated scroll events, whereas other
backends such as wayland will give smooth events only with touchpad
scrolling.

Discard emulated scroll events so that we get consistent behaviours
between backends.

Allow for both horizontal and vertical smooth events for scrolling so
that horizontal scrolling still works without emulated scroll events as
well, again for consistency between gdk backends.

https://bugzilla.gnome.org/show_bug.cgi?id=765939
2016-05-10 15:58:02 +02:00
Timm Bäder
20592a7935 scale: Remove double nullable annotation
Being both (allow-none) and (nullable) at the same time is a bit much.
Was from 591e7f5ef8.
2016-05-10 12:53:42 +02:00
Timm Bäder
7116988bcb widget: Add Since annotation to gtk_widget_queue_allocate 2016-05-10 12:53:42 +02:00
Chun-wei Fan
092cb9e202 GTK: Fix build for pre-C99 compilers
Some compilers we support, such as pre-2013 Visual Studio, does not support
for INIFINITY, log2() and exp2(), so check for exp2() and log2() during
configure, and use fallbacks for them and INIFINTY if they are not found.

https://bugzilla.gnome.org/show_bug.cgi?id=766207
2016-05-10 17:14:07 +08:00
Benjamin Otte
732316aca2 scrolledwindow: Remove child before destroying self
Children tend to call back into the scrolled window while being removed
and that doesn't work too well if the scrolled window is destroyed
already as Christian Hergert found out.
2016-05-10 01:00:41 +02:00
Benjamin Otte
0c37b05716 cssimage: Make it possible to shrink builtin check/optionmarks
... below 7px of size.
2016-05-10 01:00:41 +02:00
Emmanuele Bassi
6e2b9a1413 docs: Update examples of matching key bindings
The selector for matching GtkEntry has changed to `entry` after 3.20.

https://bugzilla.gnome.org/show_bug.cgi?id=766166
2016-05-09 12:45:34 +01:00
Georges Basile Stavracas Neto
534ab9a9f0 placesview: update guiding list of protocols
The previous list of protocols in the guidance popover
was suboptimal and needed adjustments.

This commit updates this list to match the latest mockups [1].

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/4847c79ea1aaf75046b3ec5bb1b167ac604d86ed/nautilus/nautilus-next/connect-to-server-wire.png

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-05-08 17:38:49 -03:00
Timm Bäder
1b84d75d10 dialogs: remove 2px border width again 2016-05-08 21:33:53 +02:00
Timm Bäder
fd81e801ab tooltip: Include gtkwidgetprivate.h
That's where gtk_widget_query_tooltip is defined.
2016-05-08 15:52:56 +02:00
Timm Bäder
af49609b8f infobar: Fix typo
Style class names are prefixed with a '.'
2016-05-08 13:58:18 +02:00
Ray Strode
3cba63b2f8 widget: add missing detail to ::query-tooltip emission
This was an oversight in commit dfb368e29bb58b4313b578f0ce75cfc8ead9a1.
2016-05-06 22:31:45 -04:00
Matthias Clasen
ed147c88e1 tooltip: Add a missing *
This was an oversight in the previous commit.
2016-05-06 20:51:25 -04:00
Matthieu Gautier
82aa83b0f6 revealer: emit notify::child-revealed when animation stops
Depending of float rounding during target calculation, the size of the
GtkRevealer can be set to zero will the animation is not finished.
If the GtkRevealer is in a GtkPaned, it will be hidden and so the animation
will be stopped before it is finished.

In this case, force the emission of the child-revealed signal to let
client code know the animation is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=765973
2016-05-06 16:09:12 -04:00
Matthias Clasen
cd581c9e81 Simplify our templates
This is applying the new property name simplification.
2016-05-06 16:09:12 -04:00
Matthias Clasen
3c09783005 Clean up builder parser data after parsing
No need to have these linger around in qdata.
2016-05-06 16:09:12 -04:00
Matthias Clasen
f16e58e9a7 builder tool: Canonicalize property names
When simplifying, convert property names to canonical form,
so we don't waste time while looking them up later.
2016-05-06 16:09:12 -04:00
Lapo Calamandrei
1b8c9de09a Adwaita: darken treeview exapanders 2016-05-06 19:34:12 +02:00
Lapo Calamandrei
55a76cbc31 Adwaita: cosmetic change 2016-05-06 19:01:19 +02:00
Lapo Calamandrei
5f5a02f3e5 Adwaita: relocate a selector
relocate treview acceleditor > label in the treeview section and
add a comment for a testcase.
2016-05-06 19:00:12 +02:00
Matthias Clasen
0f116135f4 Avoid emitting ::style-set by name
GtkStyle is deprecated, but we still emit ::style-set quite
a bit, so lets at least not be slow while doing it.
2016-05-06 10:14:07 -04:00
Matthias Clasen
12dfb368e2 Don't emit ::query-tooltip by name
This signal is emitted quite a bit, and we can easily avoid it.
2016-05-06 10:14:07 -04:00
Matthias Clasen
64710def82 Stop storing has-tooltip in qdata
This is queried quite a bit, and we have room for an extra
bit in GtkWidgetPrivate.
2016-05-06 10:14:07 -04:00
Matthias Clasen
9fac83783c Don't use qdata for getting the default css style
There's no point in using qdata for looking this up, since
we only ever set it on the default screen anyway.
2016-05-06 10:14:07 -04:00
Lapo Calamandrei
1de2f21994 Adwaita: tidy treeview style properties...
...removing a double definition in the process.
2016-05-06 15:36:26 +02:00
Matthias Clasen
b938cfe5be settings: Fix font names *again*
This is the last time, I hope.
2016-05-06 07:08:56 -04:00
Matthias Clasen
ff3264b4c5 widget: Store accessible in GtkWidgetPrivate
Every widget may have one of these, and they are accessed somewhat
frequently.
2016-05-06 06:44:28 -04:00
Matthias Clasen
cb8817f710 Ensure we initialize a quark first
The style function here can also be called before the corresponding
class_init had a chance to create the quark. Fix this.
2016-05-06 06:44:28 -04:00
Matthias Clasen
d91b8c91d3 tooltip: Ensure our quark is not 0
Many of the tooltip functions can be called before a tooltip
object is created, and thus initializing the quark in class_init
is not good enough.
2016-05-06 06:44:28 -04:00
Matthias Clasen
360a3c1690 Use a cheaper way to store settings per display
This was another very frequent use of qdata. Since we typically
have only one or two display objects, storing the display-settings
association in a simple array is faster than using object data
or a hash table.
2016-05-06 06:44:28 -04:00
Matthias Clasen
cca894b912 Use a cheaper way to store debug flags
This was the most frequent use of qdata *by far*.
2016-05-06 06:44:28 -04:00
Matthias Clasen
46edfaa89c Fix indentation mishap 2016-05-06 06:44:28 -04:00
Matthias Clasen
c50e774b29 Fix a typo 2016-05-06 06:44:28 -04:00
Matthias Clasen
27210f523b scale: Fix mark positioning at the left/top edge
We were failing to take the widget allocation.x/y into account
when deciding whether we need to push in the mark.

https://bugzilla.gnome.org/show_bug.cgi?id=765922
2016-05-05 15:17:56 -04:00
Matthias Clasen
6b64c31f6d Generalize the previous commit
Update all xsettings when we get a screen, to prevent similar
problems from occurring in the future.
2016-05-05 14:13:03 -04:00
Matthias Clasen
fe7be14db8 settings: Avoid a crash
Christian Hergert reported seeing webkit crashes with recent
GTK+. The stacktrace points at the CSS machinery calling into
GtkSettings to get the font name, and then getting surprised
by a property notification that triggers style validation.

To avoid this, query the font name xsetting right away when
we get set a screen.
2016-05-05 13:32:58 -04:00
Lapo Calamandrei
870a674283 Adwaita: more flexible headerbar_fill mixin
add an additional background layer as a parameter.
2016-05-05 18:36:03 +02:00
Carlos Garnacho
27c1cce726 searchenginetracker: Quote fts match so it's seen as a single phrase
FTS5 has a complex enough syntax that it makes not much sense to wrap
in simple search boxes.

https://bugzilla.gnome.org/show_bug.cgi?id=765981
2016-05-05 16:40:33 +02:00
Timm Bäder
df38db70a0 label: Also initialize text
So gtk_label_get_text returns the default value of "". Broke the
GtkModelButton default value test.
2016-05-05 11:31:41 +02:00
Timm Bäder
c1d1d46d34 cssgadget: Remove unused function 2016-05-05 11:31:41 +02:00
Timm Bäder
f7e6385506 gtkrender: Remove superfluous cairo_save/restore calls
These were all surrounding functions that either call
cairo_save/cairo_restore themselves or don't need to.
2016-05-05 11:02:06 +02:00
Matthias Clasen
1c4e609750 css node: Stop extraneous change notification
The ::name and ::widget-type properties are entirely independent,
no need to notify both when either changes.
2016-05-04 16:05:40 -04:00
Matthias Clasen
bf66cd1e94 box: Only emit ::child-notify when necessary
We can easily check if the values for expand, padding and so forth
actually changed, so lets do it.
2016-05-04 15:05:08 -04:00
Matthias Clasen
5b19747ef8 Revert "When creating a widget path, use the widget type"
This reverts commit 0d78b67bca.

As Benjamin points out: that'll break all widgets that query style
properties in their init function.
2016-05-04 13:52:22 -04:00
Matthias Clasen
0d78b67bca When creating a widget path, use the widget type
No need to pull the type out of the css node - its our own type.
This will let us stop setting the type on the css node later on.
2016-05-04 13:42:54 -04:00
Matthias Clasen
3ca9a218ec Set the proper state on the css node
This will almost certainly overwritten before the widget gets
to the screen, but while we are doing this, we might as well
use the same state that we initialize the widgets state to.
2016-05-04 13:42:54 -04:00
Matthias Clasen
7df668f2ac css names are always set
No need to check for it, we set the css name on GtkWidgetClass
ourselves.
2016-05-04 13:42:54 -04:00
Timm Bäder
0efe186d95 switch: Remove .slider from slider gadget
As the documentation states, neither the switch nor the slider gadget
should be using any style classes.
2016-05-04 18:55:33 +02:00
Timm Bäder
4ba1f19b03 switch: Create less pango layouts
Instead of creating 2 pango layouts in every draw() and on in
_get_content_size (and calling into gettext twice in both cases), just
keep the layouts around and create them in only one place.
2016-05-04 18:35:30 +02:00
Matthias Clasen
1da048d19a settings: Fix xsettings handling
I was somehow under the misconception that we'd get GdkEventSettings
events for all the xsettings at startup. That is not in general true,
so we need to make sure that we check for the xsettings value before
we use them, or derived fields. Update all the private getters to
do so; and fix settings_update_font_values() to cope with font
descriptions that might miss the family or size.
2016-05-04 11:19:03 -04:00
Matthias Clasen
1d0ba98d5d settings: Ensure derived fields are initialized
I mistakenly assumed that gtk_settings_init was already doing
something to trigger a notify for all properties. It doesn't,
so we have to ensure that settings_update_font_values() is
called at least once.

https://bugzilla.gnome.org/show_bug.cgi?id=765966
2016-05-04 06:28:59 -04:00
Matthias Clasen
449fd4a350 Use g_set_object in one more place 2016-05-03 22:15:17 -04:00
Timm Bäder
944f9d4f28 label: don't use set_text in gtk_label_new
It would just set up lots of things with the default values, but a
common case is that a few gtk_label_set_* calls follow.
2016-05-03 19:26:43 -04:00
Timm Bäder
4ae6f10ae9 label: minimum/natural size parameters are not nullable
Stop comparing them to NULL.
2016-05-03 16:25:57 -04:00
Timm Bäder
e75894da13 label: Don't set out parameters twice
We set them later again when we calculate the vertical size, so just
move the general assignment to -1 into the horizontal branch.
2016-05-03 16:25:57 -04:00
Timm Bäder
cb419794f8 widget: Remove useless NULL check
We are checking for allocation != NULL at the beginning of the function
already. This also means that the allocation parameter is not nullable.
2016-05-03 18:21:33 +02:00
Timm Bäder
71b360cc8e roundedbox: Initialize the hashtable key before using it
In mem_hash, we are iterating over the individual bytes of the key, so
make sure all of it is initialized.
2016-05-03 10:58:02 -04:00
Benjamin Otte
a72c4576b2 cssimagebuiltin: Remove icons that don't draw anything anymore 2016-05-03 12:59:13 +02:00
Benjamin Otte
b049b3de25 cssimagebuiltin: Remove unused variables 2016-05-03 12:59:13 +02:00
Benjamin Otte
2c2c60827e widget: Remove useless comment 2016-05-03 12:59:13 +02:00
Matthias Clasen
be201a5b71 css: Stop drawing double borders for builtins
The fallback code for rendering builtin checks, radios
and expanders was using border parameters. With the generic
gadget borders using the same parameters, this was giving
double borders.
2016-05-02 13:31:59 -04:00
Timm Bäder
38181bc3d2 shadowsvalue: Don't draw invisible box shadows 2016-05-02 19:28:33 +02:00
Руслан Ижбулатов
b579fa82fe Use default VFS, not a local one (it has no network) 2016-05-02 14:45:44 +00:00
Matthias Clasen
9a03fc906a Fix gtk_paned_set_position to set position_set consistently
As pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=765676,
we were failing to set position_set if the position did not change.
2016-05-02 07:42:06 -04:00
Carlos Soriano
ddb0740a21 gtknotebook: avoid tab dnd from content
Before commit 6c1bee2377 we were setting an attribute of GtkNotebook
to track the pressed button if the pressed button happened on the
tab itself.
Later in the motion handling code we were checking whether the private
pressed button attribute was set or not in order to handle a tab dnd
or not.

In commit 6c1bee2377 the code changed and set the pressed button
variable unconditionally, which means, a motion event from within the
tab content triggered a tab reordering.

This happened only if the children hierarchy have a widget that bubbles
up both button press event, which sets the private pressed button
attribute; and motion events, which started the tab dnd checking the
private pressed button attribute.
A widget that experienced the regression was GtkListBox.

In order to fix it, set the button pressed variable only when it press
the tab itself, not the content.

https://bugzilla.gnome.org/show_bug.cgi?id=764395
2016-05-02 13:17:48 +02:00
Руслан Ижбулатов
bab628beb2 GtkPlacesView: check for network:// URI support before using it
Specifically, this URI is not supported on Windows, but GFile will
do its "best" and turn it into GLocalFile("$pwd/network"), with
spectacularly bad results.

https://bugzilla.gnome.org/show_bug.cgi?id=765858
2016-05-01 19:04:18 +00:00
Matthias Clasen
73e799474a dnd: Make sure to free a stashed event
I am not sure if this happens in practice, but better to be safe.
2016-05-01 13:26:35 -04:00
Matthias Clasen
0fe0ee897d gesture: Don't leak stashed events
These events were never freed.
2016-05-01 13:26:35 -04:00
Matthias Clasen
de894f38b5 Fix the build
I forgot to add an include here.
2016-05-01 13:26:35 -04:00
Matthias Clasen
309c6dfaf8 css: Use setters for font size and family
This avoid creating pango font descriptions all the time, when
the gtk-font-name setting hasn't actually changed.
2016-05-01 01:10:59 -04:00
Matthias Clasen
71d6816817 settings: Add setters for font family and size 2016-05-01 01:10:33 -04:00
Matthias Clasen
449732446b treeview: Use getter for gtk-enable-animations 2016-05-01 00:40:23 -04:00
Matthias Clasen
8457dff08a switch: Use getter for gtk-enable-animations 2016-05-01 00:40:08 -04:00
Matthias Clasen
df72478375 stack: Use getter for gtk-enable-animations 2016-05-01 00:39:55 -04:00
Matthias Clasen
5ee745dfee scrolled window: Use getter for gtk-enable-animations 2016-05-01 00:39:34 -04:00
Matthias Clasen
ff0107a4ac Use getter for gtk-enable-animations 2016-05-01 00:39:18 -04:00
Matthias Clasen
9d038df7de popover: Use getter for gtk-enable-animations 2016-05-01 00:39:03 -04:00
Matthias Clasen
417eb0ad9c Use a better hash for arcs 2016-04-30 22:39:58 -04:00
Matthias Clasen
e5de6dd8b1 css: Use a getter for the enable-animations setting 2016-04-30 22:39:58 -04:00
Matthias Clasen
28625c16c0 dnd: Use a getter for the drag threshold 2016-04-30 22:39:58 -04:00
Matthias Clasen
8e62cee075 Add a few settings getters 2016-04-30 22:39:58 -04:00
Matthias Clasen
7afc6b1fd5 settings: Cache xsettings
Instead of calling out to gdk every time an XSetting is requested,
cache the value (we already have the property_values array
anyway).

https://bugzilla.gnome.org/show_bug.cgi?id=765579
2016-04-28 23:29:43 -04:00
Matthias Clasen
2148708917 box gadget: Redo expand flag handling
We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
2016-04-28 21:59:34 -04:00
Matthias Clasen
8a308dd072 expander: Reverse alignments in RTL
Flip alignments of the title gadget children.
2016-04-28 21:59:34 -04:00
Matthias Clasen
8bf148b006 check button: Reverse alignments in RTL
Flip alignments for the box gadget children.
2016-04-28 21:59:34 -04:00
Matthias Clasen
2919e344ca box gadget: allow reversing alignments
In RTL, we want to interpret GTK_ALIGN_START and _END
in the opposite way. Since we don't give gadgets a text
direction, just allow setting an align_reverse flag
to the box gadget.
2016-04-28 21:59:34 -04:00
Lapo Calamandrei
71c1e86e62 Adwaita: refactor levelbar styling. 2016-04-28 15:45:12 +02:00
Matthias Clasen
952d0fd23f window: Stop using gdk_screen_get_n_monitors 2016-04-27 23:18:16 -04:00
Matthias Clasen
03d70f1636 settings: Stop comparing screen numbers
There is only one screen.
2016-04-27 23:18:16 -04:00
Matthias Clasen
f5d6688d3e window: Stop using screen width/height 2016-04-27 23:18:16 -04:00
Matthias Clasen
6ae2c24bde treeview: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
29396a1e5e label: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
e9a58190af combobox: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
b5fb9ae3b7 gtk: Port to new monitor api
Use the GdkDisplay monitor api instead of the GdkScreen one.
2016-04-27 23:18:16 -04:00
Matthias Clasen
1b7d7c857f menu: Add new monitor api
This will work better with the new monitor api in gdk.
2016-04-27 23:18:16 -04:00
Matthias Clasen
3952bd60a5 inspector: Port to new monitor api
Adapt to new monitor apis, and show more information.
2016-04-27 23:18:16 -04:00
Christian Hergert
8fc11ef2a5 Revert "iconhelper: check if surface was invalidated"
This reverts commit 88d0258397.
2016-04-27 19:02:25 -07:00
Руслан Ижбулатов
96c18db0da GtkTreeView: change child repositioning to preserve locality
If there was a piece of text in the cell, then when the edit
entry is shown for that cell, it should have a piece of text
in it roughly at the same location.

Therefore, when child widget is enlarged (child preferred
size exceeds cell size), extra width should be added by
extending either left or right edge depending on text direction.

If after that the child sticks outside of the treeivew visible region,
try to push it back inside (breaking its alignment with the
cell), again, giving preference (i.e. adjusting it last)
to either left or right edge depending on text direction.

https://bugzilla.gnome.org/show_bug.cgi?id=765471
2016-04-28 01:35:46 +00:00
Christian Hergert
88d0258397 iconhelper: check if surface was invalidated
Fetching the style may cause the surface to be invalidated.
2016-04-27 17:45:01 -07:00
Lapo Calamandrei
0d55542359 Adwaita: add a background to cellrendertext 2016-04-27 20:05:44 +02:00