Commit Graph

25579 Commits

Author SHA1 Message Date
Benjamin Otte
f535251507 notebook: Get rid of during_reorder variable
Use operation == OPERATION_REORDER instead.
2016-01-20 17:37:37 +01:00
Benjamin Otte
c162a0cca8 notebook: Properly hide drag window
Move code to properly reinsert the tab label to where it belongs.
The if has the distinction between reparented-to-dnd-window and
just-changed-the-gdk-window-to-draw-to right there.

https://bugzilla.gnome.org/show_bug.cgi?id=760754
2016-01-20 17:37:37 +01:00
Benjamin Otte
099662998a notebook: Get rid of during_detach member
use operation == OPERATION_DETACH instead.
2016-01-20 17:37:37 +01:00
Matthias Clasen
5fd7b85d2b Add a function to get affected area for background
The new function, gtk_render_background_get_clip answers the
question: what pixels are affected if I call gtk_render_background ?

The long-term goal is to have APIs that answer this question for
all rendering primitives.
2016-01-20 09:41:01 -05:00
Ondrej Holy
b2eaed62f6 file chooser: Allow saving even if executable attribute is not set
Commit 8e975b2 (Bug 753969) introduced check of parent accessibility.
Consequently it is not possible to save file if executable attribute
is not set, which might happen for some gvfs backends. Let's assume
that the folder is accessible even if the attribute is not set.

https://bugzilla.gnome.org/show_bug.cgi?id=760881
2016-01-20 14:09:46 +01:00
Benjamin Otte
e3f8316d08 viewport: Don't destroy pixelcache while it's still used
Removing the child unsets the pxielcache's style context...
2016-01-20 05:10:16 +01:00
Benjamin Otte
9cb0a97bb5 viewport: Set the pixel cache background from the child
The viewport itself doesn't move, so we cannot use it as the pixel
cache's background. Use the bottommost using element instead, which is
the viewport's child.

This might need adaptations in themes as we want the backgroud to be
opaque to speed up pixel cache performance.
2016-01-20 04:37:05 +01:00
Matthias Clasen
bb92428112 notebook: Implement rtl flipping for CSS nodes
Use gtk_box_gadget_reverse_children and gtk_css_node_reverse_children
to flip the children of the header_gadget and the tabs_gadget when
appropriate.

Add new CSS node tests to verify that the node order is updated
as expected in all cases.
2016-01-19 21:40:47 -05:00
Benjamin Otte
0304817d81 css: AFFFECTS_TEXT causes a resize, not a redraw
And we schedule the resize conditionally only when text is rendered but
don't do that check for the redraw.
2016-01-20 02:37:45 +01:00
Benjamin Otte
065aa296ed widget: Properly invalidate when CSS font properties change. 2016-01-20 02:19:42 +01:00
Carlos Garnacho
1045dda035 wayland: Implement DnD actions as per wl_data_device v3
Implement as a managed GdkDragContext, which actually fits nicely
with the drag-and-drop model in wayland.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
8d47617623 gtkdnd: Reset widget controllers when starting DnD.
Otherwise there's no full guarantees that this will happen.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
2b703b61cf gtk: Add private gtk_widget_reset_controllers()
This is a one-shot call that can be called on the places we
know we're taking input away.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
e4f5e31b8b gtkdnd: Optionally use gdk_drag_context_manage_dnd()
When this is in use, there's essentially a bunch of dead code here.
When all backends are ported, we'll be able to remove grab/cursor
management plus a bunch of source-side event handlers.
2016-01-19 14:17:35 +01:00
Benjamin Otte
a50baba160 widget: Call gdk_window_mark_paint_from_clip() again
The proper window to call it is the event window, as the call itself
ignores non-native windows anyway.
2016-01-19 14:12:53 +01:00
Marek Černocký
f64bb38aa7 Fixed typo childen->children 2016-01-19 12:52:58 +01:00
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