Commit Graph

19010 Commits

Author SHA1 Message Date
Daiki Ueno
837a0d3e40 textlayout: avoid double-free when adding preedit color
In add_preedit_attrs, don't free foreground/background colors already
set in the underlying text attributes (style).  They will be free'd by
release_style.

https://bugzilla.gnome.org/show_bug.cgi?id=703533
2013-07-09 13:21:17 +09:00
Matthias Clasen
50c3eb9acc Fix the small text for text in GtkAboutDialog
The conversion from gtk_widget_override_font to a GtkTextTag
in fbbb66ae7d was defective.

https://bugzilla.gnome.org/show_bug.cgi?id=701119
2013-07-08 21:46:43 -04:00
William Jon McCann
72c3879893 Add missing G_PARAM_DEPRECATED to stock deprecations 2013-07-08 15:39:55 -04:00
William Jon McCann
aeb878a859 Add missing G_PARAM_DEPRECATED to gtksettings 2013-07-08 15:28:25 -04:00
William Jon McCann
7b66956e63 Deprecate and hardcode default toolbar icon size setting
Toolbar icon size can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
425e977bb6 Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
e61c124509 Deprecate and hardcode values for gtk-tooltip* timeouts 2013-07-08 15:02:28 -04:00
William Jon McCann
c9bfd12d2f Deprecate and hardcode the value of visible-focus setting
Just use the default value of AUTOMATIC and make it just work.
2013-07-08 15:01:33 -04:00
Matthias Clasen
e5b51050c6 csd: Fix up close buttons
Must pass the window as first argument to the signal handler.
2013-07-06 23:11:19 -04:00
Matthias Clasen
c0c752fab1 Cosmetics 2013-07-06 23:11:19 -04:00
Matthias Clasen
ffadfbf322 Don't prematurely mark window as realized
Other code assumes that the widget has a window if it is realized.
Since we might trigger such code indirectly from gtk_window_realize,
don't mark the window as realized before we've registered its window.
2013-07-05 17:15:31 -04:00
Matthias Clasen
6bcf8a2584 Cosmetic cleanups
Avoid some unnecessary casts.
2013-07-05 15:53:30 -04:00
Matthias Clasen
3982532145 csd: hide invisible borders when tiled or fullscreen
This is the expected behavior, and matches what mutter does.
2013-07-05 15:53:30 -04:00
Matthias Clasen
776111fadf csd: fix a resizing artifacts when unmaximizing
When using Super-up/down to maximize and unmaximize a csd window,
the titlebar and content was not picking up the window borders.
2013-07-05 15:53:30 -04:00
Matthias Clasen
c2196e596f csd: no border when fullscreen
The was a missing fullscreen check in get_decoration_size was causing
the window background to have a transparent border when fullscreen.
2013-07-05 15:53:30 -04:00
Kalev Lember
5d121a8aaa GtkListBox: Add g_return_if_fail checks to public row functions 2013-07-04 16:00:30 +02:00
Kalev Lember
b46d583f87 GtkListBox: Add a function for getting the index of a row
https://bugzilla.gnome.org/show_bug.cgi?id=703618
2013-07-04 15:19:47 +02:00
Kalev Lember
a5d2565b7e GtkListBox: Remove a double semicolon 2013-07-04 14:03:06 +02:00
Alexander Larsson
e12d3cea47 stack: Use normal opacity groups rather than weird ones in GtkWidget
Since we now do all drawing propagation on the cairo_t (rather than
exposing multiple independent times on the GdkWindows) we no longer
need the opacity 0.999 hack.
2013-07-04 13:30:51 +02:00
Alexander Larsson
5f245374ed widget: Remove some leftover code
The norender stuff is not used anymore
2013-07-04 13:16:05 +02:00
Alexander Larsson
9e4af0b746 widget: Don't crash if setting alpha on non-realized widget.
https://bugzilla.gnome.org/show_bug.cgi?id=703154
2013-07-04 13:10:58 +02:00
Bastien Nocera
fa6a137478 GtkSearchBar: Fix automatic entry connection
Adding an entry to the search bar didn't automatically connect
the signals as expected as the code was in the wrong branch.

https://bugzilla.gnome.org/show_bug.cgi?id=703406
2013-07-04 12:52:30 +02:00
Matthias Clasen
4eac681eba Avoid deprecation warning
There was one overlooked use of GTK_STOCK_MISSING_IMAGE.
2013-07-03 19:52:11 -04:00
Alexander Larsson
eac7dce160 File chooser: Convert icons to using cairo_surface_t 2013-07-03 14:39:26 +02:00
Alexander Larsson
b6b24148fb GtkCellRendererPixbuf: Add surface property 2013-07-03 14:39:26 +02:00
Alexander Larsson
31fc70721e GtkImage: Add new_from_surface() and set_from_surface() 2013-07-03 14:39:26 +02:00
Alexander Larsson
031e1a98a0 GtkIconHelper: Convert to using cairo surfaces as base and support scales
We render the source into a cairo_surface_t so that we can render it
with cairo directly, rather than having to convert it from a pixbuf
every time. We also specify the target window when creating the cairo
surface so that rendering can be faster.

Using cairo surfaces also allows us to seamlessly support window scales.

We also add a GTK_IMAGE_SURFACE source type.
2013-07-03 14:39:26 +02:00
Alexander Larsson
635ae9bd91 icon factory: Add gtk_icon_set_render_icon_surface
Support scales when falling back to loading icons from the
icon theme.

In order to actually render scaled icons we add
gtk_icon_set_render_icon_surface which renders to a cairo_surface_t
which includes whatever scaling you need for scaled icons.
2013-07-03 14:39:26 +02:00
Alexander Larsson
91a268f00e stylecontext: add gtk_render_icon_surface
This draws an icon from a cairo_surface. We want to use this more rather
than render_icon as this means we can skip the pixbuf to surface
conversion (including allocation and alpha premultiplication) at
render time, plus we can use create_similar_image which may allow
faster rendering.
2013-07-03 14:39:26 +02:00
Alexander Larsson
1d0bb3e010 GtkIconTheme: Add helpers to load to cairo_surface_t
Right now this just uses the pixbuf load code and converts
it to a surface. In the future we could cache the pattern
to allow reusing the surface.
2013-07-03 14:39:26 +02:00
Carlos Garnacho
58adb70d43 icontheme: Add support for high resolution icons
An optional OutputScale integer key has been added to index.theme
subdirs description, so icon themes may provide icons that are
more suitable to render at a (typically 2x) integer upscaled
resolution. This way it is possible to make eg. a 16x16@2x icon has a
real size of 32x32, but contains a similar level of detail to the
16x16 icon so things don't look any more cluttered on high-dpi
screens.

The pixbuf lookup has changed so it prefers a minimal scale change
that yields the minimal real size difference, so if looking up for
a 16x16 icon at 2x, it would first prefer 16x16@2x, then 32x32, and
then any other icon that's closest to match

There is now *_for_scale() variants for all GtkIconTheme ways
to directly or indirectly fetch a GdkPixbuf.

