Commit Graph

13766 Commits

Author SHA1 Message Date
Matthias Clasen
92f1f0c118 GtkCellRendererAccelPrivate: Improve struct packing 2011-04-12 12:30:04 -04:00
Matthias Clasen
a2f005d9a0 GtkCellAreaBoxPrivate: Improve struct packing 2011-04-12 12:25:53 -04:00
Matthias Clasen
9a5d2a52d3 GtkButtonPrivate: Improve struct packing 2011-04-12 12:25:25 -04:00
Matthias Clasen
6ca6691966 GtkBoxPrivate: Improve struct packing 2011-04-12 12:24:56 -04:00
Matthias Clasen
b756743cdf GtkAppChooserWidgetPrivate: Improve struct packing 2011-04-12 12:24:34 -04:00
Matthias Clasen
39af7107b4 GtkAppChooserButtonPrivate: Improve struct packing 2011-04-12 12:24:05 -04:00
Matthias Clasen
2610e00de9 GtkAccelLabel: Improve struct packing 2011-04-12 12:23:35 -04:00
Kristian Høgsberg
c7514e8f0d Merge branch 'gdk-backend-wayland'
Conflicts:
	Makefile.am
	configure.ac
	gdk/Makefile.am
	gtk/gtksettings.c
	gtk/gtkwindow.c
2011-04-12 09:52:44 -04:00
Matthias Clasen
3fbfd82e9e GtkWindow: rearrange private struct to fill some holes 2011-04-11 18:33:43 -04:00
Paolo Borelli
7fe3764f4d Small cleanup in statusbar
Factor out msg_create/free and use g_slist_free_full as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=647278
2011-04-11 18:11:36 -04:00
Javier Jardón
518d030220 Move documentation to inline comments: GtkTearoffMenuItem 2011-04-11 23:07:41 +01:00
Javier Jardón
4a7400db99 Move documentation to inline comments: GtkCellRendererPixbuf 2011-04-11 23:07:41 +01:00
Javier Jardón
3990af227f Move documentation to inline comments: GtkCellRendererCombo 2011-04-11 23:07:41 +01:00
Javier Jardón
1f50a4d011 Move documentation to inline comments: GtkHSeparator 2011-04-11 22:33:38 +01:00
Javier Jardón
1f9f5e8890 Move documentation to online comments: GtkCellRendererSpin 2011-04-11 22:14:35 +01:00
Javier Jardón
ebda721f4e Move documentation to inline comments: GtkFileChooserWidget 2011-04-11 03:27:08 +01:00
Javier Jardón
62c878b0cd Move documentation to inline comments: GtkHScale 2011-04-11 03:27:08 +01:00
Javier Jardón
610d46d12e Move documentation to inline comments: GtkCellRendererAccel 2011-04-11 03:27:08 +01:00
Javier Jardón
de210bd2ae Move documentation to inline comments: GtkHScrollbar 2011-04-11 02:54:53 +01:00
Javier Jardón
9dc0e7460e Move documentation to inline comments: GtkFontButton 2011-04-11 02:47:43 +01:00
Javier Jardón
fc0e045d92 Move documentation to inline comments: GtkCellRendererToggle 2011-04-11 02:42:54 +01:00
Javier Jardón
f7f7d4eee4 Move documentation to inline comments: GtkHPaned 2011-04-11 02:36:23 +01:00
Javier Jardón
735f3a23a4 Move documentation to inline comments: GtkInvisible 2011-04-11 02:31:56 +01:00
Javier Jardón
ca8d880a20 Move documentation to inline comments: GtkCellRendererProgress 2011-04-11 02:18:13 +01:00
Javier Jardón
3662744eaa Move documentation to inline comments: GtkMisc 2011-04-11 02:14:08 +01:00
Javier Jardón
f2fd3ee1d5 Move documentation to inline comments: GtkImageMenuItem 2011-04-11 02:13:02 +01:00
Matthias Clasen
32358a58f4 Avoid a warning out of the print dialog
Reported in https://bugzilla.gnome.org/show_bug.cgi?id=647152
2011-04-08 20:49:29 -04:00
Cosimo Cecchi
6261b8434f themingengine: don't set a line width before saving the cairo context
https://bugzilla.gnome.org/show_bug.cgi?id=647086
2011-04-08 20:34:00 -04:00
Cosimo Cecchi
35479be43e separator: call gtk_style_context_restore() after drawing
https://bugzilla.gnome.org/show_bug.cgi?id=647086
2011-04-08 20:33:59 -04:00
Cosimo Cecchi
b52394adca calendar: make sure to call gtk_style_context_restore()
https://bugzilla.gnome.org/show_bug.cgi?id=647086
2011-04-08 20:33:58 -04:00
Paolo Borelli
c4e17bb148 Do not leak list when drawing notebook.
When we construct the list in the other order we must free it.

