Commit Graph

32163 Commits

Author SHA1 Message Date
Emmanuele Bassi
59c6862a03 Use gtk_widget_class_set_layout_manager_type()
Instead of manually creating the layout manager inside the instance
initialization function, we can let GtkWidget do that for us.
2019-05-06 12:06:27 +01:00
Emmanuele Bassi
c6b2184aa0 Allow specifying the layout manager for a widget type
Some widgets have a well-defined layout manager created alongside their
own instance; if they do, we can handle the layout manager creation at
the GtkWidget instantiation.
2019-05-06 11:57:32 +01:00
Benjamin Otte
562e492056 csstokenizer: Consume the \ when encountering an error
Otherwise we infinitely end up with the error again.

Testcases added.
2019-05-06 05:56:06 +02:00
Matthias Clasen
15b8ee4564 Merge branch 'simplify-tests' into 'master'
Simplify tests

See merge request GNOME/gtk!820
2019-05-05 20:19:13 +00:00
Matthias Clasen
d8e92d4859 builder-tool: Handle layout properties more properly
Change things so we first rewrite the whole tree,
and then simplify the rewritten tree. And look
for paramspecs for layout properties.
2019-05-05 17:13:38 +00:00
Matthias Clasen
4eb00a3e41 builder-tool: Stop warnings for stack rewrites
When rewriting a GtkStack from 3 to 4, we were emitting
warnings for missing child properties. Stop doing that.
2019-05-05 17:13:38 +00:00
Matthias Clasen
84d3848c01 Merge branch 'focus-fixes' into 'master'
Focus fixes

See merge request GNOME/gtk!819
2019-05-05 14:20:04 +00:00
Matthias Clasen
c4013eeb26 Merge branch 'builder-tool-fixes' into 'master'
Builder tool fixes

See merge request GNOME/gtk!817
2019-05-05 06:57:21 +00:00
Matthias Clasen
96cce3ae23 Merge branch 'emoji-chooser-fixes' into 'master'
Emoji chooser fixes

See merge request GNOME/gtk!816
2019-05-05 06:41:31 +00:00
Matthias Clasen
09b6dbb7ef builder-tool: Handle default values changing
The default value of GtkWidget::visible changed
from FALSE to TRUE from GTK 3 to 4. Make --3to4
deal with this by ensuring the visible property
is explicitly set, before simplifying.
2019-05-04 23:41:30 -07:00
Benjamin Otte
6594ccf716 gsk: Export gsk_gl_renderer_new() 2019-05-05 07:18:39 +02:00
Benjamin Otte
3c6aa84e44 cssparser: Add gtk_css_parser_has_number() 2019-05-05 07:18:39 +02:00
Matthias Clasen
44b0a893fc entry: Drop our own Emoji chooser
We were using one Emoji chooser when triggered
via the context menu, and another one when
triggered via the icon.

Change things to always use the same Emoji
chooser instance.
2019-05-04 18:54:37 +00:00
Matthias Clasen
32fd55a66d window: Stop duplicating focus change events
We had code in gtkwindow.c that generated duplicate,
and defective, focus-change events, in the following
way:
- gtkmain.c generates a chain of focus-change events
  for moving focus from one window to another
- gtkwindow.c catches a focus-in event in the middle
  of this chain and sets itself as 'active'
- and then it proceeds to generate focus-change
  events towards its own focus widget without a
  related target
This is not necessary since we gtkmain.c already
generates a complete sequence of focus-change events.
So stop doing it.
2019-05-04 18:22:33 +00:00
Matthias Clasen
9af01bea5e window: Make _gtk_window_set_is_active static
It is not used outside gtkwindow.c.
2019-05-04 18:22:28 +00:00
Matthias Clasen
40fe3d94ac builder-tool: Handle GtkWidget::visible properly
This property has a 'smart' default that depends
on the class of the object we're creating. Take
that into account when deciding whether to omit
properties that are set to their default value.
2019-05-04 18:18:42 +00:00
Matthias Clasen
6fe203d0e2 emoji chooser: Make Escape work again
Escape is expected to close the Emoji chooser.
2019-05-04 18:18:20 +00:00
Matthias Clasen
7b6f652630 emoji chooser: Fix handling of no recent Emoji
If the recent section is empty, we want to hide
it, make its button insensitive, and select the
next section, initially. This was not working
properly, since nothing was ever setting the
section box to invisible.
2019-05-04 18:18:09 +00:00
Matthias Clasen
67e6d1087e emoji chooser: populate incrementally
It takes half a second on my system to initially
populate the Emoji chooser. That is too long. Do
the work in 8 millisecond chunks to give GTK a
chance to get some frames done.
2019-05-04 02:12:02 +00:00
Timm Bäder
d702bfe7b7 filechooserbutton: Clean up finalize & destroy 2019-05-03 20:06:25 +02:00
Timm Bäder
596c9a3c0b filechooserbutton: Clear model in destroy()
Since we're destroying priv->chooser right after. We can't wait until
finalize() since clearing the model will try to work with priv->chooser.
2019-05-03 20:06:23 +02:00
Timm Bäder
c675d1c9e1 filechooserbutton: Use a bin layout 2019-05-03 20:06:10 +02:00
Matthias Clasen
1c9a486d60 css: Use multiple font-family values
Pango API to support this, so we can implement
this very easily.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1854
2019-05-03 01:44:02 +00:00
Matthias Clasen
299422994a fixup! event controller: Don't deliver events to insensitive widgets 2019-05-02 20:20:20 +00:00
Matthias Clasen
b1d90cc171 spin button: Listen for ::cancel on gestures
Otherwise, we keep spinning when we should stop.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1861
2019-05-02 15:54:17 -04:00
Matthias Clasen
af2207bc0b widget: Reset controllers when going numb
Reset event controllers when their
widget is going insensitive. This is
the expected behavior.
2019-05-02 15:53:30 -04:00
Matthias Clasen
522bbc182d gesture: Chain up in filter_event
This is the right thing to do.
We want to exclude more events.
2019-05-02 15:53:30 -04:00
Matthias Clasen
65233726f8 event controller: Don't deliver events to insensitive widgets
This is another way to avoid delivering events
to insensitive widgets.
2019-05-02 15:50:44 -04:00
Matthias Clasen
ed52c029a0 gtk: Small documentation fixes 2019-05-01 23:24:14 -04:00
Matthias Clasen
7b1201cd4d box layout: Documentation additions 2019-05-01 23:24:14 -04:00
Matthias Clasen
eff4b6377d Merge branch 'inspector-menus' into 'master'
inspector: Fix showing of menus

