Commit Graph

25563 Commits

Author SHA1 Message Date
Benjamin Otte
409760babf container: Properly reorder no-window children
... that are setup with gtk_widget_set_parent_window().

Fixes scrollbars not being drawn in GtkScrolledWindow.
2016-01-19 04:33:09 +01:00
Benjamin Otte
ab5dbfd1f1 widget: Add forgotten push_group code
... and remove the also forgotten void function that lingered around
with it.

Fixes opacity=0 parts like inactive spinners or sort indicators in
treeview headers being drawn since last commit.

Oops.
2016-01-19 04:24:32 +01:00
Benjamin Otte
580ea227a6 widget: Redo drawing code
Previously, we had a special cae to draw subwindows of widgets.

This is not necessary as conformant widgets should be able to properly
render themselves when all windows need to be painted.
From now on assume that is the case.

We therefore paint nonnative GDK windows "inline" by just returning TRUE
for gtk_cairo_should_draw_window() for those windows.

This speeds up hilighting different rows in the listbox gtk-demo example
tremendously (by a factor of 10 or more) as the previous code was
O(<number of non-window subwidgets> *
<number of subwindows>) which in the listbox example were ~15,000 and
~2,000 respectively.
2016-01-19 03:45:27 +01:00
Benjamin Otte
402cecf9a2 actionbar: Don't forall() widgets twice
When using forall(), only list the revealer, which lists the box
containing all the children. When using foreach(), bypass revealer and
box and list all children added to the box.
2016-01-19 03:45:26 +01:00
Matthias Clasen
1821c2df60 text view: Expose cursor blink control
Derived classes like GtkSourceView with their own ::key-event
handler need access to this, in order to make their keynav
as nice as the builtin one, wrt to caret visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=760748
2016-01-18 16:27:43 -05:00
Peter Hutterer
48aa1bb08f wayland: add gdk_event_is_scroll_stop_event()
And use it to handle kinetic scrolling in the GtkScrolledWindow.

However, dropping the delta check causes the X11-based kinetic
scroll to break since we don't have the stop event here. Correct handling of
xf86-input-libinput-based scroll events is still being discussed.

https://bugzilla.gnome.org/show_bug.cgi?id=756729
2016-01-18 21:36:23 +01:00
Matthias Clasen
ac95bac5b8 Drop a reference to regions
Regions don't work anymore, so don't recommend them in the docs.
2016-01-18 14:31:37 -05:00
Matthias Clasen
b3b048906c im context simple: Protect shared data structures
Since a41f02f9b1, GtkIMContextSimple
uses threads to load X Compose files. It does that every time a new
im context object is initialized, so we can easily end up with multiple
threads accessing the shared global_tables list at the same time.

Use a lock to prevent that.