This is based on code by Carlos Garnacho with changes by Alexander
Larsson
2013-07-03 14:39:26 +02:00
Alexander Larsson
07519abcde CellRendererPixbuf: Set the window on the icon helper
This lets us get scaled icons if needed.
2013-07-03 14:39:26 +02:00
Alexander Larsson
41a6780f22 spinbutton: set the window on the icon helper 2013-07-03 14:39:26 +02:00
Alexander Larsson
f258e757bd entry: Set the window on the icon helper 2013-07-03 14:39:26 +02:00
Alexander Larsson
e042ffa71e GtkImage: Set the window on the gtkiconhelper 2013-07-03 14:39:26 +02:00
Alexander Larsson
5d8fd4ee24 GtkIconHelper: Add set_window()
This is a hint on where the icon will be drawn. It
will allow us to pre-allocate cairo surfaces for the right
target.
2013-07-03 14:39:25 +02:00
Alexander Larsson
48ff7d026e CSS: Add -gtk-scaled(image1,image2,...) support for hidpi assets 2013-07-03 14:39:25 +02:00
Alexander Larsson
af2c40bd54 css: Add a scale argument to css-value compute vfunc
We need to be able to compute different GtkCssImage values
depending on the scale, and we need this at compute time so that
we don't need to read any images other than the scale in used (to
e.g. calculate the image size). GtkStyleProviderPrivate is shared
for all style contexts, so its not right.
2013-07-03 14:39:25 +02:00
Alexander Larsson
38e1748df8 GtkWidget: Propagate scale to GtkStyleContext 2013-07-03 14:39:25 +02:00
Alexander Larsson
4cc1fe5bf5 GtkStyleContext: Add gtk_style_context_get/set_scale 2013-07-03 14:39:25 +02:00
Alexander Larsson
6cc5d29792 Use gdk_cairo_surface_create_from_pixbuf when possible 2013-07-03 14:39:25 +02:00
Alexander Larsson
ae43f9facb Add GDK_DPI_SCALE env var
This is very useful for hidpi where the dpi is scaled to make
non-dpi aware apps larger. In that case a dpi aware gtk+ using
GDK_SCALE will be getting huge fonts. You can the set GDK_DPI_SCALE
to compensate for this.
2013-07-03 14:39:25 +02:00
Alexander Larsson
c9b52d8820 pixel-cache: Refresh pixel cache on window scale factor changes. 2013-07-03 14:34:13 +02:00
Alexander Larsson
6bf32999b1 widget: Track when the window scale factor changes and notify
The scale-factor property on the widgets will be notified, and the
scale will change on the style property, causing us to pick up
new css assets.
2013-07-03 14:34:13 +02:00
Michael Natterer
c0ea0b5aad gtk: add gtk_widget_get_scale_factor() 2013-07-03 14:34:13 +02:00
Alexander Larsson
2a81d6f396 listbox: Use new private model, remove priv pointer 2013-07-02 13:44:17 +02:00
Alexander Larsson
06a808cf2a stack: Use new private model, remove priv pointer 2013-07-02 13:43:20 +02:00
Alexander Larsson
09d22284f7 revealer: Use new private model, remove priv pointer 2013-07-02 13:42:43 +02:00
William Jon McCann
a9e82cd46a Deprecate and ignore gtk-enable-tooltips setting
It is enabled by default except on touch input devices.
2013-06-30 14:28:02 -04:00
William Jon McCann
7ca327c9bb Deprecate the unused gtk-file-chooser-backend setting 2013-06-30 13:44:24 -04:00
William Jon McCann
c6ca2374cc Deprecate and ignore gtk-im-status-style and gtk-im-preedit-style 2013-06-30 12:57:44 -04:00
William Jon McCann
d1817e7a5d Add deprecation warnings to GTK_STOCK macros 2013-06-30 12:33:22 -04:00
William Jon McCann
4d6f9d280f Add xpadding around the image in message dialogs 2013-06-30 11:19:50 -04:00
William Jon McCann
c96a1c4980 Deprecate GtkAction and GtkUIManager
It is recommended to use GAction et al and GtkBuilder.
2013-06-30 11:19:50 -04:00
Sébastien Wilmet
158451b1ab textiter: better document "tag" functions
https://bugzilla.gnome.org/show_bug.cgi?id=703313
2013-06-30 10:38:25 +02:00
Matthias Clasen
587fb5efa1 GtkSearchBar: formatting trivia 2013-06-30 00:50:29 -04:00
Matthias Clasen
c6daaa16c9 GtkHeaderBar: documentation improvements
Add some more information about title allocation.
2013-06-30 00:27:45 -04:00
Matthias Clasen
328f221b5c csd: Improve window button handling
Group the buttons on each side in a box, and give them different
style classes, so themes can differentiate (this is partially a
workaround for limitations in our css selectors). The boxes also
let us add a margin below the buttons, without affecting the
allocation of the buttons themselves.
2013-06-29 19:00:40 -04:00
Matthias Clasen
534a7a9397 csd: use the correct icon name for close button
The icon is called window-close-symbolic.
2013-06-29 19:00:40 -04:00
Matthias Clasen
da55c86d3f csd: Use a dedicated style class for window buttons
This allows themes to differentiate between regular buttons
in a title bar, and window buttons.
2013-06-29 19:00:39 -04:00
Matthias Clasen
cacac4f85b csd: Improve the window title
Manually create the label, so that we can set its margins.
2013-06-29 19:00:39 -04:00
Sébastien Wilmet
f0a481d97b textiter: doc precision for forward_search() and backward_search()
https://bugzilla.gnome.org/show_bug.cgi?id=703313
2013-06-29 17:01:58 +02:00
Matthias Clasen
c73b48f28a Add a gtk_window_close function
This is useful when adding close buttons in custom titlebars.
2013-06-28 22:19:15 -04:00
Matthias Clasen
f3f6d1a249 Fix the build
We have to uglify the deprecation messages to make gtk-doc
handle them. The get turned into XML attributes, and there
is no automatic quoting to protect quotes in the text.
2013-06-28 06:50:57 -04:00
William Jon McCann
b86588e9f5 Deprecate GtkImageMenuItem
Use GtkMenuItem for menus with only text or GMenu for those
with icons for "nouns" and just text for "verbs".
2013-06-27 18:48:46 -04:00
William Jon McCann
d741b7b873 Deprecate the gtk stock functions 2013-06-27 17:51:38 -04:00
William Jon McCann
a02f2c4291 Make ignored settings be set to false by default 2013-06-27 17:02:58 -04:00
Emilio Pozuelo Monfort
f19c3896d0 menushell: don't activate a menu entry when opening a big menu
If a menu is opened and it doesn't fit entirely below or above
the menu bar, gtk+ will place it on top. The button release will
then activate the popup item that happens to appear under the
cursor. Avoid this by ignoring release events if they originated
in the parent menu bar and the duration of the press was too short.

https://bugzilla.gnome.org/show_bug.cgi?id=703069
2013-06-27 20:20:53 +02:00
Emanuele Aina
4eddc00911 docs: Add GtkListBox functions to their section and fix links
https://bugzilla.gnome.org/show_bug.cgi?id=702981
2013-06-27 16:28:40 +02:00
William Jon McCann
6e028767d0 Fix default value of scrolled window placement-set property
To make the testsuite happy.
2013-06-26 22:07:00 -04:00
William Jon McCann
fbbcb5c01b Disable primary paste by default 2013-06-26 21:41:45 -04:00
William Jon McCann
aef9dca9d5 Deprecate GtkIconFactory, GtkIconSet, GtkIconSource
We want to use GtkIconTheme instead. It is worth noting that
the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
2013-06-26 20:02:27 -04:00
William Jon McCann
88177d8bd1 Don't use a GtkIconSet to pick the logo image
Just use the first pixbuf in the default list.
2013-06-26 18:48:03 -04:00
William Jon McCann
e779e04bc2 Deprecate and ignore gtk-icon-sizes setting
We don't have icons rendered at arbitrary sizes and we have better
APIs that aren't restricted to GtkIconSizes.
2013-06-26 18:04:27 -04:00
William Jon McCann
b101d465be Deprecate and ignore gtk-keynav-cursor-only and gtk-keynav-wrap-around 2013-06-26 15:33:10 -04:00
William Jon McCann
b26c74e5da Deprecate and ignore gtk-menu-bar-accel setting
Use 'F10' by default.
2013-06-26 14:21:44 -04:00
William Jon McCann
76936193d5 Deprecate and ignore gtk-menu popup and popdown delay settings
Just pick good defaults. The a11y team confirmed that they don't
rely on them.
2013-06-26 14:08:37 -04:00
William Jon McCann
e7b5be93b1 Deprecate and ignore gtk-scrolled-window-placement
Just use GTK_CORNER_TOP_LEFT and allow it to be changed with
gtk_scrolled_window_set_placement().
2013-06-26 13:06:12 -04:00
William Jon McCann
aa78c888eb Deprecate and ignore gtk-fallback-icon-theme
The standard icon themes have built in fallbacks.
2013-06-26 12:47:43 -04:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00
William Jon McCann
2d79334bb0 Deprecate and ignore gtk-can-change-accels
It is disabled by default
2013-06-26 12:00:42 -04:00
William Jon McCann
7cfa7e6b72 Mark gtk-color-palette as deprecated
It is only used by the deprecated color selector widget.
2013-06-26 11:47:32 -04:00
William Jon McCann
7e3a494fac Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics" properties
They are both enabled by default.
2013-06-26 11:16:12 -04:00
William Jon McCann
e8147d15f7 Deprecate and ignore gtk-menu-images setting
GtkImageMenuItem images can still be enabled selectively by the app author
using the always-show-image property on the item.
2013-06-26 10:53:09 -04:00
Benjamin Otte
7bd7bcec0d settings Deprecate properties
Deprecate the properties that were brought back from the dead in the
last patch.
2013-06-26 15:51:31 +02:00
Benjamin Otte
5b7b86c231 Revert "Remove the show-unicode-menu and show-input-method-menu settings"
Removing object properties is too much of an API break, even for
properties we don't expect to be used outside of GTK itself.

This reverts commit 8b811b623c.
2013-06-26 15:51:31 +02:00
William Jon McCann
65c31629c3 Deprecate and ignore gtk-button-images setting
Button images can still be enabled selectively by the app author
using the always-use-image property on the button.
2013-06-26 09:15:22 -04:00
William Jon McCann
d7260d4ee9 Fix a couple documentation warnings 2013-06-25 19:05:32 -04:00
William Jon McCann
424e1d0059 Start deprecating some GtkStock API 2013-06-25 19:05:32 -04:00
William Jon McCann
0091fc3543 Make the testsuite happy that get gets the default value 2013-06-25 12:39:20 -04:00
William Jon McCann
6e22c4cfde Fix some regressions from stock migration 2013-06-25 12:39:19 -04:00
Sébastien Wilmet
67d1183ac9 Document GtkTextSearchFlags
Move the doc about the flags from gtk_text_iter_forward_search() to the
enum.

https://bugzilla.gnome.org/show_bug.cgi?id=390048
2013-06-25 13:21:08 +02:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
William Jon McCann
2b571f41e2 Remove more discontinued ChangeLogs
They are all in git.
2013-06-24 19:53:08 -04:00
Ryan Lortie
c79a21e1dd menu model: set separator label conditionally
When creating separators we were binding the "label" property on the
tracker to the "label" property on the GtkSeparatorMenuItem.

This was problematic for two reasons.

First, it was pointless.  The section header label will never change.

Second, it was causing problems: doing the binding caused the value to
be initially synced up, even if it was NULL.  Doing this caused
GtkMenuItem to create a GtkAccelLabel and add it as a child, which
prevented the separator from being shown normally.

Change the code a bit so that we just call gtk_menu_item_set_label()
when creating the item, if we find the label to be non-NULL.

Also, show() the separator item at first.  GtkMenu manages visibility of
separators internally, but it seems "more correct" to show it ourselves
at first.
2013-06-24 18:05:27 -04:00
Ryan Lortie
d498e9b588 GtkMenuTracker: fix leak when creating submenus 2013-06-24 18:05:27 -04:00
Benjamin Otte
830691bdce treeview: Ensure we first validate the visible area when validating
This invariant stopped being guaranteed when we moved the visible area
validation from a high priority idle to a tick callback.

Fixes redrawing bugs like row expanding sometimes not having any visual
effect.
2013-06-24 20:19:11 +02:00
Benjamin Otte
2008148303 treeview: Reorder code
This just moves a function and is in preparation for the next commit.
2013-06-24 20:19:05 +02:00
Benjamin Otte
f54e37a23b treeview: Actually remove presize handler when we presize
Avoids multiple calls to it.
2013-06-24 20:19:05 +02:00
Sébastien Wilmet
ea4e88df86 textiter: bug fix in forward_search() and backward_search()
When the search is case sensitive, g_utf8_normalize() is not called, so
the skip_decomp argument of the function forward_chars_with_skipping()
must be FALSE.

To verify that, when searching "éb", the count parameter of
forward_chars_with_skipping() have a different value:
- case sensitive: count = 2
- case insensitive: count = 3 (g_utf8_normalize() has been called)

The commit adds unit tests that didn't pass before, and that now pass
(without known regression, obviously).