https://bugzilla.gnome.org/show_bug.cgi?id=646886
2011-04-08 20:21:22 -04:00
Alexander Larsson
9db4accf9c Make gtkclipboard.c:clipboard_get_timestamp multi-backend safe
We can't just check for the backend defines, we have to do runtime checks too.
2011-04-07 20:19:30 +02:00
Matthias Clasen
e32728fb5c GtkColorButton: Don't leak references
https://bugzilla.gnome.org/show_bug.cgi?id=646815
2011-04-06 00:57:47 -04:00
Tristan Van Berkom
d4021d7a1b Fixed bug in GtkSizeRequest code where the cache is not reset properly
Fixes this bug https://bugzilla.gnome.org/show_bug.cgi?id=646500
2011-04-04 13:58:05 +09:00
Tristan Van Berkom
0b8a1dcac2 Fixed warning catch in gtk_window_compute_hints(). 2011-04-03 18:10:27 +09:00
Carlos Garnacho
e8c78edeb2 theme: Fix prelight on selected rows' expanders
There was no prelight effect on selected rows' expanders with the
builtin theme, noticed by Kris Rietveld.
2011-04-03 12:32:20 +02:00
Matthias Clasen
b112d882ef GtkAppChooserButton: avoid some leaks
gtk_tree_model_get() returns a reference for objects.
https://bugzilla.gnome.org/show_bug.cgi?id=646462
2011-04-01 23:53:58 -04:00
Matthias Clasen
315bb30220 Fix some refcounting issues in the print dialog
gtk_tree_model_get returns a reference for objects, but the
printers in the model can be NULL,
https://bugzilla.gnome.org/show_bug.cgi?id=646446
2011-04-01 22:05:02 -04:00
Federico Mena Quintero
eb02dacb37 [filechooser] Free things which got duplicated or reffed by gtk_tree_model_get()
We had forgotten to do that in a few places; this is a systematic search for those.

https://bugzilla.gnome.org/show_bug.cgi?id=646461
2011-04-01 17:00:17 -06:00
Federico Mena Quintero
58609cfdaf [filechooser] Unref cancellables we got from the model, not the ones that come into the callback
The model_cancellables have an extra ref when we get them from gtk_tree_model_get().
So, we need to unref them always.  On the other hand, the cancellables that get
passed as arguments to the callbacks in question are memory-managed by
GtkFileSystemModel.

Reported by Morten Welinder <mortenw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=646460
2011-04-01 17:00:17 -06:00
Federico Mena Quintero
a24f61fb37 [filechooser] Don't leak a GFile
Reported by Morten Welinder <mortenw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=646458
2011-04-01 17:00:17 -06:00
Federico Mena Quintero
2aad7a5151 [filechooser] Don't add extra ref to file, as it it comes from gtk_tree_model_get()
Leak kindly reported by leak finder extraordinaire Morten Welinder <mortenw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=646457
2011-04-01 17:00:16 -06:00
Juan Pablo Ugarte
a77e6b1593 Added GtkEntry:completion property 2011-04-01 19:35:32 -03:00
Juan Pablo Ugarte
d80d834be8 * gtk/gtktreeselection.c:
Added missing GtkTreeSelection:mode property.
   Closes bug #645960 "GtkTreeSelection has no property to set mode"
2011-03-31 19:17:17 -03:00
Benjamin Otte
0bfc95faa3 widget: Propagate the right states to the widget when setting the parent 2011-03-30 16:40:06 +02:00
Benjamin Otte
1e43965350 widget: Get rid of parent_sensitive flag
Instead rely on state_flags & GTK_STATE_FLAG_INSENSITIVE to tell us if a
widget is sensitive.
This has the huge benefit that the way the widget is actually rendered
corresponds to the return value of gtk_widget_is_sensitive().

As a side effect, we do not ever allow unsetting the
GTK_STATE_FLAG_INSENSITIVE for a widget the is set to not be sensitive
(via gtk_widget_set_sensitive()). This way we stop propagation of making
stuff sensitive at insensitive widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=642918
2011-03-30 16:40:06 +02:00
Matthias Clasen
b2f872112a Make GtkWidget::halign RTL-save
This commit makes GTK_ALIGN_START/_END pay attention to
the text direction when used in horizontal context.