https://bugzilla.redhat.com/show_bug.cgi?id=1276432
2016-01-18 13:57:39 -05:00
Benjamin Otte
e150ea85bb cssnode: Don't leak the style cache on destruction 2016-01-18 18:06:41 +01:00
Matthias Clasen
ff5d14f1a8 text view: Update selection node visibility
Make the node invisible if we don't have a selection.
2016-01-18 11:05:53 -05:00
Matthias Clasen
b08fe985cc entry: Expand the css node docs
Mention the context menu.
2016-01-18 10:52:26 -05:00
Matthias Clasen
07eda5920f text view: Expand CSS node docs
Mention the selection node, and the context menu.
2016-01-18 10:51:54 -05:00
Benjamin Otte
3281d1a284 notebook: Don't crash when dnd'ing tabs out
https://bugzilla.gnome.org/show_bug.cgi?id=760754
2016-01-18 15:39:02 +01:00
Benjamin Otte
eca1b3cba3 accellabel: Remove unused variable 2016-01-18 15:39:02 +01:00
Timm Bäder
d73f6b8c50 entry: Deprecate shadow-type
Things like that should be handled using css. Also, the property value
is unused inside GtkEntry.
2016-01-18 12:53:53 +01:00
Matthias Clasen
2a665715b6 expander: Flip the alignment of the vertical box
To ensure that the title moves to the other side as expected
in RTL, use GTK_ALIGN_START/END instead of GTK_ALIGN_FILL
when packing the title gadget into the vertical box, and
flip the alignment when the text direction changes.
2016-01-18 00:19:31 -05:00
Matthias Clasen
296f80a580 expander: Handle rtl changes again
Now that the box gadget has api for it, use it here to
change the order of the gadgets for right-to-left.
2016-01-18 00:11:54 -05:00
Matthias Clasen
a32b39c60f checkbutton: Handle rtl changes again
Now that the box gadget has api for it, use it here to
change the order of the gadgets for right-to-left.
2016-01-18 00:11:50 -05:00
Matthias Clasen
5265db5dd6 box gadget: Add a function to reverse children
This can be used to handle text direction changes.
2016-01-18 00:03:39 -05:00
Matthias Clasen
7859f8ee91 checkbutton: Use a box gadget
Now that builtin icons have a baseline, we can just use
a box gadget with baseline alignment for the indicator
and the label.
2016-01-17 21:16:33 -05:00
Matthias Clasen
da30858ee4 builtin icon: set a baseline
Most uses of builtin icons (check and radio buttons,
expanders, etc) are placed next to labels, so they should
be properly positioned wrt to the baseline. Lacking anything
better, give the builtin icons a baseline that places the
center of the icon at the strikethrough position.
2016-01-17 21:02:18 -05:00
Matthias Clasen
9c3907dab0 box gadget: Deal with optional arguments
The baseline arguments to the preferred size callback can
be NULL. Don't crash if they are.
2016-01-17 19:48:40 -05:00
Matthias Clasen
44d94a4aeb Trivial formatting fix 2016-01-17 15:35:14 -05:00
Matthias Clasen
a7387e2641 Document restrictions on gtk_style_context_get
This makes it official that passing a different state
is not generally supported in the getters for CSS properties.
2016-01-17 15:31:37 -05:00
Matthias Clasen
6bf9715ce4 notebook: show tabs when asked to
gtk_notebook_set_show_tabs must make the header gadget
visible when show_tabs is TRUE, not the other way around.

https://bugzilla.gnome.org/show_bug.cgi?id=760596
2016-01-17 14:35:58 -05:00
Matthias Clasen
9e2a1685c5 accel label: Fix RTL handling
The 'mad hack' that GtkAccelLabel used to affect the GtkLabel
draw function broke with the introduction of gadgets, since
the positioning is no longer relative to the widgets' allocation
at the time of the call, but rather to the gadgets allocation.

Instead of coming up with an even madder hack to keep this
working, give the GtkLabel draw function knowledge about accel
labels.

https://bugzilla.gnome.org/show_bug.cgi?id=760663
2016-01-17 14:08:22 -05:00
Matthias Clasen
d28959c6db inspector: Make cursor-size combo wider
Cursor sizes typically have 2 digits, lets not clip them.
2016-01-17 13:23:49 -05:00
Matthias Clasen
00aca5d689 Expand window style class documentation a bit 2016-01-17 12:13:59 -05:00
Matthias Clasen
9d26038a10 Adwaita: Keep entry progress visible
When the entry is focused, make the progress one pixel wider
so it doesn't get swallowed by the focus outline.
2016-01-16 19:23:26 -05:00
Benjamin Otte
6e6cbd7316 stylechange: Do the right thing when old and new style are equal
We don't need to compare all their CSS values to figure out that nothing
changed. We know that.
2016-01-16 23:58:37 +01:00
Benjamin Otte
c904efef53 cssnode: Redo GTK_DEBUG=no-css-cache
Previously this setting would just invalidate the whole CSS tree and
thereby hopefully avoid all cache usage.

Now, we actually don't cause extra invalidations anymore, but instead
avoid ever inserting anything into the cache when this setting is set.
2016-01-16 23:58:37 +01:00
Benjamin Otte
024429f76f cssnode: Implement the style cache
This essentially copies the previous cache implementation. With one
caveat: It is now attached to and maintained by the CssNode, not by the
CssStyle.