https://bugzilla.gnome.org/show_bug.cgi?id=702977
2013-06-24 20:14:39 +02:00
William Jon McCann
99fa59c961 Add missing allow-none annotations 2013-06-24 13:46:56 -04:00
Ryan Lortie
1107935d2b GMenuModel -> GtkMenu binding: show submenu items
In the non-submenu case we bind the 'visibility' attribute to the
tracker, which takes care of showing the item.  In the submenu case, we
don't bind all of the properties, so we miss this one.

Deal with it by just show()ing the submenu item.

https://bugzilla.gnome.org/show_bug.cgi?id=702332
2013-06-22 09:35:59 -04:00
Federico Mena Quintero
32e75adf6a GtkFileChooserButton: Also emit 'file-set' when changing the selection through the combo box
https://bugzilla.gnome.org/show_bug.cgi?id=696498
2013-06-21 19:14:36 -05:00
Federico Mena Quintero
9162589b5a GtkFileChooserEntry: don't inline-complete if the entry doesn't have the focus
When the file chooser changes directories, it tells the GtkFileChooserEntry to
change its base folder (i.e. the folder from which relative pathnames are resolved).
GtkFileChooserEntry then starts loading a GtkFileSystemModel asynchronously.
In the finished_loading_cb(), however, it would always ask the GtkEntryCompletion
to insert the completion prefix, since that finished_loading_cb() is what is also used
while the user is typing *in the entry*.

But when the entry doesn't have the focus (e.g. the user changed directories by double-clicking
on the file list in the file chooser), there's no reason to insert completions at all.

https://bugzilla.gnome.org/show_bug.cgi?id=672271
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-06-21 18:35:28 -05:00
William Jon McCann
1b3f9df361 Remove rest of gtk-show-input-method-menu and gtk-show-unicode-menu
They are no longer used.
2013-06-21 08:59:32 -04:00
Jonh Wendell
c27ddc66c5 GtkEntry: ellipsize placeholder text
The placeholder string is truncated when there's no
room for it in entry's width.

So, by ellipsizing it, the user can notice the text
was truncated so that they can workaround that by,
for example, maximizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=702763
2013-06-21 09:29:15 -03:00
Benjamin Otte
8623d73c11 filechooser: Actually return a value 2013-06-21 02:59:23 +02:00
Benjamin Otte
5c61e457c8 treeview: Remove duplicate function 2013-06-21 02:59:23 +02:00
Sébastien Wilmet
08d49fdd58 Fix gtk_text_iter_forward_to_tag_toggle() for end iter
The function must return TRUE only if there is a tag toggle _after_ the
iter, not _at_ the iter. So for the end iter, the function must always
return FALSE.

Add also unit tests for gtk_text_iter_forward_to_tag_toggle().

https://bugzilla.gnome.org/show_bug.cgi?id=691266
2013-06-20 20:22:56 +02:00
Timothy Arceri
555e0a785d filechooser: Fix misleading documentation for gtk_file_chooser_set_preview_widget()
https://bugzilla.gnome.org/show_bug.cgi?id=701174
2013-06-20 12:29:02 -05:00
Sébastien Wilmet
38d78f48b5 Improve doc of gtk_text_iter_forward_search()
It was not possible to know if the @limit was for @match_start or
@match_end. It was documented for backward_search(), but not for
forward_search().

https://bugzilla.gnome.org/show_bug.cgi?id=390048
2013-06-20 12:39:24 +02:00
Claudio Saavedra
0540edcf9c gtkfilechooserbutton: fix documentation typo
https://bugzilla.gnome.org/show_bug.cgi?id=702695
2013-06-20 11:48:51 +03:00
Jonh Wendell
84b4910b39 filechooser: Add gtk_file_chooser_get_current_name()
Currently you can only set the current filename, but not
get it. It's useful to be able to get it in save
dialogs, where the user has typed the desired filename
and you are not in a real directory (recent used, for
example).

https://bugzilla.gnome.org/show_bug.cgi?id=702497
2013-06-19 13:37:35 -05:00
Alexander Larsson
159cccfe7b IconTheme: Move changed emission to an idle
By delaying the emission to an idle we avoid a lot of tricky
reentrancy issues. For instance, a normal gtk_icon_theme_choose_icon()
call could in very rare cases (when a user updated an icon theme) emit
a signal which could affect the icon currently being looked up.  This
kind of reentrancy is very hard to test against, especially when it is
so rare, so we're better of avoiding it.

There is no real value to get the change signal directly anyway. All
it can do is affect which icon is rendered the next frame, and we will
handle the queued emission before rendering. Not to mention that icon
theme change detection is polled anyway, so it is already delayed.

https://bugzilla.gnome.org/show_bug.cgi?id=694755
2013-06-19 11:15:37 +02:00
Alexander Larsson
1ee36713fe IconTheme: Clear caches when reloading theme
When we're reloading the theme in ensure_valid_themes (due to noticing
that a theme dir has changed) we need to also clear the icon cache
as it will not be valid for the new theme.

We already do this in do_theme_change(), but ensure_valid_themes()
was missing this.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Alexander Larsson
280d606cd4 IconCache: Keep a ref on the GtkIconData
The icon data in GttkIconInfo->data is currently owned by the
IconThemeDir->icon_data hashtable. However, on e.g. a theme change
blow_themes() destroys the dirs and thus the data, meaning any
outstanding GtkIconInfo points to stale data.

We solve this by adding a refcount to GtkIconData and reffing it
from GtkIconInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Ryan Lortie
7554c15e7b GtkBuilder: add new constructor APIs
Add new APIs gtk_builder_new_from_{file,resource,string}() and encourage
their use over the older _add_from_...() APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=679930
2013-06-18 10:21:27 -04:00
Ryan Lortie
1bc7359123 docs: GtkBuilder: warn about unusual GError use
GtkBuilder returns GError for _add_from_{file,resource,string}(),
implying that the user should be able to recover from these errors.
Mention in the docs that it's unreasonable to try to do this.

https://bugzilla.gnome.org/show_bug.cgi?id=679930
2013-06-18 10:17:34 -04:00
Alexander Larsson
242d0c5d22 Revert "GtkWindow: Move cairo_save/restore from marshaller"
This reverts commit 6c7689506f.

This is not right as we need to save/restore around *each*
callback, not just each emission.
2013-06-18 11:32:18 +02:00
Alexander Larsson
207703155b listbox: handle moving mouse out of widget with button down
Unset active row, etc when mousing out of the widget totally.
2013-06-17 15:15:07 +02:00
Alexander Larsson
3513981e1e listbox: Properly handle double click
We never want to handle GDK_2BUTTON_PRESS like a normal first click.
2013-06-17 15:15:07 +02:00
Alexander Larsson
e4a981eef2 listbox: Rewrite coords from child windows
If button events are from child windows we need to rewrite
the coordinates to our window.
2013-06-17 15:15:07 +02:00
Matthias Clasen
65f0e194e0 Fix a small memory leak 2013-06-15 23:35:25 -04:00
Matthias Clasen
5707e81c81 GtkBuilder: don't leak callbacks
This was noticed while running the testsuite under valgrind.
2013-06-15 23:33:51 -04:00
Matthias Clasen
c9ec4ba5a1 GtkImage: Fix the initial value of icon-size
Since we are pulling the icon-size out of the icon helper now,
we should set its icon-size when constructing it.
2013-06-15 20:23:01 -04:00
Matthias Clasen
87190233ef GtkListBox: cosmetics
Clean up formatting trivia, adjust includes to gtk conventions,
use P_() for properties, etc.
2013-06-15 12:32:59 -04:00
Bastien Nocera
3d11b9b758 GtkSearchBar: Mention we don't handle Ctrl+F for the app
There's probably an expectation from the app developers that
Ctrl+F or similar common shortcuts for starting a search will
be handled by the widget, when this is not the case. Explicitely
mention it in the docs to avoid confusion.

https://bugzilla.gnome.org/show_bug.cgi?id=701523
2013-06-14 19:10:39 +02:00
Bastien Nocera
19c5b37d9d GtkHeaderBar: Fix buildable function names
It's a GtkHeaderBar, not GtkHeader.

https://bugzilla.gnome.org/show_bug.cgi?id=701346
2013-06-14 19:10:39 +02:00
Bastien Nocera
8a45cb5762 GtkHeaderBar: Make labels creation available privately
So it can be reused in subclasses