This is how similar parameters in GtkMisc and GtkAlignment work,
and is generally expected of GTK+ positioning parameters. And this
is new GTK+ 3 api, so it is basically still unused at this point.

If explicit right/left turn out to be needed at some point, we
can expand the enumeration with new values.
2011-03-30 10:34:02 -04:00
Matthias Clasen
7a65db0402 GtkGrid: Add forgotten RTL flipping
How did we manage to add a non-RTL savy container in GTK+ 3.0 ?
2011-03-30 08:19:30 -04:00
Benjamin Otte
93b0cecd7e label: Remove dead code
This code has been useless for a while, and now it's breaking things.
Moving the paned in tests/testheightforwidth's wrapping label shows that
bug.

Broken since 9992efdb0e
2011-03-30 13:17:01 +02:00
Ryan Lortie
ae6032b2ea GtkStatusIcon: support fixed-sized icons
Use the _NET_SYSTEM_TRAY_ICON_SIZE property set by the tray mananger as
a hint that we should use a specific icon size.  This allows the tray to
instruct us that it expects 16x16 icons, for example.

Bug #645232
2011-03-30 00:26:27 +05:30
Carlos Garnacho
ae22476931 theming: Implement non-uniform border-width in the theming engine.
The border-width CSS parameter takes up to 4 values, but it was
being ignored by the theming engine until now.
2011-03-29 19:39:34 +02:00
Carlos Garnacho
6834bace95 theming: Avoid boxed struct copies throughout the default engine 2011-03-29 19:39:22 +02:00
Benjamin Otte
21f117c695 label: Add another special case for measuring 2011-03-29 15:33:27 +02:00
Benjamin Otte
9992efdb0e label: Don't create the layout in size_allocate() if not needed
Just update its size if it already exists.
2011-03-29 15:33:27 +02:00
Benjamin Otte
c94dca36ca label: Move ellipsized layout width computation
... from size_allocate() to update_layout_width().
2011-03-29 15:33:27 +02:00
Benjamin Otte
bd3e947485 label: Factor out layout size measuring into its own function
Instead of doing half of it in get_preferred_size() and the other half
in get_label_width(), put it all in one place.
2011-03-29 15:33:27 +02:00
Benjamin Otte
e824bb4aab label: Move function to a better location
This patch does not change anything, it just moves the get_label_width
function.
2011-03-29 15:33:27 +02:00
Benjamin Otte
5e80c06d41 label: Factor out layout size setting into a separate function 2011-03-29 15:33:27 +02:00
Benjamin Otte
0930de9446 label: Only get font metrics if we have to
Getting these metrics is expensive, so avoid it if possible.
2011-03-29 15:33:27 +02:00
Benjamin Otte
6ba3ef5d82 label: Add optimization for a common special case
Oftentimes we want to measure a layout that is as wide or wider than the
current layout's maximal width. In that case we can safely reuse the
current layout.
2011-03-29 15:33:27 +02:00
Benjamin Otte
20b90cb793 label: Remove unused boolean argument from ensure_layout()
It's always FALSE.

