Commit Graph

41174 Commits

Author SHA1 Message Date
Matthias Clasen
c5b7f9f11c inspector: Make sure something is focusable on the stats page
Without this, the focus will not be inside the top_stack when
we switch to the statistics page and it shows the excuse. This
in turn will make the next page not take focus as expected when
switching away from the statistics page again.
2014-12-10 22:41:45 -05:00
Matthias Clasen
18799d22cf inspector: Fix focus in css editor
Give the text view initial focus, so things work as expected
when switching to the css editor for the first time.
2014-12-10 22:39:50 -05:00
Matthias Clasen
123c6dc558 GtkStack: Improve focus handling
Add notebook-like focus handling: Keep track of the last focused
descendent of each page, and focus it again when switching back
to the page. If there is no last focused child, we move the focus
into the page as if the user had hit Tab.
2014-12-10 22:32:45 -05:00
Matthias Clasen
5dd6ad0057 Typo fix 2014-12-10 21:08:08 -05:00
Matt Watson
f50d1b2584 GtkEntryCompletion: fix sizing bug with multiple cells
When using a completion with some custom cells in the cell layout,
if would often size wrong when first presented on screen.

The entry completion is the only place in the entire gtk code base
that calls gtk_tree_view_column_cell_get_size outside of gtktreeview
itself. It calls into the function before the tree view has done some
important validation on its cell state, the net result of which is
only the first element in the gtkcellareabox the entry completion uses
well actually have its size respected.

We now call gtk_widget_get_preferred_size on the tree view before
calling into the individual cell size routines, to guarantee that the
tree view has run its validate_rows routine and cell state is valid.

https://bugzilla.gnome.org/show_bug.cgi?id=741130
2014-12-10 13:29:32 -08:00
Matthias Clasen
a083809b93 GtkScrolledWindow: Take border into account
Use the new scrollable API for getting non-scrollable borders
and draw over/undershoot at the right place. In practice, this
means that they now appear below treeview headers.
2014-12-10 10:01:30 -05:00
Matthias Clasen
9431050618 GtkTreeView: Implement get_border
Add an implementation for the new scrollable vfunc that returns
the header height as top border.
2014-12-10 10:01:30 -05:00
Matthias Clasen
6f2fff56fb Add a gtk_scrollable_get_border
Add a vfunc to return a non-scrollable border around scrollables.
This would be nicer as a property, but we can't add properties
to an interface without breaking 3rd party implementations, so
make this an optional vfunc, and handle it not being set.
2014-12-10 10:01:30 -05:00
Matthias Clasen
691c96db2a Adwaita: Initial theming for scrollable indication
This just uses a narrow shadow for now.
2014-12-10 10:00:45 -05:00
Matthias Clasen
b73578f95d Add a scrollable indication
Draw a themable indication when an edge of a scrolled window
is hiding some content that can be scrolled in.
2014-12-10 10:00:21 -05:00
Matthias Clasen
45d0a5cc4b Trivial formatting fix
&& goes at the end of the line in GTK+ coding style.
2014-12-09 23:41:28 -05:00
Matthias Clasen
8463d0ee62 GtkMenuPositionFunc: Correct annotations
x and y are inout, not just out.

https://bugzilla.gnome.org/show_bug.cgi?id=674537
2014-12-09 22:56:39 -05:00
Benjamin Otte
b49c7c3421 styleprovider: Fold get_change() vfunc into lookup() 2014-12-10 03:49:40 +01:00
Benjamin Otte
14f5ce7108 cssselector: Rewrite change computation
We know that non-simple selectors cause a transition to the all matcher,
so just assume the all matcher from that point on.
2014-12-10 03:49:40 +01:00
Benjamin Otte
e2dddd62cf cssselector: Redo change verification
Instead of walking the selector tree, we walk the selectors.
2014-12-10 03:49:40 +01:00
Benjamin Otte
5885950018 cssselector: Implement tree_match() using foreach_matcher() 2014-12-10 03:49:40 +01:00
Benjamin Otte
ad74fd9d7f cssselector: Introduce a foreach_matcher vfunc
This vfunc iterates over all matchers of a selector and allows to write
functions like the match function in a generic way using foreach.
2014-12-10 03:49:40 +01:00
Benjamin Otte
8a8f34b2db cssselector: Add a match_one vfunc
It allows a default implementation of the match() and tree_match()
functions.
2014-12-10 03:49:40 +01:00
Benjamin Otte
cab05f2b63 cssselector: Introduce a few more default functions 2014-12-10 03:49:40 +01:00
Benjamin Otte
06b0b47d04 cssselector: Make specificity handling a vfunc
The new region selector tracks more than just one soimple selector, so
it requires some more advanced specificity tracking.

Technically, this is still not correct, because it will report the same
specificity for
  tab:sorted
and
  tab:sorted:sorted
(and the second selector will be printed as the first) but this is
regions, so meh.
2014-12-10 03:49:40 +01:00
Benjamin Otte
371a601858 cssselector: Remove unused variable
The variable is FALSE for every class now.
2014-12-10 03:49:40 +01:00
Benjamin Otte
73823181d3 cssselector: Handle region selector like any selector
Instead of doing the previous match magic itself, use the
DESCENDANT_FOR_REGION hack and let that one do the magic.
2014-12-10 03:49:40 +01:00
Benjamin Otte
284ccdac45 cssselector: Use simple class macro for * selector
As a side effect, the :not(*) selector needs to be renamed because the
macro chooses a different name for it.
2014-12-10 03:49:40 +01:00
Benjamin Otte
528691f5b3 cssselector: Introduce descendant matcher for regions
This is just a way to handle regions more conveniently. What this does
is to change the descendant matcher into a maybe-descendant matcher
whenever the current object we're parsing might be a region. Because "*"
might also refer to a region and not just a new element.