https://bugzilla.gnome.org/show_bug.cgi?id=701345
2013-06-14 19:10:39 +02:00
Alexander Larsson
264cbc9e35 GtkStack: Switch order on left/right up/down transitions.
When the new child is on the left, scroll right. This makes the
thing look physically "real".
2013-06-13 20:55:05 +02:00
Alexander Larsson
418ac673a3 GtkStack: Fix drawing of sliding
We were not drawing the view window, so the old widget
was clipped for the sliding transitions.
2013-06-13 20:50:41 +02:00
Erick Pérez Castellanos
33a1c4d6e0 GtkStack: Add position-dependent slide transitions
These go left/right or up/down depending on the relative
order of the children being switched between.
2013-06-13 20:33:42 +02:00
Benjamin Otte
0d55d9b96b treeview: Use gtk_adjustment_configure()
... instead of manually setting all the values. Makes for nicer code and
less signal emissions.
2013-06-13 15:31:35 +02:00
Alexander Larsson
61f44628d6 GtkListBox: Consider width of filtered rows
Without this lists keep shrinking in width as they are filtered, whic
looks really bad.
2013-06-13 12:17:08 +02:00
Alexander Larsson
220eb45ef0 GtkListBox: Protect against reentrancy.
Activating a row may destroy the widget, so keep a ref since
we're doing thing to the listbox after emission.
2013-06-13 12:17:08 +02:00
Alexander Larsson
0f93b7f6c4 GtkListBox: minor fix
Move the check inside the existing chech which also checks
for active_row != NULL for extra safety.
2013-06-13 12:17:08 +02:00
Alexander Larsson
1dd0b468a7 GtkListBox: Add style classes for lists and rows 2013-06-13 12:17:07 +02:00
Alexander Larsson
3bb2d15195 GtkListBox: Add getter for activate_on_single_click 2013-06-13 12:17:07 +02:00
Alexander Larsson
90ff262df6 GtkListBox: Rename reXXX to invalidate_XXX
This is lets us later move to a setup where the rows are not
immediately resorted but queued until next layout.
2013-06-13 12:17:07 +02:00
Alexander Larsson
caacce6d44 GtkListBox: Add placeholder widget support 2013-06-13 12:17:07 +02:00
Alexander Larsson
b0b746b2ea GtkListBox: Track the number of visible children 2013-06-13 12:17:07 +02:00
Alexander Larsson
9510b79d78 GtkListBox: Track visible in the row
This is a minor performance improvement, but its mainly to
allow us to track when n_visible_children changes.
2013-06-13 12:17:07 +02:00
Alexander Larsson
217c2bb087 GtkListBox: Open code the update_header calls in add()
Rather than reusing row_visibility_changed. This means
row_visibility_changed really means that the row visibility changed.
2013-06-13 12:17:07 +02:00
Alexander Larsson
1eb729dcd9 GtkListBox: Make reseparate a no-op for hidden lists
We already take care to not track headers when the listbox is hidden,
because that can be very expensive during creation, so we might as
well skip reseparate() too. The only time we don't want to skip it
is when we're about to show the list.
2013-06-13 12:17:07 +02:00
Alexander Larsson
cbf294b27e GtkListBox: Remove some unnecessary code
the unhighlight call already NULLs out drag_highlighted_row
2013-06-13 12:17:07 +02:00
Alexander Larsson
2ba67a0b8b GtkListBox: Fix docs
Removed some cut/paste leftovers
2013-06-13 12:17:07 +02:00
Alexander Larsson
b119b022a7 GtkListBox: Allow unselecting of rows in SINGLE mode 2013-06-13 12:17:07 +02:00
Alexander Larsson
cc4ac1ee70 GtkListBox: Rename separators to headers 2013-06-13 12:17:07 +02:00
Alexander Larsson
4a0b6e5479 GtkListBox: Remove refilter signal
This was added from https://bugzilla.gnome.org/show_bug.cgi?id=691979
where it was wanted in order to get a "all children filtered" kind
of row. However, the solution is not really generic enough, because
filtering can happen for other reasons than a full refilter (i.e. due
to a row change), and the partial fix you can get by counting children
after refilter can be achieved by manually doing it whenever you manually
called refilter anyway.

Its possible we should have some better solution for the "empty state"
though.
2013-06-13 12:17:07 +02:00
Alexander Larsson
c6ac711508 GtkListBox: Add docs 2013-06-13 12:17:07 +02:00
Alexander Larsson
6a77754c77 GtkWidget: Change which states propagate
Historically the following states propagated to children:
  GTK_STATE_FLAG_ACTIVE
  GTK_STATE_FLAG_PRELIGHT
  GTK_STATE_FLAG_SELECTED
  GTK_STATE_FLAG_INSENSITIVE
  GTK_STATE_FLAG_INCONSISTENT
  GTK_STATE_FLAG_BACKDROP

However, several of these are problematic on containers like GtkListBox.
For instance, if a row is ACTIVE or SELECTED then all children (like e.g
a button) inside the row will *also* look active/selected. This is almost
never right. The right way to theme this is to catch e.g. SELECTED on the
container itself and set e.g. the color and let the children inherit
the color instead of the flag.

We now propagate only these flags:
  GTK_STATE_FLAG_INSENSITIVE
  GTK_STATE_FLAG_BACKDROP

Which make sense to be recursive as they really affect every widget
inside the container.

However, this is a CSS theme break, and while most things continue working
as-is some themes may need minor tweaks.
2013-06-13 12:17:07 +02:00
Alexander Larsson
ecff28bb68 GtkListBox: Remove add_to_scrolled()
Now that we automatically set up the focus_vadjustment we only
need the adjustment to handle the page-up/down scroll length correctly.

We use parent_set to automatically pick up the adjustment from a
scrollable (i.e. viewport) parent which makes add_to_scrolled useless, so
it can be removed.
2013-06-13 12:17:07 +02:00
Alexander Larsson
17c559c429 GtkScrollableWindow: Automatically set focus adjustments
When adding with a viewport we automatically set the focus
adjustments on the viewport from the scrolled window, so that
when any child widget gets focused we automatically scroll to it.

This is generally nice, but its particularly important for GtkListBox
where focus changing is how we navigate between rows.

We also ensure that the adjustments are always set before adding the
child to the viewport, which we will need later to pick up the
adjustments on add.
2013-06-13 12:17:06 +02:00
Alexander Larsson
157102aa73 GtkListBox: No need to manually clamp adjustment to focus
Now that we use real widgets for rows the focus_vadjustment is
enough.
2013-06-13 12:17:06 +02:00
Alexander Larsson
932535d444 GtkListBox: Clean up DnD code
Unhighlight rows if they are removed.

Drop the automatic drag motion based auto-scrolling. This is not really
right, as it e.g. hardcodes auto-scroll regions and assumes we're the only
widget inside the scrolled container. Its also imho in the wrong place,
autoscrolling if any should be done on the scrolled-window or viewport.
All the removed code is implementable outside Gtk+ though.
2013-06-13 12:17:06 +02:00
Alexander Larsson
e319867f80 Add GtkListBox
This is basically an import/rename of EggListBox from the row-widget
branch of egg-list-box.
2013-06-13 12:17:06 +02:00
Christian Persch
781b85088f im: Deprecate gtk_im_multicontext_append_menuitems
Bug #701840.
2013-06-09 09:51:55 -04:00
Kalev Lember
a37450110b Fix string allocation handling with GtkBuilder translations
Use g_string_assign to avoid issues with assigning GString's internal
buffer back to the same string. This can happen when no translations are
available and _gtk_builder_parser_translate returns back the same
pointer that was passed in.

This fixes a regression from commit e9f182e37a
that caused GtkComboBoxText <items> from GtkBuilder to show up empty if
no translations are available.

https://bugzilla.gnome.org/show_bug.cgi?id=700629
2013-06-08 10:54:25 +02:00
Matthias Clasen
8b811b623c Remove the show-unicode-menu and show-input-method-menu settings
These are no longer used.
2013-06-07 18:13:47 -04:00
Matthias Clasen
27a15d9a7d GtkTextView: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:13:20 -04:00
Matthias Clasen
4a62d19da7 GtkEntry: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:10:15 -04:00
Bastien Nocera
dbbea8b97e Add GtkSearchBar widget
This widget is a toolbar that will popup automatically when
searches should be started, and dismissed when they are finished.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-31 17:09:11 +02:00
Benjamin Otte
63eb47577e API: Deprecate gtk_container_resize_children()
It does ad things and is undocumented, so I'll just silently deprecate
it.
2013-05-30 20:02:30 +02:00
Benjamin Otte
299714dd1a container: Don't use to-be-deprecated API
Instead, do what that API does manually.
2013-05-30 20:02:05 +02:00
Benjamin Otte
4e50596b37 window: Call size_allocate() to allocate a size
Don't call gtk_container_resize_children().

https://bugzilla.gnome.org/show_bug.cgi?id=700185
2013-05-30 19:28:54 +02:00
Timothy Arceri
44cd166447 GtkBookmarksManager: Refactor duplicate set error code and localise error strings
https://bugzilla.gnome.org/show_bug.cgi?id=593079
2013-05-30 10:37:58 -05:00
Xavier Claessens
92823b2201 GtkMenuItem: Take padding into account to position submenu arrow
Since commit a69619edbc, it not
possible anymore for the style to add space between the border
and the arrow.

https://bugzilla.gnome.org/show_bug.cgi?id=700779
2013-05-29 14:53:17 +02:00
Benjamin Otte
0bd76a855c cssimage: Add forgotten line
That line was already missing in the initial commit it seems.
2013-05-28 15:24:04 +02:00
Benjamin Otte
f6c746a99d cssanimation: Use property id here 2013-05-28 15:24:04 +02:00
Benjamin Otte
6bf059e36f treeview: Don't cache the height
Instead, use the correct value all the time.
2013-05-28 15:24:03 +02:00
Chun-wei Fan
da31982379 Fix build on C89 compilers
-Avoid defining variables in the middle of the block
-Include fallback-c89.c in gtkrevealer.c in place of math.h as
 fallback-c89.c includes math.h itself, and is needed for round()
2013-05-28 13:36:54 +08:00
Matthias Clasen
fe2260c53d Fix distclean
extract-strings was left behind.
2013-05-27 18:25:31 -04:00
Matthias Clasen
540c665117 Add gtk_test_widget_wait_for_draw to docs 2013-05-27 14:49:43 -04:00
Matthias Clasen
cbe5a3a590 Add a tiled window state
This information is needed to draw client-side decorations
properly in this state.
https://bugzilla.gnome.org/show_bug.cgi?id=696001
2013-05-27 13:31:28 -04:00
Timothy Arceri
84513df5a7 Fix error_selecting_folder_over_existing_file_dialog() never displaying message
https://bugzilla.gnome.org/show_bug.cgi?id=700864
2013-05-26 00:37:23 -04:00
Timothy Arceri
b940122c4a Handle G_IO_ERROR_FILENAME_TOO_LONG errors when saving
https://bugzilla.gnome.org/show_bug.cgi?id=591969
2013-05-26 00:21:41 -04:00
Timothy Arceri
8f668240de Update gtk_file_chooser_set_do_overwrite_confirmation() documentation to reflect what is actually happening
https://bugzilla.gnome.org/show_bug.cgi?id=360131
2013-05-26 00:17:48 -04:00
Alban Browaeys
b08fe39cd8 GtkPlacesSidebar: do not unref mount
Do not unref mount has we grabbed its pointer without taking
a reference.
Otherwise the following call to g_list_free_full on network_mounts
frees it a second time. Segfault in nautilus ensue.

https://bugzilla.gnome.org/show_bug.cgi?id=700979
2013-05-26 00:03:13 -04:00
Matthias Clasen
fc1ff40296 csd: Fix handling of titlebar height
gtk_widget_get_allocated_height returns the adjusted
allocation, so we can't use it as measure for how much
room to leave when drawing the window background.
2013-05-25 21:02:00 -04:00
Matthias Clasen
80513aa2c7 GtkBox: don't propagate the expand child property
The intention of the expand widget flags was to in fact propagate
legacy expand child properties as well. Due to implementation errors,
this was only happening in some cases, but not in others. To avoid
breaking old code assuming traditional expand flag behavior, this
commit removes all attempts to propagate GtkBox::expand.