Note that this patch changes the layout for allocations that are
smaller than 1px, but that's just the default layout that is never
rendered.
2011-03-29 15:33:27 +02:00
Benjamin Otte
db474e82c4 label: Don't recreate the layout just for measuring
Instead, create a custom one.
2011-03-29 15:33:27 +02:00
Benjamin Otte
d579166a63 label: Add internal gtk_label_get_measuring_layout() and use it
Avoids useless pango_layout_copy() calls and invalidations of an
existing layout when measuring sizes for a given label.
2011-03-29 15:33:27 +02:00
Benjamin Otte
8343831c39 progressbar: remove needless is_drawable() check before queue_resize() 2011-03-29 15:33:27 +02:00
Benjamin Otte
b7cd3d6b06 tracker: Include gdk.h 2011-03-29 15:33:27 +02:00
Benjamin Otte
c6ddbe675a docs: Fixes for icon renaming
Fixes up breakage from 39d4207ab7
2011-03-29 00:09:39 +02:00
Alexander Larsson
e274dbbdce Ensure we always grab the gdk lock in async callbacks
Async callbacks are delivered in idles, so we need to make sure
we get the gdk lock before calling any gdk/gtk stuff. This was
missing in a few places.
2011-03-28 12:49:17 +02:00
Michael Natterer
abe63e8aa1 gtk: add "Since: 3.2" to gtk_widget_path_to_string() 2011-03-27 15:43:31 +02:00
Benjamin Otte
179cec87c8 widget: Only reemit style-set signal after gtk_widget_get_style()
If the widget does not care about the compat code, just ignore it.
2011-03-27 03:44:19 +02:00
Benjamin Otte
9d3465412e widget: Don't invalidate style context in its invalidate callback 2011-03-27 03:39:43 +02:00
Benjamin Otte
bb879b6954 widget: Update path unconditionally in gtk_widget_reset_style()
Also, don't set the new path twice on the style context.
2011-03-27 01:53:04 +01:00
Benjamin Otte
d7ca207133 widget: Don't duplicate style context updates
The screen changes are done in do_screen_change(), the widget path is
updated in gtk_widget_reset_style().
2011-03-27 01:52:16 +01:00
Benjamin Otte
fb65806c8c widget: Call the non-deprecated function
Both functions are identical, just that one isn't deprecated.
2011-03-27 01:51:20 +01:00
Benjamin Otte
8b4b3cf090 API: Add gtk_widget_path_to_string()
Dumps the widget path into a string representation. It tries to match the CSS
style as closely as possible (Note that there might be paths that cannot be
represented in CSS).

The main use of this code is for debugging purposes, so that you can
g_print() the path or dump it in a gdb session.
2011-03-27 01:47:17 +01:00
Benjamin Otte
fafee4e276 widget: Emit initial style-set signal in the same situations as GTK2
This ensures that widgets that aren't ported and rely on the style-set
signal being emitted work as well as before. They should not rely on
style-set being emitted however.

Note that this function is a no-op if the initial style has been set
already and is very cheap if it has not been set yet. It only becomes
relevant if the resulting style actually gets used.

https://bugzilla.gnome.org/show_bug.cgi?id=639584
2011-03-27 00:48:26 +01:00
Benjamin Otte
af8a6a7abd widget: Create the widget's style lazily
That way we don't have to update the style's colors all the time on
theme changes when the widget is not actually using GtkStyle.
2011-03-27 00:48:26 +01:00
Benjamin Otte
1891b790b3 widget: Don't call gtk_style_attach() and gtk_style_detach() anymore 2011-03-27 00:48:26 +01:00
Benjamin Otte
080ae55e87 docs: Make clear that gtk_widget_set_style() does not do anything 2011-03-27 00:48:26 +01:00
Benjamin Otte
29444cc30e widget: Use a priv variable 2011-03-27 00:48:26 +01:00
Benjamin Otte
2bb64c868c widget: Widgets always have a style, so no need to check for NULL 2011-03-27 00:48:26 +01:00
Benjamin Otte
f2441c08f1 combobox: Don't set the menu's name twice 2011-03-27 00:48:25 +01:00
Benjamin Otte
ea928e4212 notebook: Only reset style on tab labels when it actually changes 2011-03-27 00:48:25 +01:00
Benjamin Otte
963c0905f2 widget: Reshuffle code for style context getter
The intention of this patch is to make the code clearer, shorter and
most of all to avoid recreating the widget path and setting it path
twice on the style context when the style context was recreated.
2011-03-27 00:48:25 +01:00
Benjamin Otte
757087e9b4 widget: Don't create the style context if not necessary
If all we want to do is update the context's screen, we don't need to
create it if it doesn't exist yet.
2011-03-27 00:48:25 +01:00
Benjamin Otte
0cdebc8bd5 Revert "Ensure GtkWidget::style-updated is emitted before first size negociation"
This reverts commit b7f772eb93.

The commit just poked around things and added lots of workarounds
instead of actually fixing the bug it set out to fix.