See merge request GNOME/gtk!810
2019-05-02 02:12:28 +00:00
Matthias Clasen
a18647af0e Merge branch 'inspector-actions' into 'master'
inspector: Show the default.activate action

See merge request GNOME/gtk!809
2019-05-02 02:09:03 +00:00
Matthias Clasen
c7df0c907a inspector: Fix showing of menus
We were hitting an assertion in some leftover
code that assumed property editors are popovers.
2019-05-02 02:05:46 +00:00
Matthias Clasen
b74407a343 Merge branch 'filechooser-save-again' into 'master'
Make file chooser saving work again

See merge request GNOME/gtk!808
2019-05-02 01:55:28 +00:00
Matthias Clasen
cd5c39834d inspector: Show the default.activate action
We were hardcoding that GtkApplicationWindow only
has a single action group with prefix 'win', but
that is no longer the case. Simply use the code
for the general widget case that can handle multiple
action groups.
2019-05-02 01:53:57 +00:00
Matthias Clasen
6e0b13b81f Make file chooser saving work again
I was a little overzealous when going
for the new default handling here. We
can't switch to gtk_widget_activate_default
before we actually handle the default.activate
action.
2019-05-02 01:41:23 +00:00
Matthias Clasen
bea8025fb5 Drop the GtkWidget::display-changed signal
Display changes now happen exclusively through
the ::root and ::unroot vfuncs. Third parties
can observe display changes by listening
for notify::root.
2019-05-02 01:33:41 +00:00
Matthias Clasen
965d0e04d1 gtk: Use root/unroot instead of display-changed
The display-changed signal is going away
2019-05-02 01:33:41 +00:00
Matthias Clasen
d7c54920ee menu: Listen only for notify::root
We no longer emit the display-changed signal,
so stop listening.
2019-05-01 23:05:09 +00:00
Matthias Clasen
33a8108f19 window: Implement display change via root/unroot
Export gtk_widget_root/unroot privately,
make them work on roots, and use them in
gtk_window_set_display. This gets us to a
single way to listen for display changes,
the root property.
2019-05-01 23:05:09 +00:00
Matthias Clasen
78d254370c Merge branch 'inspector-menu-fix' into 'master'
Inspector menu fix

See merge request GNOME/gtk!804
2019-05-01 23:01:50 +00:00
Matthias Clasen
377ec33069 menus: Fix menus on non-default displays
Currently, we sometimes emit display-changed
when the display changed, and sometimes we don't
since the display is changed via gtk_widget_root.

Listen for notify::root as well and update our
display. This is a temporary fix - all display
changes should go through gtk_widget_root,
eventually.
2019-05-01 22:50:29 +00:00
Matthias Clasen
62b7ea7611 Remove gtk_menu_set_display
Menus should always be attached to a toplevel,
in which case they get their display that way.
2019-05-01 21:54:57 +00:00
Matthias Clasen
d53981fdbb Merge branch 'add-color-button-fix' into 'master'
Adwaita: Fix 'add color' button corners

Closes #1856

See merge request GNOME/gtk!801
2019-05-01 17:26:34 +00:00
Matthias Clasen
e09beee62a Adwaita: Fix 'add color' button corners
The specification for border-radius goes
top-left top-right bottom-right bottom-left.
The css for the add button in the color
chooser got this wrong, and was showing
a broken top-right corner.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1856
2019-05-01 17:18:39 +00:00
Rico Tzschichholz
724ec3ca92 Add a few placeholder documentation block to have g-i annotations 2019-05-01 15:03:16 +02:00
Matthias Clasen
e41596d6a1 text: Make Emoji insertion work properly
We are now getting focus-out and focus-in events
when the Emoji chooser is shown and hidden, and
this is causing the text to select-on-entry before
inserting the Emoji, which then deletes the selection.

Avoid this by saving and restoring the selection
when presenting the Emoji chooser.
2019-05-01 05:13:52 +00:00
Matthias Clasen
0fa4d54316 inspector: Track readonly property values
That a property can't be set does not mean
its value can't change. This was showing up
as the cursor-position and selection-bound
properties in GtkText not showing their
current value in the inspector.
2019-05-01 04:57:54 +00:00
Matthias Clasen
e7cbb7a76c inspector: Don't listen for notify twice
The property list now uses property editors
for the value, which listen for updates by
themselves, so no need for the list to do it.
2019-05-01 04:44:07 +00:00
Matthias Clasen
b2a23a9a90 entry: only notify properties we have
GtkText now has the propagate-text-width property,
which is not present on GtkEntry, so we can't just
blindly forward all properties.
2019-05-01 04:41:28 +00:00