This was discussed in
https://bugzilla.gnome.org/show_bug.cgi?id=698656 and
https://bugzilla.gnome.org/show_bug.cgi?id=628902

This patch was written by Tristan Van Berkom.
2013-05-25 14:46:09 -04:00
Matthias Clasen
f83af03579 Avoid shadowing a variable
I don't think this broke anything, but it is just inviting
confusion.
2013-05-25 13:17:57 -04:00
Bastien Nocera
536fc22de4 GtkSearchEntry: Don't wait for timeout when emptying
When the text entry gets cleared, emit the "changed" signal
straight away. This avoids a lag when dismissing a search.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Bastien Nocera
1bfbfbc50c GtkTreeView: Use GtkEntry private function to remove hack
https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Bastien Nocera
ffbe7f6eb6 GtkEntry: Focus the entry without selecting the text
Focusing the text entry without selecting all the text is needed in
some places (GtkTreeView, and some uses of GtkSearchEntry) so
create a private helper to avoid replicating the hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Federico Mena Quintero
e6dca05445 GtkFileChooser: Only allow creating bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-05-22 17:30:49 -05:00
Federico Mena Quintero
dc2f399dd0 GtkPlacesSidebar: Only create bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-05-22 17:22:28 -05:00
John Ralls
ffd538c802 Bug 667759 - gtkdnd-quartz.c is missing annotations for introspection
Work around this by introspecting gtkclipboard.c and gtkdnd.c instead
of the quartz alternatives.

Note that this is temporary: The implementation of GdkSelection
will make the quartz alternatives unnecessary. See bug 571582.
2013-05-20 15:44:18 -07:00
John Ralls
af1499c371 Bug 691921 - GTK+ built on Leopard references [NSMenu removellItems]
Test it with respondsToSelector, and if it isn't available delete the
items one at a time.
2013-05-20 15:17:47 -07:00
Luc Pionchon
b634d8de47 typo
https://bugzilla.gnome.org/show_bug.cgi?id=699289
2013-05-19 21:24:01 -04:00
Luc Pionchon
0e08ff19ba Add doc to set markup and accelerator on a MenuItem.
https://bugzilla.gnome.org/show_bug.cgi?id=699289
2013-05-19 21:24:01 -04:00
Matthias Clasen
58d155d1e6 Fix drawing of treeview grid lines
In the presence of invisible columns, the grid line drawing
code was malfunctioning.

https://bugzilla.gnome.org/show_bug.cgi?id=700578
2013-05-18 19:21:54 -04:00
Bastien Nocera
41b07bdc96 GtkSwitch: Don't handle events from extra mouse buttons
Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=696640
2013-05-18 14:49:55 +02:00
Bastien Nocera
7d54fc14bf GtkButton: Don't suppress unhandled mouse events
Mouse events that we do not handle should bubble up to the parent
widget, so they can be handled there, instead of disappearing inside
the button. Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=696640
2013-05-18 14:49:55 +02:00
Benjamin Otte
b3b1c672ee treeview: Use tick callback
instead of a timer for the presize callback.
2013-05-17 20:49:52 +02:00
Benjamin Otte
6f9dc0ffd7 treeview: Store editable position differently
Instead of storing the rect in the bin window, store the row and column
the editable belongs to and compute the rect lazily. This way, we don't
need to keep the rect up to date.

Fixes /TreeView/scrolling/new-row-mixed/path-500 test.
2013-05-17 20:49:52 +02:00
Benjamin Otte
5c7528c591 treeview: Remove unused function 2013-05-17 20:49:52 +02:00
Benjamin Otte
8616dbbad3 API: Add gtk_test_widget_wait_for_draw ()
See docs and following commits for what it's supposed to do. Let's hope
it fixes the flakiness in tests.
2013-05-17 20:49:52 +02:00
Bastien Nocera
51e238653d GtkSearchEntry: Delay the changed signal by default
Emit the "changed" signal after 150 msecs, so that searching
through big lists, or doing online searches feels more responsive.

This is something already done in various applications to make
search-as-you type more responsive (gnome-shell, gnome-documents,
gnome-control-center, etc.). The 150 msecs is the value currently
used by gnome-shell, so keep it (invisibly) consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=700229
2013-05-17 19:45:46 +02:00
Benjamin Otte
bdfb55c945 build: Move gtk/tests to testsuite/gtk 2013-05-15 15:37:16 +02:00
Benjamin Otte
ac8f7f0703 tests: Include gtk/ directory from toplevel 2013-05-15 15:33:24 +02:00
Benjamin Otte
06a8fac3e9 tests: Use testing API instead of duplicating it 2013-05-15 15:33:24 +02:00
Benjamin Otte
772470fb9d tests: Use absolute paths to unrelated files 2013-05-15 15:33:24 +02:00
Alexander Larsson
c3973e8468 GtkContainer: Propagate draws in GdkWindow order
Now that we're not drawing the GdkWindows by themeselves we need to
propagate into children in the same order as the windows were painted
otherwise apps can't rely on stacking order to overlay children.

This is still not 100% the same as the old behaviour, because we're
treating all windows that are part of a window at the same time (to allow
e.g. opacity groups), and we're only looking at order for the main
windows of a widget. However, this fixes at least the ordering
of the gnome-boxes fullscreen overlay toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=699970
2013-05-15 12:47:05 +02:00
Jasper St. Pierre
7793f21d2a gtkmenutrackeritem: Simplify the submenu opening API
Instead of making clients inspect the submenu action and decide what
to do based upon that, always request the submenu open and let the
tracker decide what to do.
2013-05-13 16:33:43 -04:00
Jasper St. Pierre
2024384e0a Add some usage docs for the new private copy/paste APIs 2013-05-13 16:33:43 -04:00
Ryan Lortie
a4276a6c79 add GtkMenuTrackerItem
Add a new class, GtkMenuTrackerItem that represents a menu item, to be
used with GtkMenuTracker.

GtkMenuTracker's insert callback now works in terms of this new type
(instead of passing reference to the model and an index to the item).

GtkMenuShell now handles all of the binding tasks internally, mostly
through the use of property bindings.  Having bindings for the label and
visibility attributes, in partiular, will help with supporting upcoming
extensions to GMenuModel.

GtkModelMenu has been reduced to a helper class that has nothing to do
with GMenuModel.  It represents something closer to an "ideal" API for
GtkMenuItem if we didn't have compatibility concerns (eg: not emitting
"activate" when setting toggle state, no separate subclasses per menu
item type, supporting icons, etc.) Improvements to GtkMenuItem could
eventually shrink the size of this class or remove the need for it
entirely.

Some GtkActionHelper functionality has been duplicated in
GtkMenuTracker, which is suboptimal.  The duplication exists so that
other codebases (such as Unity and gnome-shell) can reuse the
GtkMenuTracker code, whereas GtkActionHelper is very much tied to
GtkWidget.  Supporting binding arbitrary GtkWidgets to actions vs.
supporting the full range of GMenuModel features for menu items turns
out to be two overlapping but not entirely similar problems.  Some of
the duplication (such as roles) can be removed from GtkActionHelper once
Gtk's internal Mac OS menubar support is ported to GtkMenuTracker.

The intent to reuse the code outside of Gtk is also the reason for the
unusual treatment of the enum type introduced in this comment.

This adds no new "public" API to the Gtk library, other than types that
we cannot make private due to GType limitations.
2013-05-13 16:33:43 -04:00
Ryan Lortie
03235bf027 action stuff: Change include style
The shell wants to transplant our GtkActionObserver/GtkActionObservable
code now as well, so change to ""-style #includes there.
2013-05-13 16:33:42 -04:00
Jasper St. Pierre
6030ba4803 action stuff: Introspection fixes 2013-05-13 16:33:42 -04:00
Jasper St. Pierre
8ad384f3dc action stuff: Remove G_GNUC_INTERNAL 2013-05-13 16:33:42 -04:00
Ryan Lortie
6c49cd0ea6 action stuff: stop abusing GLib's namespace
Rename our internal GActionMuxer, GActionObserver and GActionObservable
classes and interfaces to have names in our own namespace.

These classes were originally intended for GIO but turned out to be too
special-purpose to be useful there, so we never made them public API but
have just been copying them around (without bothering to properly rename
them).  Now that other people will be copying them out of Gtk, it's even
more important to prevent this namespace abuse from spreading further.
2013-05-13 16:33:42 -04:00
Ryan Lortie
58481ffabf tests: make GtkMenu test more flexible
We were using gtk_menu_item_get_label() from a testcase to determine the
label associated with a menu item.  Future changes to GtkModelMenuItem
will cause this to stop working, so try a bit harder to find a label
inside of the item.
2013-05-13 16:33:42 -04:00
Hib Eris
914099dce1 Build extract-strings tool for build system
This fixes cross compiling where build system != host system.

https://bugzilla.gnome.org/show_bug.cgi?id=699690
2013-05-13 17:07:46 +02:00
Joe Pea
67c8ebc5d5 GtkPlacesSidebar: Fixed tooltip capitalization
Use sentence capitalization for the tooltip on the file system disk under Devices.
https://bugzilla.gnome.org/show_bug.cgi?id=698933
2013-05-13 05:47:05 -04:00
Bastien Nocera
98d33803fb Fix accels added after the window was shown not working
GtkApplicationWindow would only update its list of captured accels
when realizing the window. This meant that keyboard shortcuts added
after the window was realised (for example, added by plugins) would
be non-functional.

Solve this by updating our accels every time the accel map changes,
not only when realizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=700079
2013-05-13 08:57:06 +02:00
Matthias Clasen
9289156889 Improve wording of filechooser context menu
Use header captialization, and shorten the labels a bit.
https://bugzilla.gnome.org/show_bug.cgi?id=698361
2013-05-12 22:25:54 -04:00
Matthias Clasen
c6fec489ac Improve sensitivity handling in filechooser context menu
Items that act on the selection should not be sensitive if the
selection is empty. This was already the case for the 'Copy file
location' item, but not for the 'Add bookmark' and 'Visit file'
items.
https://bugzilla.gnome.org/show_bug.cgi?id=699104
2013-05-12 22:17:15 -04:00
Carlos Garnacho
a33f0ff839 Find tooltip/dnd widget running through container children in inverse order
Usually, educated GtkContainers' forall() implementation returns children
in an order that's safe for the default draw() implementation in GtkContainer.
So for widgets with some stacking notions (eg. GtkOverlay),
_gtk_widget_find_at_coords() needs to recurse within containers in reverse
order so it finds the topmost widget.

