Commit Graph

22419 Commits

Author SHA1 Message Date
Carlos Garnacho
dca2f4386d gesturesingle: check for the sequence being handled, not just the event
Checking the return value was valid for most gestures, but
GtkGestureLongPress, where the first press triggers internally an action,
but does nothing for the sequence to be claimed/denied, FALSE was eventually
returned, and the button/sequence functions would be incorrect when
::pressed is emitted.

So check that the sequence is being handled by the gesture, this is more
desirable than the return value as it's independent of sequence state,
and still will be FALSE for the cases we want to catch here.
2014-12-18 21:20:17 +01:00
Sebastien Lafargue
ce8dc51861 gtktextlayout: fix to quiet a warning
Gcc complains about a possible use of a not initialised
widget ref ( which can't happen in reality )

https://bugzilla.gnome.org/show_bug.cgi?id=741702
2014-12-18 21:00:45 +01:00
Sebastien Lafargue
73c8f30928 gtktextlayout: fix for right margin with RTL text
When a RTL paragraph is not set to wrap, the right margin is not respected
because of the margins counted twice so we replace
display->width by PIXEL_BOUND (extents.width), the same quantity
without the margins.

https://bugzilla.gnome.org/show_bug.cgi?id=741702
2014-12-18 20:52:58 +01:00
Erick Pérez Castellanos
ed1fb8d2af Minor documentation fix 2014-12-18 10:43:13 -05:00
Marek Kasik
779faafa22 printing: Translate context to correct position
Use correct margins of given page setup when translating context
to imageable area.

https://bugzilla.gnome.org/show_bug.cgi?id=671895
2014-12-18 16:29:48 +01:00
Marek Kasik
9ac9769f36 printing: Return correct width and height of page setup
Use correct margins when computing width and height returned by
gtk_page_setup_get_page_width() and
gtk_page_setup_get_page_height().

https://bugzilla.gnome.org/show_bug.cgi?id=671895
2014-12-18 16:29:44 +01:00
Matthias Clasen
fe82dc5fb2 GtkMenuButton: Don't leak popovers
Detach the previous popover from the toplevel when a new one
is set. This should fix

https://bugzilla.gnome.org/show_bug.cgi?id=741652
2014-12-17 22:56:30 -05:00
Lapo Calamandrei
fdc8c6103a Adwaita: another stab at the undershoot 2014-12-17 19:42:11 +01:00
Lapo Calamandrei
bf383acd5d Adwaita: fix treeview progressbar issue
See https://bugzilla.gnome.org/show_bug.cgi?id=741569
2014-12-17 18:30:14 +01:00
Lars Uebernickel
b44df22895 Menu items: force loading 16x16 icons
GtkIconTheme doesn't scale icons beyond the size specified in the theme
anymore. This can result in arbitrarily large menu items when a theme
only provides large icons.

Force icons to always be 16x16 to ensure that menu items always have the
same height.

https://bugzilla.gnome.org/show_bug.cgi?id=741259
2014-12-17 17:52:03 +01:00
Sébastien Wilmet
020258f85a textview: add extend-selection signal
To be able to customize the double-click and triple-click behaviors, to
provide custom selection boundaries.

https://bugzilla.gnome.org/show_bug.cgi?id=111503
2014-12-17 12:20:02 +01:00
Timm Bäder
6e7bf9ca7a menubutton: Fix double freeze_notify 2014-12-16 19:05:23 +01:00
Alexander Larsson
b52a06ac6f GtkGLArea: Handle window scale factor changes
We need to re-allocate the buffers for the new gl size.
2014-12-16 13:27:49 +01:00
Alexander Larsson
08853c7364 GtkGLArea: Only re-allocate buffers during paint
This drops the maybe_allocate_buffers that re-allocates buffers
at any point. Instead we just set have_buffers to FALSE and have
the buffers re-created when needed.

This also makes the buffer creation code imdeponent and makes it
clean up no longer needed buffers in order to handle being called
multiple times due to the above.

We also ensure we re-allocate the buffers when we're resizing
and the buffers are already created.
2014-12-16 13:25:23 +01:00
Ryan Lortie
4288d7d7f4 GtkMenuTracker: one more visibility tweak
On creation, we call action_removed() in case the action was missing
from the start.  Because we just created the action, 'can_activate' will
always be FALSE here and this function will therefore always do nothing.

We do want the visibility state to be updated though, for the case where
the action is missing but the item should still be visible from the
start.

Update the visibility directly instead of trying to call
action_removed().

https://bugzilla.gnome.org/show_bug.cgi?id=735122
2014-12-14 18:34:52 -05:00
Ryan Lortie
8e731560ff GtkMenuTrackerItem: fix submenu visibility flag
We were only properly setting the "is-visible" flag to TRUE for menu
items with associated actions and not (for example) on submenus.

This was fine because the code for building GtkMenus from models
(correctly) assumed that submenus should always be visible and never
checked the property.

This is not true for the Mac OS code, which actually checked the
property and found it to be false for submenus.

Initialise the property to TRUE so that we get the correct value
reported for items that don't have actions.

https://bugzilla.gnome.org/show_bug.cgi?id=735122
2014-12-14 18:34:52 -05:00
Ryan Lortie
5c365b67c1 quartz menu: update visibility property name
This property is called "is-visible" now, not "visible".

https://bugzilla.gnome.org/show_bug.cgi?id=735122
2014-12-14 18:34:52 -05:00
Carlos Garnacho
ba22ae8cce popover: Clamp tail gap limits by the tail height on that side
All popover sides have extra margins to possibly hold the tail, this is
accounted for in gtk_popover_get_rect_coords(), and should be accounted
for too in the tail position calculation.

This fixes the gtk_render_frame_gap() warnings seen when a popover is
pushed far too close to window sides.
2014-12-13 18:02:29 +01:00
Carlos Garnacho
99791007a7 popover: Ensure there is a child before focusing it
Fixes a warning in empty popovers being shown.
2014-12-13 17:11:25 +01:00
Matthias Clasen
c118e51d52 inspector: Fix capitalization 2014-12-12 23:47:26 -05:00
Matthias Clasen
31ccc372f0 inspector: Add a cursor theme control 2014-12-12 23:46:28 -05:00
Matthias Clasen
b1e7106ff3 Adwaita: Fix sidebar undershoot
The undershoot rendering in the gtk-demo sidebar was inheriting
unwanted background. Prevent that.
2014-12-12 22:48:44 -05:00
Benjamin Otte
1cb3734924 stylecontext: Make sure we always clear the cache when the CSS changes
After b49c7c3421 we were no longer doing a
full revalidate after GTK_CSS_CHANGE_SOURCE changes.

This fixes spurious failures of widgets not properly updating when
changing the theme.
2014-12-13 03:45:08 +01:00
Matthias Clasen
0dfbcd60c9 Whitespace fixes 2014-12-12 20:52:35 -05:00
Jasper St. Pierre
b6acc8f2c5 actions: Fix compile warning 2014-12-12 17:39:46 -08:00
Matthias Clasen
f9c5799c82 GtkFileChooser: Don't crash if invisible files are deleted
This is a crash that has been around for a long time, as
can be seen here:
https://bugzilla.redhat.com/show_bug.cgi?id=1048388
https://bugzilla.redhat.com/show_bug.cgi?id=984375
https://bugzilla.redhat.com/show_bug.cgi?id=1159015
https://bugzilla.redhat.com/show_bug.cgi?id=1059187
https://bugzilla.redhat.com/show_bug.cgi?id=1122172
https://bugzilla.redhat.com/show_bug.cgi?id=1016895
https://bugzilla.redhat.com/show_bug.cgi?id=1133235
https://bugzilla.redhat.com/show_bug.cgi?id=1077500
https://bugzilla.redhat.com/show_bug.cgi?id=1054378
https://bugzilla.redhat.com/show_bug.cgi?id=1173212

Fix suggested by Benjamin Otte.
2014-12-11 22:57:37 -05:00
Christian Hergert
661da5558c widget: add helpers to resolve GActionGroups available to GtkWidget
These functions, while added for use by the GTK inspector, are generally
useful to applications that need to resolve what action groups are
available to a particular GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=741386
2014-12-11 15:25:41 -08:00
Matthias Clasen
ab5b0d0983 Make the undershoot area larger
As requested by the artists, double the size from 20 to 40.
2014-12-11 14:49:20 -05:00
Lapo Calamandrei
cf0aba14e7 Adwaita: tweak treeview dnd drop target 2014-12-11 15:35:38 +01:00
Lapo Calamandrei
6420f0516a Adwaita: undershoot tweaks, more work needed. 2014-12-11 14:59:39 +01:00
Matthias Clasen
17be8c3eb1 Adwaita: Draw drag highlight around treeview rows
This got lost somewhere.
https://bugzilla.gnome.org/show_bug.cgi?id=741314
2014-12-11 07:40:33 -05:00
Benjamin Otte
3e9067ce1c cssselector: Reserve more bits for enum
Apparently some compilers make enums an int and then we get negative
values.

https://bugzilla.gnome.org/show_bug.cgi?id=741375
2014-12-11 12:47:54 +01:00
Matthias Clasen
23c5f11391 inspector: Make header buttons as !focus-on-click
Moving the focus to the header bar is unexpected and disruptive,
so don't do it.
2014-12-10 22:47:16 -05:00
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