See https://bugzilla.gnome.org/show_bug.cgi?id=639584 for details.
2011-03-26 23:52:28 +01:00
Benjamin Otte
8ce533265e gtk: Reset children styles when changing name
Changing the name of a widget does not just change the current widget's
path, but also the path of all its children.
2011-03-26 23:51:51 +01:00
Benjamin Otte
06f590456f widgetpath: Sanitize pos argument for iters correctly
The comparison done was off by one and would have caused invalid
reads or writes.
2011-03-26 23:51:28 +01:00
Benjamin Otte
8a16876fc7 dnd: Use G_N_ELEMENTS()
Now that we have wesome macros in glib 2.0, we can use them. Woohoo, GTK
2.0 will be so awesome in the future.
(Did anybody touch dnd code this millenium?)
2011-03-26 23:48:42 +01:00
Tristan Van Berkom
5989a6405f Fixed possible segmentation fault while freeing size request caches. 2011-03-25 18:42:08 +09:00
Tristan Van Berkom
38b5c8cf45 Cache heights-for-range-of-widths instead of height for every width.
This patch optimizes window resizes by assuming that if a widget
has the same height at a width of 50 as with a width of 150, the
height for width 100 will also be the same.

The patch also further optimizes the cache allocator, now there
are 2 pointer arrays of up to a maximum of 5 requests, the arrays
will only be allocated if a request is ever made in that orientation
and the array will be sparse until each request is made (i.e. if a
label can only wrap to 3 lines, there will only be 3 out of a
possible 5 SizeRequest structures allocated to cache it).
2011-03-25 18:42:08 +09:00
Tristan Van Berkom
82ae7b77ca Reduce memory consumption of the size request cache.
This patch makes contextual height-for-width request caching
optional (the contextual cache is not allocated for widgets that
report GTK_SIZE_REQUEST_CONSTANT_SIZE).
2011-03-25 18:42:08 +09:00
Tristan Van Berkom
887142f1f5 Added GTK_SIZE_REQUEST_CONSTANT_SIZE to GtkSizeRequestMode
The constant size request mode defines a request mode where
height-for-width geometry is unneeded, thus optimizing GTK+
by reducing the overall amount of requests that need to be
performed and cached while resizing an interface.
2011-03-25 18:42:07 +09:00
Florian Müllner
16dc117045 window: Use settings from screen rather than default
gtk_settings_get_default() was used to monitor the
"gtk-application-prefers-dark-theme" setting, rather
than the GtkSettings object associated with the window's
screen.
2011-03-25 17:41:19 +01:00
Carlos Garnacho
b7f772eb93 Ensure GtkWidget::style-updated is emitted before first size negociation
Fixes Bug 639584 - initial emission of GtkWidget:style-set is
not happening.

GtkWidget was filtering out ::style-updated (and ::style-set)
emissions until the widget was realized in order to avoid often
useless updates during widget construction and placing.

This is now done instead until the widget has a parent/screen,
which ensures the initial emission happen prior to the first
size negociation, while still filtering out all early emissions
during construction.
2011-03-25 14:33:54 +01:00
Matthias Clasen
4a86e5b138 Make selectable labels work again
You can select something, but moving the focus somewhere else, or bringing up
the context menu makes the selection go away. This makes it impossible to
copy-paste the text.

The reason for this regression is that gtk_label_state_changed was sloppy and
assumed that it would only ever be called when a labels goes insensitive, which
is no longer the case.

The patch fixes things by explicitly checking if the widget is insensitive, and
only resetting the selection in that case, which is the same behaviour we have
for e.g. GtkEntry.
2011-03-24 12:45:59 -04:00
Cosimo Cecchi
6c3c26d9c3 switch: hardcode a smaller font size for the switch label
This should not really be done here, but we can't override font size
from the theme just yet.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 10:00:01 -04:00
Cosimo Cecchi
24bba4cc56 gtksettings: unset attributes set to normal from font description
So that they do not override values coming from the theme.

Based on a patch by Carlos Garnacho.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 10:00:00 -04:00
Cosimo Cecchi
ec2055d1b0 Revert "styleproperties: don't force replacing the font description"
It turns out the bug is more complicated than I originally understood.
Not replacing the font description fields while merging here makes it
impossible for application's CSS to override fonts.

This reverts commit 89c1d93b68.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 09:59:58 -04:00
Michael Natterer
41810b46e7 Bug 643805 - Allow GtkExpander to resize the toplevel upon expanding/collpasing
Add gtk_expander_get,set_resize_toplevel() and a "resize-toplevel"
property.
2011-03-21 20:57:43 +01:00
Cosimo Cecchi
1876823ef0 themingengine: don't hardcode white to draw insensitive labels shadow
Use the background color instead.
I think the optimal solution would be delegating the shadow rendering to
the theme completely, and removing this in GtkThemingEngine, but for
now, this simple fix makes the dark variant more usable.

https://bugzilla.gnome.org/show_bug.cgi?id=645405
2011-03-21 11:00:53 -04:00