As this function is used in both tooltips and DnD code, this improves behavior
of "floating" widgets wrt those two. This could for example be seen in the
"Transparent" GTK+ demo, where dropping text on the entry results on the text
going to the textview.

https://bugzilla.gnome.org/show_bug.cgi?id=699239
2013-05-12 21:17:01 -04:00
Matthias Clasen
7052d4071c csd: Properly dispose custom titlebars
gtk_bin_remove can't handle internal children, so we have
to unset the titlebar widget before chaining up in dispose.

https://bugzilla.gnome.org/show_bug.cgi?id=700054
2013-05-12 21:01:59 -04:00
Matthias Clasen
d31391b0c7 csd: Ignore titlebars when hidden
We were not drawing the content background in the titlebar
area when fullscreen, and were still treating clicks there
as if they were on the titlebar.
2013-05-12 21:01:59 -04:00
Matthias Clasen
759f223396 csd: Manage visibility of custom titlebars
We should hide custom titlebars when in fullscreen mode, just
as we do for non-custom titlebars.
https://bugzilla.gnome.org/show_bug.cgi?id=700053
2013-05-12 21:01:59 -04:00
Sébastien Wilmet
6b50045f90 Doc: various small fixes
https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:28 +02:00
Sébastien Wilmet
fcc3f973d3 gtktextchild: replace hard-coded values by a macro
The macro already exists, so it's better to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:11 +02:00
Tristan Van Berkom
11be64d3fe GtkComboBoxText: Improved GtkBuildable documentation.
Also removed a bogus FIXME comment which might have been true
a long time ago. Clarification: the "domain" attribute specified
in the builder script overrides any domain previously set with
gtk_builder_set_translation_domain(), so the translation of items
here is perfectly correct and does not need to be fixed.
2013-05-12 21:56:40 +09:00
Matthias Clasen
42ee21e34c Make gtk_window_resize work again
This hunk of code was lost by accident in the previous commit.
2013-05-11 19:44:57 -04:00
Matthias Clasen
fc10ee8d4a GtkWindow: default size is only for initial map
Bring back need_default_size. We need it to preserve this
documented behavior:

The default size of a window only affects the first time a window is
shown; if a window is hidden and re-shown, it will remember the size
it had prior to hiding, rather than using the default size.

With this patch, all of the window sizing tests in
gtk/tests/window pass again.
2013-05-11 18:49:51 -04:00
Benjamin Otte
689905c1b4 widget: make gtk_widget_compute_size_for_orientation() static
It's not used anywhere outside of gtksizerequest.c anymore.
2013-05-11 15:11:53 +02:00
Benjamin Otte
bd4d00918e API: Don't export gtk_widget_preferred_size_and_baseline()
gtk_widget_preferred_size() is only useful if you want to quickly port a
widget from GTK2 sizing code to GTK3 but does not properly work with
height-for-width as used in GTK. So we don't want to encourage people to
use it. In particular we want people to convert to height-for-width
before adding baseline support to their widgets.
2013-05-11 14:48:01 +02:00
Matthias Clasen
31fd014c93 Add more window-size related tests 2013-05-10 13:55:00 -04:00
Colin Walters
33f6730249 GtkBookmarksManager: Only save if we have data to save
Otherwise we write an empty file, which is lame.
2013-05-09 16:48:38 -04:00
Colin Walters
4f01c0b159 GtkBookmarksManager: Ensure parent directory exists when saving
Otherwise we fail when the user doesn't have ~/.config yet.
2013-05-09 16:48:03 -04:00
Benjamin Otte
20e8675106 widget: Remove unused variable 2013-05-09 19:09:50 +02:00
Benjamin Otte
ecaf09c918 build: remove --disable-rebuilds
It's unused and was only useful when perl wasn't installed. But perl is
a dependency of glib these days, so it's useless.
2013-05-09 19:09:50 +02:00
Matthias Clasen
1800dc4709 Remove gtk_widget_size_allocate from gtk_menu_popup_for_device
GtkMenu calls gtk_widget_size_allocate on its GtkWindow during
gtk_menu_popup_for_device if the menu has not been realised. This can cause the
allocation of the GtkWindow and the size of the GdkWindow to become out of sync
because a top level GtkWindow does not attempt to re-size the GdkWindow when
its allocation is set.
https://bugzilla.gnome.org/show_bug.cgi?id=695120
2013-05-09 12:06:05 -04:00
Ryan Lortie
434dfc20c7 GtkCheckMenuItem: remove an unused boolean field
always_show_toggle was always set to TRUE in _init() and never changed
from anywhere else.  Remove it and remove the if() statements based on
it.

https://bugzilla.gnome.org/show_bug.cgi?id=699929
2013-05-09 12:04:41 -04:00
Stefan Sauer
a725b06363 label: fix return value type for _draw()
Change from gint to gboolean.
2013-05-08 22:05:56 +02:00
Matthias Clasen
c77e12a215 Make key themes work again
This was inadvertedly broken in commit
44ba5d253f.
Thanks to Matthew Francis for tracking this down and providing
a fix in https://bugzilla.gnome.org/show_bug.cgi?id=699901
2013-05-08 10:21:36 -04:00
Alexander Larsson
bb7054b508 overlay/paned: Ensure we set the right visual on windows
This was always "needed", but the problems with not doing it
now are worse, since any CSD window will have a nonstandard
rgba visual.
2013-05-08 15:51:00 +02:00
Rico Tzschichholz
d08d7f2c5a Remove abi checking scripts (2)
In addition to 019ad96479
2013-05-07 17:34:32 +02:00
Alexander Larsson
8ae7defad5 GtkPixelCache: Free cache if not used in 20 seconds
No need to keep a performance enhancing cache around if its not
actually in use.
2013-05-07 16:40:24 +02:00
Alexander Larsson
e2c8a95af6 GtkStack: Fix double-draw in crossfade
We should only draw the cross-fade on the bin window, not doing this
was causing us to draw it multiple times using ADD which resulted
in weird colors.
2013-05-07 16:40:24 +02:00
Alexander Larsson
0600d3d7e4 GtkWidget: Use gdk_window_get_children_for_user_data
This makes iterating over the children a lot faster, as we're
not doing lots of intra-library calls and type checks. We're still
in some sence O(n^2) since we iterate over each child window for each
widget, but the profiles look much better.
2013-05-07 16:40:24 +02:00
Alexander Larsson
cad751c762 GtkTreeView: port to PixelCache
We register an invalidate handler on the bin window to get told
of child widget invalidations, although we manually need to discard
invalidates from the scroll operation.

Additionally we invalidate all of the pixel cache whenever
the TreeView itself is queue_draw()n to handle e.g. style (bg)
changes, or changes due to model changes causing queue_draw() in
the tree view.
2013-05-07 16:34:05 +02:00
Alexander Larsson
2df27ce7f8 Make GtkViewport use GtkPixelCache
Since gdk_window_move() no longer uses XCopyArea all scrolling
now re-renders everything in the window. To get performance
back we use a GtkPixelCache to store already drawn children,
and we when we expose the viewport we just blit the
offscreen to the right place.
2013-05-07 16:34:05 +02:00
Alexander Larsson
dde714386d GtkPixelCache: Add debug feature to track redraws
Each time we redraw we tint it in a different color so that
you can see which regions are redrawn.
2013-05-07 16:34:05 +02:00
Alexander Larsson
30dc399b72 Add GtkPixelCache
GtkPixelCache is a helper utility that lets you implement
faster scrolling of a viewport of a canvas by using an
offscreen pixmap cache.

You call _gtk_pixel_cache_draw with a callback function that
does the drawing, and additionally you specify the size and the
position of the viewport in the widget, and the position and size
of the canvas wrt the viewport. The callback will be called to
draw on an offscreen surface, and the surface will be drawn
on the window. The next time you do the same, any already drawn
pieces of the surface are re-used from the offscreen and need
not be rendered again.

If things inside the canvas change you need to call
_gtk_pixel_cache_invalidate to tell the cache about this.

Some other details:

* The offscreen surface is generally a bit larger than
  the viewport, so scrolling a small amount can often
  be done without redrawing children.
* If the canvas is not larger than the viewport no
  offscreen surface is used.

GtkPixelCache: Make sure we always copy using SOURCE

We were using OVER for the first copy (from source to group surface.

GtkPixelCache: Fix x/y typos

GtkPixelCache: Allow NULL for invalidate region

gtkpixelcache: Use CONTENT_COLOR for solid bg windows
2013-05-07 16:34:05 +02:00
Alexander Larsson
cb2882a273 GtkWidget: Add a vfunc for queue_draw_region
Since widgets now cache drawn state we allow them to override
queue_draw_region to detect when some region of the widget
should be redrawn. For instance, if a widget draws the
background color in a pixel cache we will need to invalidate
that when the style context changes which queues a repaint.
2013-05-07 16:34:05 +02:00
Alexander Larsson
6c7689506f GtkWindow: Move cairo_save/restore from marshaller
We do the save/restore when emitting ::draw rather than in a custom
marshaller, as this saves an extra stack frame, which is helpfull now
that we do painting fully recursive. This is also likely to save a few
cycles.
2013-05-07 16:33:01 +02:00
Alexander Larsson
d22fd7223c Only handle exposes on native window, propagate to children via draw()
We now consider non-native windows non-opaque, which means any invalid
area in a subwindow will also be invalid all the way up to the nearest
native windows. We take advantage of this by ignoring all expose events
on non-native windows (which typically means just the toplevel) and instead
propagating down the draw() calls to children directly via
gtk_container_propagate_draw.

This is nice as it means we always draw widgets the same way, and it
will let us do some interesting ways in the future.

We also clean up the GtkWidget opacity handling as we can now always
rely on the draing happening via cairo.

We can't really just draw by walking down the widget hierarchy, as
this doesn't get the clipping right (so e.g. widgets doing cairo_paint
may draw outside the expected gdkwindow subarea) nor does it let
us paint window backgrounds.