See testsuite/reftests/css-match-region-matches-star.ui for a testcase.
2014-12-10 03:49:40 +01:00
Benjamin Otte
8b3f25ab96 cssselector: Support :not() for position pseudoclasses
This is simple now that the latest commit used the macro and
autogenerates the SelectorClass to use.
2014-12-10 03:49:40 +01:00
Benjamin Otte
88f28aee4f cssselector: Use simple macro for position pseudoclass
This is possible now that the region-specific code is gone.
2014-12-10 03:49:40 +01:00
Benjamin Otte
28e80aa40b cssselector: Handle region flags during parse
When parsing a selector like
  tab:active
We used to create 2 selector objects, one for the region, and one for
the pseudoclass. Now, for convenience, we special-case region
pseudoclass parsing so that the active flag is added to the region
selector.

A side effect is that ":nth-child(1)" no longer works for regions.
Hopefully people didn't use this but used the saner ":first-child"
instead.
2014-12-10 03:49:40 +01:00
Benjamin Otte
272a0083a3 cssselector: Turn into a union
Instead of just keeping a gpointer data, make GtkCssSelector a union
that has actual proper members.
2014-12-10 03:49:39 +01:00
Benjamin Otte
03aabcff14 cssselector: Introduce a hash func per selector
This is unnecessary itself, but useful in preparation for further
commits.
2014-12-10 03:49:39 +01:00
Benjamin Otte
80a8b793e0 cssselector: Inline a function 2014-12-10 03:49:39 +01:00
Matthias Clasen
972ea14ef6 GtkStackSwitcher: Don't take focus on click
Moving the focus to the stack switcher buttons is
never what is wanted here.
2014-12-09 20:57:58 -05:00
Matthias Clasen
cf4afd0e93 inspector: Don't force-switch to the objects tab
We used to switch to the objects tab when an object is
picked, but now may have two places with picker buttons:
the objects tab and the interactive tab.

So, just don't do that anymore.
2014-12-09 20:57:58 -05:00
Matthias Clasen
702b647d4e inspector: Allow extensions to request a picker
Look for a 'use-picker' property on the extension page
and add a picker button to the header bar if says so.
2014-12-09 20:57:51 -05:00
Matthias Clasen
44bf61baac inspector: Another indentation fix 2014-12-09 19:23:54 -05:00
Matthias Clasen
536b10800f inspector: Reindent ui file 2014-12-09 17:49:23 -05:00
Matthias Clasen
1ed5bd07bb Make gtk_tree_model_foreach robust
Make gtk_tree_model_foreach safe for callbacks that modify
the model, even if the model does not have persistent iters.

https://bugzilla.gnome.org/show_bug.cgi?id=722781
2014-12-09 00:42:40 -05:00
Matthias Clasen
54e3711c39 Don't compare booleans
Just use negation.
2014-12-09 00:42:40 -05:00
Christian Hergert
fb8791cd16 window: fallback to window muxer if no widget has focus
This ensures that we can still match accelerators for the window even
if no widget currently has focus.
2014-12-08 20:19:33 -08:00
Carlos Soriano
235837ad49 gtkwindow: Use actions from focused widget to activate accel
Currently we only take into account the window GActionGroup for
activating the accels.

However, the application could have some custom GActionGroup in the
chain of focused widgets that could want to activate some action if
some accel is activated while that widget is focused.

To allow applications to set accels on widgets that use custom
GActionGroups, simply use the muxer of the focused widget, which
already contains the actions of the parents.

https://bugzilla.gnome.org/show_bug.cgi?id=740682
2014-12-08 20:19:33 -08:00
Matthias Clasen
17fec70022 Fix another header guard oversight
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741252
2014-12-08 19:34:23 -05:00
Matthias Clasen
4f96353964 Fix some oversights with header guards
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741254
2014-12-08 19:31:56 -05:00
Alexander Larsson
2d6ae59d7f Inspector: Support extending the inspector using GIOModules
This allows external modules to add a page to the Gtk Inspector.

https://bugzilla.gnome.org/show_bug.cgi?id=740983
2014-12-08 17:34:54 -05:00
Matthias Clasen
eed1831caf Trivial off-by-one fix
We have a tenth example.
2014-12-08 17:30:35 -05:00
Matthias Clasen
6c7e5039c7 Drop a few unneeded ifs
It does not hurt to pass NULL to g_list_free().
2014-12-08 17:30:35 -05:00
Muhammet Kara
5047d503f3 Updated Turkish translation 2014-12-08 19:38:02 +00:00
Muhammet Kara
2a13869236 Updated Turkish translation 2014-12-08 19:20:34 +00:00
Matthias Clasen
64fd964703 GtkWidget: Don't return FALSE as a pointer
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741251
2014-12-08 09:16:24 -05:00
Matthias Clasen
a3e37abb38 GtkPlacesSidebar: Don't return FALSE as a pointer
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741250
2014-12-08 09:15:07 -05:00
Matthias Clasen
a3fbf29f17 GtkMenuTracker: Don't return FALSE as a pointer
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741249
2014-12-08 09:13:57 -05:00
Matthias Clasen
8c3f04e754 GtkEntry: Refresh when activity ends
We need to queue a redraw when pulse mode is ended by
setting a fraction. Noticed in gtk3-demo's search entry demo.
2014-12-08 06:39:56 -05:00