And this is important because styles may be reused in incompatible
situations which would cause cache collisions and lead to broken CSS in
weird situations.
2016-01-16 23:58:37 +01:00
Benjamin Otte
5d562b6a2a cssnode: Split out the style cache
For now, the split out style cache doesn't cache anything. This is
mostly to make sure that bisections of wrong caching behavior will
bisect down to the commit that actually adds caching.
2016-01-16 23:58:37 +01:00
Lapo Calamandrei
93f8fa7576 Adwaita: stop axing toolbar separators 2016-01-16 04:16:55 +01:00
Lapo Calamandrei
d0f83d46a0 Adwaita: style textview derived widgets 2016-01-16 04:15:30 +01:00
Matthias Clasen
e7fc87e4ac color scale: Improve themability
Add the .color class, so themes can style scale.color.
Clip the trough rendering to the content path, so that
themes can set rounded corners.
2016-01-15 20:08:57 -05:00
Matthias Clasen
a0d91a3a71 treeview: Use foreground color to draw dnd marker
This is still not perfect, but makes the dnd marker better visible
in HighContrastInverse.
2016-01-15 19:39:12 -05:00
Matthias Clasen
2cf810c4c9 frame: Don't overlap label and child
We didn't do this previously, so don't start now.

https://bugzilla.gnome.org/show_bug.cgi?id=760528
2016-01-15 19:16:23 -05:00
Lapo Calamandrei
f32e1d42e6 Adwaita: combo style cleanup and fixes
fixes https://bugzilla.gnome.org/show_bug.cgi?id=760524
2016-01-16 01:03:08 +01:00
Matthias Clasen
e8b9aacfc1 combo: Add .linked class when appropriate
Add the .linked style class to combo boxes which have
an entry, since that is what they are.
2016-01-15 17:55:44 -05:00
Matthias Clasen
54a6e032ca combobox: Document the popup window CSS node 2016-01-15 17:48:39 -05:00
Matthias Clasen
0049be4e58 application: Protect against double shutdown
It is not something that can happen normally.
But if it does, we shouldn't crash.

https://bugzilla.gnome.org/show_bug.cgi?id=760680
2016-01-15 17:37:55 -05:00
Matt Watson
d8bb228d3b widget: remove queue_resize in set_sensitive
Calling gtk_widget_propagate_state is enough to queue a resize if
needed

See da7a4089fe
2016-01-15 11:07:47 -08:00
Lapo Calamandrei
04f6f38b56 Adwaita: remove messagedialog label squashing hack
since Matthias fixed this properly.
2016-01-15 18:37:49 +01:00
Matthias Clasen
78162c5e88 message dialog: Prevent empty title from being shown
We don't want to grow the titlebar by showing an empty label.
2016-01-15 11:59:33 -05:00
Lapo Calamandrei
fc804bba2d Adwaita: some dialog love
addresses https://bugzilla.gnome.org/show_bug.cgi?id=760525
2016-01-15 17:57:25 +01:00
Matthias Clasen
6d18b77ca7 expander: Destroy gadgets after child widgets
With child widgets now being sorted into box gadgets, bad things
happen if those gadgets disappear prematurely.
2016-01-15 10:30:08 -05:00
Benjamin Otte
6e4d65d227 notebook: Destroy gadgets after chaining up
While chaining up, we might still call into the notebook code. And that
code expects the gadgets to be there.

https://bugzilla.gnome.org/show_bug.cgi?id=760640
2016-01-15 16:22:22 +01:00
Matthias Clasen
2e27c0af25 expander: Convert to use box gadgets
Use a vertical box gadget for the overall expander, and a
horizontal one for the title row. This lets us get rid of
all the custom allocation code here.
2016-01-15 09:43:51 -05:00
Matthias Clasen
5f5dc10820 expander: Deprecate spacing property
The same can be achieved with margins on the child, and
the spacing property gets in the way of converting the
expander to use box gadgets.
2016-01-15 09:43:51 -05:00