So, we now do multiple draws for each widget, once for each GdkWindow,
although we still do it on the same base cairo_t that we get for the
toplevel native window. The difference is only the clipping, the rendering
order, and which other widgets we propagate into.

We also collect all the windows of a widget so we can expose them inside
the same opacity group if needed.

NOTE: This change neuters gtk_widget_set_double_buffered for
widgets without native windows. Its impossible to disable
the double buffering in this model.
2013-05-07 16:33:01 +02:00
Matthias Clasen
e9122eca68 Add more test cases
These are taken from
https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-05-07 08:54:05 -04:00
Benjamin Otte
a0aa367458 checkbutton: Implement height-for-width 2013-05-07 14:06:11 +02:00
Benjamin Otte
4ea26b619b checkbutton: Split out a common function
Makes size request / allocation code easier to understand.
2013-05-07 14:06:11 +02:00
Kalev Lember
34c0deb006 GtkPlacesSidebar: Fix an uninitialized variable in the error code path
Initialize it to NULL early so that we won't try to free an
uninitialized variable when handling an error.
2013-05-07 14:01:54 +02:00
Kalev Lember
19e6db7997 gtksizegroup: Add explicit braces to avoid dangling else
Otherwise the else after the for loop becomes attached to the wrong if.
2013-05-07 13:59:53 +02:00
Matthias Clasen
1391a0be1c Add a testcase for the dnd window breakage 2013-05-07 06:11:42 -04:00
Matthias Clasen
019ad96479 Remove abi checking scripts
The exported symbols are now controlled explicitly from the headers,
no need to double-check.
2013-05-07 06:01:18 -04:00
Alexander Larsson
c6a5b800c2 GtkEventBox: Correctly handle height for width
We need to pass on the width to the child.

https://bugzilla.gnome.org/show_bug.cgi?id=699140
2013-05-06 17:49:58 +02:00
Alexander Larsson
dcb84f158b css shadow: Add extra slop to the blur clipping
Turns out our blurring function isn't very nice, it has a lot
of energy past the blur radius, so clipping at exactly the
blur radius causes ugly gradient stops. This just adds 4
extra pixels of slop, which makes this better in most cases.
2013-05-06 16:20:04 +02:00
Alexander Larsson
66d3b5a9cd css shadows: Split up rendering of shadows
We split up the rendering of blurred shadows into 9 parts, the
corners, the sides and the rest. This lets us only blur the "blurry"
part, and it lets us completely skip blurry parts that are fully
clipped.
2013-05-06 16:20:04 +02:00
Alexander Larsson
5ba5306dc9 css shadows: Exit early if clip is empty 2013-05-06 16:20:03 +02:00
Alexander Larsson
70774bf978 GtkCssShadowValue: Break out the shadow rendering code
This makes it easier to call it multiple times which we
want to do later.
2013-05-06 16:20:03 +02:00
Alexander Larsson
c91e706e2b css: Clip outset box-shadow to outside of box
As per css3-background 7.2. Drop Shadows: the ‘box-shadow’ property:

  An outer box-shadow casts a shadow as if the border-box of the element
  were opaque. The shadow is drawn outside the border edge only: it
  is clipped inside the border-box of the element.

Also verified vs firefox behaviour.
2013-05-06 16:20:03 +02:00
Stef Walter
ed1eddabf0 gtksettings: Fix loading of uint settings
https://bugzilla.gnome.org/show_bug.cgi?id=699739
2013-05-06 14:20:48 +02:00
Matthias Clasen
ec724fe0fd Remove regex-based export control
All export control is now happening through annotations
in the headers.
2013-05-05 15:38:48 -04:00
Matthias Clasen
92597da3a0 Add visibility flags in gtk/a11y 2013-05-05 15:38:48 -04:00
Matthias Clasen
feedd371f6 New visibility handling in gtk 2013-05-05 15:38:48 -04:00
Matthias Clasen
f5f5b70355 Ignore deprecations where needed
There are a few places where we are still using deprecated
API internally - ignore deprecations around these uses.
2013-05-05 15:38:48 -04:00
Matthias Clasen
7d8e755d16 Fix up headerless symbols
Some symbols are exported from GTK+, but do not appear in any
headers. For these, use _GDK_EXTERN in the source file to make
sure they are exported.
2013-05-05 15:38:47 -04:00
Matthias Clasen
4cec2337ab Add annotations in a11y headers 2013-05-05 15:38:47 -04:00
Matthias Clasen
20c8c8b91c Add annotations to gtk headers
Add annotations to all exported functions in GTK+ headers.
2013-05-05 15:38:47 -04:00
Matthias Clasen
8470eb84c0 gtk: Use GDK_AVAILABLE_IN_ALL for generated enum types
glib-mkenums is not currently clever enough to know which version an
enum type was added in, so just mark all the _get_type() functions as
available in all versions.
2013-05-05 15:38:47 -04:00
Matthias Clasen
28fb54256b Just ignore deprecations inside deprecated/
Not worth tracking uses of deprecated API individually here.
2013-05-05 15:38:47 -04:00
Matthias Clasen
111cc604f5 Remove an unused private function
_gtk_text_layout_get_line_xrange was not exported and not used
inside GTK+ either.
2013-05-05 15:38:46 -04:00
Matthias Clasen
3b4804bbf1 Always use gint for border_width
This avoids an evil trap when doing MAX (..., ... - 2 * border_width)
and the expression on the right gets promoted to unsigned, instead
of going negative as you would expect.
https://bugzilla.gnome.org/show_bug.cgi?id=699633
2013-05-04 19:21:56 -04:00
Ignacio Casal Quinteiro
38688cad00 window: handle titlebar property for the buildable interface 2013-05-04 23:04:55 +02:00
Matthias Clasen
96e0d9db72 Some window size test tweaks
Draw a checkerboard pattern, and add an interactive mode that
waits for events before moving on. This makes it easier to see
when a size is wrong.
2013-05-04 16:16:20 -04:00
Matthias Clasen
7fd0836567 Add some more GtkWindow tests
These tests check that a toplevel window ends up with the expected
size after setting default sizes or resizing. It currently passes
on X, but fails with client-side decorations under X and Wayland.
2013-05-04 16:16:11 -04:00
Matthias Clasen
ed5ef04127 Fix setting child properties
This was broken in e9f182e37a
2013-05-03 22:29:20 -04:00
Matthias Clasen
97caad1fec Don't clear data on a NULL screen
This makes GtkSettings survive the object finalize test.
2013-05-03 20:05:00 -04:00
Stefan Sauer
b8366027b3 widget: fix two typos in api-docs 2013-05-03 20:40:00 +02:00
Guillaume Desmottes
c15a7877e9 treemodelsort: destroy the root only if we are removing the latest row of the level
GtkIconView doesn't ref the rows of the model so we have to make sure that a
level is actually empty before destroying it.

https://bugzilla.gnome.org/show_bug.cgi?id=698846
2013-05-03 13:06:08 +02:00
Matthias Clasen
2b6c684569 Make it possible to finalize theming engines
This was broken since forever. Good that we never finalize
theme engines...
2013-05-02 21:36:45 -04:00
Matthias Clasen
c538bdc7dc GtkInvisible behaves like GtkWindow
As far as refcounting is concerned, invisibles are like
windows: you have to destroy them.
2013-05-02 20:43:34 -04:00
Matthias Clasen
b980057764 Only check for finalization after a grace period
This makes the file chooser pass this test
2013-05-02 20:42:24 -04:00
Matthias Clasen
1afca5510a Prevent a segfault if GtkAppChooserDialog gets disposed early
If the async call is finished after the dialog is already disposed,
bad things happen. Prevent that by marking the dialog as dismissed
in this case.
2013-05-02 20:00:49 -04:00
Benjamin Otte
01c810b4d7 gdk: Remove new gdk_display_manager_peek() API
It's not necessary anymore because gdk_display_manager_get() always
succeeds and the value is independant of when it was called as it's no
longer backend specific.
2013-05-02 16:27:47 +02:00
Benjamin Otte
43e6b3aa03 window: Handle attach widget disappearing without weak pointers
Fixes the window not emitting a "notify::attached-to" signal when the
attach-widget goes away.
2013-05-02 16:26:37 +02:00
Benjamin Otte
7cecc8e524 a11y: Remove AtkSelection implementation from combobox
AtkSelection requires that the immediate children of the object are the
selectable items. The combobox however is implemented with just 1 child:
The popup menu.

The popup menu is implementing the selectable interface.

Test are updated to reflect this change.
2013-05-02 15:31:26 +02:00
Matthias Clasen
c6894cd606 Try this again
When the hostnamed call is cancelled, we get a G_IO_ERROR_CANCELLED
error back. Handle it properly.
2013-05-02 09:29:35 -04:00
Matthias Clasen
f7f63ae3ee Revert "Remove a superfluous ref"
This reverts commit f326c0eac8.

Grr, turns out that cancelling is not that reliable :-(
2013-05-02 08:23:58 -04:00
Matthias Clasen
117c86d08a Clear list of attached windows when disposing a widget
We were silently relying on everybody to detach their windows,
and would leak memory otherwise.
2013-05-02 08:02:40 -04:00
Matthias Clasen
fb08a26acd GtkWindow: use a weak ref to keep track of attach_widget
Taking a full reference of the attach widget creates a reference
cycle, and keeps the attach_widget alive longer than it should.
2013-05-02 08:01:14 -04:00
Matthias Clasen
f326c0eac8 Remove a superfluous ref
If we cancel the call in dispose, no need to ref the object
we pass as userdata. Avoids the risk of leaking the ref if
the call is actually canceled.
2013-05-02 05:53:40 -04:00
Matthias Clasen
4dc01aca43 Fix build 2013-05-02 05:37:58 -04:00
Matthias Clasen
e399798da8 Revert "Disable the filechooser template tests"
This reverts commit 17b9733372.
2013-05-01 22:22:22 -04:00
Matthias Clasen
8eeb379f7c Revert "Disable the object-finalize test for now"
This reverts commit a021dc793c.
2013-05-01 22:22:09 -04:00
Matthias Clasen
0d49b97fce Silence a compiler warning 2013-05-01 21:35:39 -04:00
Matthias Clasen
210451e86f Minor doc comment fix 2013-05-01 21:27:06 -04:00
Matthias Clasen
3f397d6b38 Make gtkplacessidebar.h look like a gtk header 2013-05-01 21:23:55 -04:00
Matthias Clasen
2f0a5dd541 GtkPlacesSidebar: Correct all since tags 2013-05-01 21:19:37 -04:00
Benjamin Otte
327a164744 paned: Fixup recent commit
d90e3670ce had a bunch of embarrassing
bugs.

Fixes paned-undersized reftest.
2013-05-01 23:26:27 +02:00
Benjamin Otte
61f47829ba tests: Comment out unused functions 2013-05-01 17:46:50 +02:00
Benjamin Otte
2d29c4a43f window: last size is more important than default size
reorder size computation code to reflect that.

https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-05-01 16:41:12 +02:00
Benjamin Otte
01f7ed1d07 window: Deprecate gtk_window_reshow_with_initial_size() 2013-05-01 16:41:12 +02:00
Benjamin Otte
d90e3670ce paned: Correctly compute child sizes in size requests 2013-05-01 16:41:12 +02:00
Benjamin Otte
6146bf7a32 gtkprivate: #define OPPOSITE_ORIENTATION
and use it
2013-05-01 16:41:11 +02:00
Benjamin Otte
ea98c61f3c paned: Split size request code
The code is pretty different for both cases, so better split things
here.
2013-05-01 16:41:11 +02:00
Benjamin Otte
9c2eb4f233 paned: Split out a function 2013-05-01 16:41:11 +02:00
Benjamin Otte
cb99cd2052 button: Rework size request/allocation code
- Split out a common function
- Implement hfw properly.
2013-05-01 16:41:11 +02:00
Benjamin Otte
41e8d3df6d widget: Improve debug output 2013-05-01 16:41:11 +02:00
Benjamin Otte
01fe4ce7f4 button: Use _gtk_widget_get_preferred_size_for_size()
This was accidently lost when merging baseline support.
2013-05-01 16:41:11 +02:00
Benjamin Otte
1349292e47 widget: Adapt _gtk_widget_get_preferred_size_for_size()
... for baseline support byu taking two extra (possible NULL) arguments.
2013-05-01 16:41:11 +02:00
Matthias Clasen
17b9733372 Disable the filechooser template tests
The places sidebar breaks the finalization checks in these tests
https://bugzilla.gnome.org/show_bug.cgi?id=699393
2013-05-01 10:28:53 -04:00
Matthias Clasen
a021dc793c Disable the object-finalize test for now
GtkPlacesSidebar breaks this:
https://bugzilla.gnome.org/show_bug.cgi?id=699393
2013-05-01 10:28:03 -04:00
Matthias Clasen
032636f3ea Add missing symbols 2013-05-01 10:27:48 -04:00
Hib Eris
4dcd49352b Revert "Don't build gtk-launch when gio-unix is not available"
The gtk-launch tool can be build without gio-unix (although it
will not really do much without an alternative implementation for
g_desktop_app_info).

So there is no need to not build gtk-launch anymore.

This reverts commit 9a1235bf0d.

https://bugzilla.gnome.org/show_bug.cgi?id=682824
2013-05-01 07:39:36 +02:00
Matthias Clasen
f47e578737 Fix a typo
Modifed should be Modified.
https://bugzilla.gnome.org/show_bug.cgi?id=699225
2013-04-29 13:08:18 -04:00
Alexander Larsson
8cb78d82d6 gtksizerequestcache: Fix typo that lead to crash/leak
We were checking for cache->requests_x but freeing cache->requests_y
which could cause a crash/leak.
2013-04-29 18:17:02 +02:00
David King
59c3e7bfe8 docs: Add GtkWidget::show,hide,map,unmap,realize,unrealize
Add gtk-doc comments for several signals on GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=688896
2013-04-29 07:23:46 +01:00
David King
402985077b docs: Add (inout) to requisition of gtk_menu_item_toggle_size_request()
https://bugzilla.gnome.org/show_bug.cgi?id=675571
2013-04-29 07:18:54 +01:00
Matthias Clasen
e9f182e37a Fix a few memory leaks wrt to translations
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=699016
The fix here is slightly different. We make
_gtk_builder_parser_translate return a const char * instead of
a dup'ed string, and fix up the callers.
2013-04-28 21:43:49 -04:00
Matthias Clasen
13858fde29 GtkGrid: Undo a size allocation tweak
Revert 5e1a06d1b1

This change caused empty rows to 'open up', which was not
intended and causes problems as seen in bug 698660.
2013-04-28 18:46:41 -04:00
Matthias Clasen
1f17efb81c Add some tests for GtkWindow
These tests may have some assumptions on reasonable window manager
behaviour.  For now, we just test that the default size of the
window ends up as the allocated size of the content. This test
currently fails with client-side decorations, because we are
not properly discriminating between overall window size and
content size.
2013-04-27 13:41:17 -04:00
Paolo Borelli
d35596fe92 GtkImage: do not leak metrics in baseline align
https://bugzilla.gnome.org/show_bug.cgi?id=699020
2013-04-27 13:59:29 +02:00
Rico Tzschichholz
b957e16695 gtk: Add COMPOSITE_TEMPLATES to EXTRA_DIST 2013-04-26 09:25:44 +02:00
Matthias Clasen
8dc090b9b1 GtkStack: improve docs 2013-04-24 22:07:09 -04:00
Matthias Clasen
a8a41b52ad GtkStackSwitcher: unset tooltip
It was pointed out to me that we leave the tooltip behind
when setting and unsetting an icon.
2013-04-24 20:10:05 -04:00
Matthias Clasen
af49dd33cf GtkNotebook: Consistent boolean handling
Normalize boolean parameters in gtk_notebook_set_tab_reorderable and
gtk_notebook_set_tab_detachable before comparing them. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=697196
2013-04-24 19:58:22 -04:00
Cosimo Cecchi
06c8e8fa43 docs: fix some typos in newly introduced methods 2013-04-24 13:10:54 -04:00
Benjamin Otte
174664b235 overlay: Silence gcc warnings 2013-04-23 14:13:51 -04:00
Owen W. Taylor
0032b2dc5a GtkSpinButton: don't constantly recreate style contexts for buttons
Cache the style contexts for the up and down panels, instead of recreating
them each time they are drawn or size requested. GtkSpinButtons were
many times slower to draw than other widgets because of the constant
style matching.

https://bugzilla.gnome.org/show_bug.cgi?id=698682
2013-04-23 14:04:39 -04:00
Federico Mena Quintero
d9b9ba5da0 Merge branch 'places-sidebar' 2013-04-23 13:58:09 -04:00
Alexander Larsson
316d450421 Handle non-baseline supporting subclasses overriding baseline supporting classes
If a subclass (say a child of GtkButton) overrides the non-baseline
size request methods we need to call these, rather than the new
get_height_and_baseline_for_width method.

In order to handle this we make the default for this method to be
NULL, and instead check at runtime which method to call. If any
non-baseline vfunc has changed in a class but the baseline one
hasn't, then we can't use the baseline one.
2013-04-23 05:58:48 +02:00
Alexander Larsson
e8d4bfd04b Add baseline alignment functions to gtk.symbols 2013-04-23 05:58:08 +02:00
Alexander Larsson
e253a414b0 GtkLabel: Minor cleanup
Make sure we always compare for a set baseline in the same way.
I.e. baseline != -1, never baseline >= 0.
2013-04-23 05:58:08 +02:00
Alexander Larsson
ac8817d34b GtkWidget: Add missing Since docs 2013-04-23 05:58:08 +02:00
Alexander Larsson
c630804647 GtkImage: Reuse previously calculated baseline_align in draw()
No need to recalculate this every time we draw.
2013-04-23 05:58:08 +02:00
Alexander Larsson
43f1ac2b8f GtkBox: Add missing Since in docs 2013-04-23 05:58:08 +02:00
Alexander Larsson
ebbc7791dd GtkGrid: Add missing Since docs 2013-04-23 05:58:07 +02:00
Alexander Larsson
f354cef61b GtkDialog: Baseline align buttons in action area 2013-04-23 05:58:07 +02:00
Alexander Larsson
8fbd6e2edc GtkEventBox: Support baseline alignment
This allows baselines to propagate from the child of the eventbox.
2013-04-23 05:58:07 +02:00
Alexander Larsson
e64c1f8929 GtkButtonBox: Support baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson
1df8d18ad2 GtkCheckButton and GtkRadioButton: Implement baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson
433c0c2134 GtkSpinButton: Support baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson
627685e2a2 GtkGrid: Support baseline alignment in GtkGrid
We support a local baseline in each row, as well as selecting
a specific row for the global baseline of the entire GtkGrid.
2013-04-23 05:58:07 +02:00
Alexander Larsson
72cd8b4dab GtkEntry: Support baselines 2013-04-23 05:58:06 +02:00
Alexander Larsson
d6684b5748 GtkButton: Add baseline align support 2013-04-23 05:58:06 +02:00
Alexander Larsson
7523b25942 GtkImage: Support baselines
This uses the current font metrics to guess the baseline of the image.
Without this any non-centered baseline in buttons with images look weird.
2013-04-23 05:50:38 +02:00
Alexander Larsson
6acc8c0817 GtkAlignment: Support baselines
We now report any baselines from the child, and allocate it.
Also, in the case of a baselign aligned child we ignore yscale/yalign
as that is not supportable.
2013-04-23 05:50:38 +02:00
Alexander Larsson
9a42942afb GtkBox: Add baseline alignment for horizontal boxes
Report a baseline based height and baseline whenever there
are children with ALIGN_BASELINE.

Assign baseline to childen in size_allocate. Either the one inherited
from the parent if set, or otherwise calculate one based on any
ALIGN_BASELINE children.
2013-04-23 05:50:38 +02:00
Alexander Larsson
1e1cf89e4f GtkLabel: Support baseline
Report the baseline in get_preferred_height_and_baseline_for_width().
2013-04-23 05:50:37 +02:00