Commit Graph

17102 Commits

Author SHA1 Message Date
Javier Jardón
351c1ab149 gtk/gtkadjustment.c: Improve docs
Refer to #GtkAdjustment properties instead fields
2012-08-07 03:20:50 +09:00
Paolo Borelli
d0d21a4f00 Make GtkToolbar honour css border and padding
The widget is already calling gtk_render_frame, but is not measuring css
border and padding when negotiating its size. This patch replaces the
already existing get_internal_padding static helper with a function that
sums the old internal-padding value with the values specified via css.
2012-08-05 12:52:36 +02:00
Michael Natterer
13ad089bdf gtk: ref the action around gtk_action_emit_activate()
for the same reason we already ref the action's group in the function.
(cherry picked from commit ebe50bbecb)
2012-08-03 23:28:05 +02:00
René Stadler
e5269ebbcd iconview: fix get_tooltip_context transfer annotation
Just like treeview.

https://bugzilla.gnome.org/show_bug.cgi?id=681005
2012-08-01 19:00:36 +02:00
Cosimo Cecchi
c1218f964a notebook: restore previous behaviour wrt. unparenting of tab labels
When the tab label gets removed from the notebook on widget
desctruction, we should still unconditionally unparent it from the
notebook, since failing to do so will keep a stray reference alive.

In case applications rely on the tab label being destroyed to release
other references (e.g. because the tab label is a custom object, or
another object's lifecycle is tied to it using g_object_set_data_full()),
this will also possibly cause other references to get leaked.
In Nautilus, the result was we were failing to release the reference to
a NautilusWindowSlot, and other parts of the application relied
on it being destroyed at a specific time instead, causing the
application to crash when closing a window.

This is a regression from commit
325cf071d1.

This commit restores the previous unparenting behavior in case we're not
in a DnD operation.

https://bugzilla.gnome.org/show_bug.cgi?id=680349
2012-07-31 20:17:54 +02:00
Jasper St. Pierre
844e793246 menubutton: Clear references in dispose, not finalize
We need to do this here so that an explicit gtk_widget_destroy
on either the widget or a container that holds it will kill the
reference to the menu or model.

https://bugzilla.gnome.org/show_bug.cgi?id=680803
2012-07-31 12:09:05 -03:00
Matthias Clasen
8d0e88bac7 gtk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
These are just wrappers for the functions, and we want to
deprecate them. Stopping to use them internally is a good
first step.
2012-07-30 18:01:47 +02:00
Philip Withnall
f92a092bac Bug 680822 — Document return value of GtkWidget::draw
Document the boolean accumulator used by GtkWidget::draw and a few other
GtkWidget signals.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=680822
2012-07-30 16:12:06 +02:00
Rob Bradford
f061990bd5 window: Update _gtk_window_set_is_active API comment
The comment referenced GTK_TOPLEVEL which has been replaced by
GTK_WINDOW_TOPLEVEL.
2012-07-28 15:19:28 +01:00
Matthias Clasen
ae81246512 Add an example for handling app menu fallback
The example shows how to use a menu button instead of the default
menubar when the shell doesn't show the app menu.
2012-07-22 21:01:15 -04:00
José Dapena Paz
0ea892069b wayland: don't wipe clipboard on any change coming from the same owner.
We now support independent selection and primary clipboards, and avoid
wiping clipboard on modifying its contents from the same owner. This fixes
most of the interaction issues with clipboard and selection.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-17 11:24:54 +01:00
Rui Matos
eaddf70a43 GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node
GSequence iterators point at the position between two elements so an
iterator pointing at the N tree model node is actually between the N-1
and N sequence elements. This means that asking for the previous
sequence iterator first and then checking if it is the begin iterator
would yeld true for an iterator pointing at the 2nd tree model node
and make us return FALSE mistakenly.

https://bugzilla.gnome.org/show_bug.cgi?id=679910
2012-07-17 10:50:48 +02:00
Rui Matos
96c19108fc tests/filtermodel: Add test for bug 679910 2012-07-17 10:49:00 +02:00
Tomas Bzatek
bdc6395d64 New gtk-launch command
This program launches an application specified by its desktop name
optinally taking list of URIs which are passed as arguments.

Uses GdkAppLaunchContext to get proper startup notification and
display handling for graphical apps.

https://bugzilla.gnome.org/show_bug.cgi?id=679342
2012-07-16 14:28:22 -04:00
Cosimo Cecchi
23c5ebafce cellrendererpix: set the IMAGE style class when rendering an icon
This way, themes can change symbolic icon colors for views, by using a

.view.image {

}

CSS selector.

https://bugzilla.gnome.org/show_bug.cgi?id=680008
2012-07-16 09:35:07 -04:00
Cosimo Cecchi
5ee591225a tests: add a test for GtkLevelBar GtkBuildable implementation
https://bugzilla.gnome.org/show_bug.cgi?id=677892
2012-07-16 01:01:38 -04:00
Cosimo Cecchi
6af40f9c46 level-bar: add default Raleigh theming for GtkLevelBar
https://bugzilla.gnome.org/show_bug.cgi?id=677892
2012-07-16 01:01:38 -04:00
Cosimo Cecchi
68acf78c5d level-bar: introduce GtkLevelBar
Similar to CcStrengthBar from gnome-control-center, but more generic and
with thorough CSS styling support.

https://bugzilla.gnome.org/show_bug.cgi?id=677892
2012-07-16 01:01:38 -04:00
Matthias Clasen
cc310be81a Fix preview sizing in GtkFontSelection
The code that was trying to limit preview size changes was
running into some width-for-height pitfalls. It turns out
that the dialog behaves quite ok without this code, so just
remove it.
2012-07-15 11:47:36 -04:00
Matthias Clasen
41f6d189f9 Add GDK_AVAILABLE annotations to new API 2012-07-15 00:53:46 -04:00
Matthias Clasen
79c1095512 Clear cached row sensitivity when the filter changes
Now that filters may affect sensitivity of rows, we need
to clear the sensitivity column from the cache when the
filter changes. This fixes the problem where selecting a
different filter does not update the sensitivity of folders
until you change directories.
2012-07-15 00:41:49 -04:00
Matthias Clasen
46c1ea98d2 Emit row-changed notification
Emit row-changed when the filteredness of a visible row
changes in GtkFileSystemModel.
2012-07-15 00:41:49 -04:00
Federico Mena Quintero
226450785a Make the logic for setting the sensitivity column a bit more clear
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-07-15 00:41:48 -04:00
Federico Mena Quintero
cbb4ee4d55 Make computing and setting the visibility/filters atomic operations
This way we remove paired function calls (compute/set pairs), and also make
it possible to avoid computing a filter twice, as setting the visibility
depends on filteredness.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-07-15 00:41:48 -04:00
Federico Mena Quintero
435ee7741c Make it clear that 'filtered' means 'filtered_out'
It bothers me that we call gtk_file_filter_filter(), then negate the result,
and the return *that* from node_should_be_filtered().  So, rename 'filtered'
throughout GtkFileSystemModel to 'filtered_out' to mean things that didn't
pass the filter.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-07-15 00:41:48 -04:00
Federico Mena Quintero
914749bebe Remove superfluous check in node_set_filtered()
This was a copy-paste leftover from node_set_visible().  Filters are not
concerned with model freezes, so node_set_filtered() does not
need to handle freezes, either.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-07-15 00:41:48 -04:00
William Jon McCann
c027b6d2cd Desensitize filtered folders when in folder selection mode
https://bugzilla.gnome.org/show_bug.cgi?id=679333
2012-07-15 00:41:47 -04:00
Matthias Clasen
1bcefc47e1 Cosmetic changes 2012-07-13 23:07:25 -04:00
Carlos Garnacho
bd3ca2b30e menu: Fix touch scrolling on menus close to the monitor edge
Specially in the case of comboboxes, those menus could enable scrolling
even if the contents could fit in the work area, and could show blank
space in order to line up the selected item with the combobox.

When such thing happens, take into account scroll_offset when relocating
the menu contents so contents don't jump directly onscreen, and apply
it so scrolling is allowed in the direction that brings the menu onscreen
and blocked in the opposite direction.

Also, wait for cancelling the scroll operation until the touch is released
even if the scrolling arrows disappeared, so the menu item underneath isn't
selected right away.

https://bugzilla.gnome.org/show_bug.cgi?id=678113
2012-07-13 19:21:41 +02:00
Carlos Garnacho
37262f9725 statusicon: Rely on GtkIconHelper for pixbuf resizes
The same is now achieved by forcing pixbuf rescaling on the icon helper
2012-07-13 16:56:37 +02:00
Carlos Garnacho
77221c18a3 Ensure pixbufs as entry icons get resized
Entries don't expand vertically if they are given pixbufs larger
than the calculated height for the current font, resulting in
cropped icons, so force the pixbuf to be rescaled so it fits
on the entry allocated size.

https://bugzilla.gnome.org/show_bug.cgi?id=678087
2012-07-13 16:56:37 +02:00
Carlos Garnacho
b5d45a9edc Add API to force a GtkIconHelper pixbuf rescaling
This API is handy in entries and status icons, where the size is
limited and independent of the pixbuf size
2012-07-13 16:56:37 +02:00
Carlos Garnacho
36bcb3bf95 menu: small code cleanup
Don't check twice for the widget being realized to move
both windows
2012-07-13 14:49:47 +02:00
Carlos Garnacho
10fa09137e menu: code style fix
The newline before != looks unintentional
2012-07-13 14:47:38 +02:00
Carlos Garnacho
ebdd60c63b icontheme: Don't assume a symbolic icon size of 16x16
If the symbolic icon has other size than 16x16, the embedder
SVG that overrides colors would still force that size, resulting
in clipping instead of resizing. So fetch the original pixbuf
size the first time a symbolic icon is requested for a GtkIconInfo,
and use that size for the embedder SVG so it can be scaled properly
afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=677567
2012-07-13 14:44:05 +02:00
Carlos Garnacho
db569cbee7 introspection: mark data in GtkCallback as closure
This is needed for so GtkContainer::forall() can be implemented
in non-native code, and the callback gets the passed data if
called.

https://bugzilla.gnome.org/show_bug.cgi?id=644926#c28
2012-07-13 14:43:23 +02:00
Matthias Clasen
0b5f12975f Consistently allow -1 to mean 'append' in tree models
Both GtkListStore and GtkTreeStore had a few methods that allowed
-1 to mean 'append' when specified as a position, but others that
demanded positive position arguments. Make this consistent by
always allowing -1.
https://bugzilla.gnome.org/show_bug.cgi?id=667808
2012-07-12 08:42:34 -04:00
Emmanuele Bassi
3d7a2d7883 Ensure that XDG_DATA_HOME is created before using it
The recently-used.xbel storage for recently used files is located inside
the $XDG_DATA_HOME directory; there's no actual guarantee that the
directory has been created already, even though it's very highly
probable on any modern distribution. We should create it, along with its
intermediate parents, before constructing the file monitor that we use
to get change notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=671817

https://bugzilla.gnome.org/show_bug.cgi?id=667808
2012-07-12 08:42:33 -04:00
Matthias Clasen
5de021cfdc Revert "level-bar: introduce GtkLevelBar"
This reverts commit 126a2308ca.

Pushed by mistake.
2012-07-11 07:15:34 -04:00
Cosimo Cecchi
126a2308ca level-bar: introduce GtkLevelBar
Similar to CcStrengthBar from gnome-control-center, but more generic and
with thorough CSS styling support.

https://bugzilla.gnome.org/show_bug.cgi?id=677892
2012-07-10 22:41:12 -04:00
Matthias Clasen
f7683b05b1 GtkApplication: Fix unsetting menu models
Pointed out by Zachary Dovel in
http://bugzilla.gnome.org/show_bug.cgi?id=679705
2012-07-10 21:25:58 -04:00
Matthias Clasen
b90f40544f Silence the build
Hide gdbus-codegen behind $(AM_V_GEN) for silence and cleanliness.
2012-07-09 22:12:45 -04:00
Antoine Jacoutot
974212ec82 OpenBSD: use G_N_ELEMENTS instead of nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL conditional.
Use G_N_ELEMENTS from GLib which is the proper way of doing this.
2012-07-09 18:20:34 +02:00
Benjamin Otte
b900016a05 a11y: Make lockbutton notify about state changes
In particular, ensure that the name of the lockbutton gets updated as
the displayed text of the lockbutton changes.

https://bugzilla.gnome.org/show_bug.cgi?id=677347
2012-07-09 03:12:13 +02:00
Benjamin Otte
58cf6dfaaf a11y: Get lockbutton text directly
Instead of letting the generic button code attempt to find the currently
displayed text, just return the text directly.

https://bugzilla.gnome.org/show_bug.cgi?id=677347
2012-07-09 02:58:22 +02:00
Benjamin Otte
fb1b025cbf a11y: Add separate accessible for GtkLockButton
The accessible doesn't do anything yet, this is just infrastructure
work.
2012-07-09 02:29:16 +02:00
Benjamin Otte
0dbf5db0e1 a11y: Don't mess up if column gets hidden
We were using a function that insisted on visible columns for computing
the potential ID of an invisible column. Not good.

https://bugzilla.gnome.org/show_bug.cgi?id=675990
2012-07-09 01:28:26 +02:00
Cosimo Cecchi
f30eab099b entry: guard for != NULL before unreffing the pixbuf
In gtk_entry_get_icon_pixbuf() we unreference the pixbuf that
_gtk_icon_helper_ensure_pixbuf() gives us back, since the function
doesn't return a reference, and by doing so we're able to return the
reference owned by the cached icon helper.
Since the icon helper method can return NULL though, if no icon
properties have been set on it, guard for != NULL before unreffing the
pixbuf, as that would cause a critical warning.

https://bugzilla.gnome.org/show_bug.cgi?id=679537
2012-07-08 00:34:33 -04:00
Cosimo Cecchi
5dbf3a576a modelmenu: listen for toplevel changes on the attach widget
Right now, when we create a GtkModelMenu for a GMenuModel, we listen to
changes to the menu's attach-widget to detect when a toplevel
GtkApplicationWindow becomes available to fetch actions from it.

This unfortunately breaks this simple code:

  GtkWidget *application_window = gtk_application_window_new();
  GtkWidget *menu_button = gtk_menu_button_new();
  GMenuModel *menu_model = get_menu_model();

  gtk_menu_button_set_menu_model(menu_button, menu_model);
  gtk_container_add(GTK_CONTAINER(application_window), menu_button);

Since GtkMenuButton creates a GtkModelMenu and sets itself as its attach
widget before it's added to a hierarchy containing a
GtkApplicationWindow.

Fix the bug by simply listening for changes in the window hierarchy, and
creating the menu model when the attach widget is added to an
application window.

https://bugzilla.gnome.org/show_bug.cgi?id=679454
2012-07-06 11:14:15 -04:00
Cosimo Cecchi
f81bd6c52d menu: notify attach-widget property when menu is detached
When the menu is detached, the attach-widget property changes value to
NULL, so we should notify a property change, like
gtk_menu_attach_to_widget() does.

https://bugzilla.gnome.org/show_bug.cgi?id=679454
2012-07-06 11:14:15 -04:00
Cosimo Cecchi
f22226b3c9 application: fix double free of app_id
This is fallout from commit 257b42e2f9 -
those fields were already getting freed in
gtk_application_shutdown_x11() and my commit caused crashes on quit
instead.

Thanks to Rico Tzschichholz for reporting the bug and testing this fix.
2012-07-05 16:40:23 -04:00
Cosimo Cecchi
06c8739de4 modelmenu: set the accel group on the GtkMenu
Or the accelerators added for actions in the menu won't be displayed in
the menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=679166
2012-07-05 10:21:55 -04:00
Cosimo Cecchi
598163e526 menubutton: set DROPDOWN_MENU hint on the menu toplevel
So the WM can render the menu shadows correctly, omitting the top side,
in the common case the menu is rendered down from a toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=679449
2012-07-05 10:16:42 -04:00
Cosimo Cecchi
5a5c33097f gtkstyle: add a gtkstyle-fallback style class for RC colors
As an addition to 1042372670, themes might
want to avoid using the hardcoded GTK defaults for legacy GtkStyle
values. Add a gtkstyle-fallback style class that can be used by themes
to tweak the legacy GtkStyle defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=679092
2012-07-02 10:44:40 -04:00
Cosimo Cecchi
257b42e2f9 application: plug some memory leaks 2012-07-02 10:41:29 -04:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Cosimo Cecchi
d22624b18e menubutton: don't dereference NULL GdkEvent
Since we explictly call popup_menu with NULL when it's
keyboard-activated, we need to be careful and not access event->device
without checking for event != NULL before.
2012-06-29 18:30:53 -04:00
Ryan Lortie
6e11c3106a GActionMuxer: disconnect group signals on finalize
The signals for the action group were being disconnected when the action
group was explicitly removed from the GActionMuxer but the same was not
being done when it was finalized.

This means that a change in the state of an action group that used to be
associated with a finalized GActionMuxer would result in a crash.  This
would happen for stateful application actions after closing a window.
2012-06-28 23:57:57 -04:00
Alexander Larsson
1042372670 Handle transparent colors better in GtkStyle emulation
We can't expose colors with alpha in the GtkStyle colors, since
GdkColor has no alpha. Currently we throw away alpha completely,
which fails very badly for completely transparent backgrounds,
which now is the default for most widgets, as it typically
end up with black-on-black.

We handle this by falling back on the default/previous colors for
transparent colors. This is is simple and avoids complete failure.

https://bugzilla.gnome.org/show_bug.cgi?id=671437
2012-06-28 21:48:14 +02:00
Alejandro Piñeiro
4cfe2a38bf a11y: remove implementation for [add/remove]_global_event_listener
Since release 2.5.3, ATK provides an implementation for those
methods, so toolkits doesn't need to implement them.
2012-06-28 12:38:11 +02:00
Colin Walters
ed8203e700 build: Drop --without-atk-bridge option
Instead, always build it if and only if X11.  This reduces the set of
supported configurations.

https://bugzilla.gnome.org/show_bug.cgi?id=677491
2012-06-26 13:50:39 -04:00
Matthias Clasen
bcdbfa1a9b Don't export private GtkMountOperationHandler api 2012-06-25 16:26:41 -04:00
Cosimo Cecchi
261d2d96e3 radiobutton: add missing (element-type) annotation for radio groups
The GSLists should specify their element-type in every annotation. We
are missing some.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
66a2870bfd menu: add missing (scope async) annotation to gtk_menu_popup()
Or the g-i scanner will emit a warning.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
8ff9770c7f widget: silence g-i scanner warning
The parameter should be named the same in the definition and the
declararion.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
ec1904c779 fontchooser: silence g-i scanner warning
These parameters should be named the same in the definition and the
declaration.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
37bb0ce884 actionable: silence g-i scanner warning
The parameter should be named the same in the definition and the
declararion.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
9992026ca6 application: fix a typo in introspection annotation
https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Alexander Larsson
6c04296f03 Rename gtk_icon_view_get_cell_area to gtk_icon_view_get_cell_rect
get_cell_area was "conflicting" with the property named "cell-area"
which is something different.
2012-06-25 15:07:13 +02:00
Matthias Clasen
a84effadc2 Cosmetics 2012-06-23 13:08:03 -04:00
Matthias Clasen
cea4b80096 Fix a compiler warning
This was introduced in the previous commit.
2012-06-23 13:07:47 -04:00
Matthias Clasen
3056324570 GtkNotebook: Fix reverse tab order
When using Shift-Tab to move the focus out of page content onto
the tab label, we end up in a situation where both Tab and Shift-Tab
move focus back into the page, which is not really what is expected
when the notebook is part of a dialog.

Instead, arrange things so that using Shift-Tab with focus on a
tab label moves the focus out of the notebook.

http://bugzilla.gnome.org/show_bug.cgi?id=669986
2012-06-23 12:37:20 -04:00
Colin Walters
376783f64f gtkdbusinterfaces: Fix srcdir != builddir 2012-06-23 12:19:06 -04:00
Rico Tzschichholz
e28021b3c1 gtk: add gtkdbusinterfaces.xml to EXTRA_DIST 2012-06-23 17:48:27 +02:00
Matthias Clasen
325cf071d1 GtkNotebook: Maintain invariants during tab dnd
It turns out that we can end up removing a notebook child while
the tab is still 'detached'. Child removal causes
gtk_notebook_remove_tab_label() to be called on the tab label,
but that function did not deal with the eventuality that the tab
label may be a child of the dnd window.

http://bugzilla.gnome.org/show_bug.cgi?id=677943
2012-06-23 10:04:14 -04:00
Chun-wei Fan
887f13cf9f gtk/gtkcsseasevalue.c: Remove C99ism 2012-06-23 12:48:32 +08:00
Chun-wei Fan
1eceadbc25 gtk/Makefile.am: Fix Visual C++ disthook rules
gtkdbusgenerated.c needs to be included in the projects as well.
2012-06-23 12:15:59 +08:00
Colin Walters
71e0e72c69 build: Add --without-atk-bridge, only check for it on X11 platforms
Some builders using gtk3 outside of the GNOME cycle want an option to
avoid linking to atk-bridge-2.0.  Provide that, and at the same time
ensure we're only looking for it on X11 platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=677491
2012-06-22 23:49:24 -04:00
Cosimo Cecchi
44fd03eb47 mountoperation: use the Shell DBus proxy if available
Make GMountOperation look for an owner of org.Gtk.MountOperationHandler
if possible, and use it instead of the GTK-based dialogs.
This allows applications to use the implementation offered by the
desktop shell, if available, through a DBus private interface:
org.Gtk.MountOperationHandler.

https://bugzilla.gnome.org/show_bug.cgi?id=674963
2012-06-22 16:49:05 -04:00
Alexander Larsson
fb91fa2fbd Add gtk_icon_view_get_cell_area
This gets the current cell area of a particular item. Its similar
to gtk_tree_view_get_cell_area().

The code is extracted from gtk_icon_view_set_tooltip_cell which now
just calls the old code.

https://bugzilla.gnome.org/show_bug.cgi?id=678418
2012-06-22 13:50:33 -04:00
Dan Vrátil
4243c3a1e2 Fix a memory leak in GtkImage
https://bugzilla.gnome.org/show_bug.cgi?id=678175
2012-06-20 08:27:01 +02:00
Pavel Holejsovsky
7572325efb GtkImage: fix get_property('stock')
The code was trying to get icon's name instead of icon's stock-id.

https://bugzilla.gnome.org/show_bug.cgi?id=678407
2012-06-19 15:58:11 +02:00
Benjamin Otte
9b47bc5c95 widget: don't call gtk_style_context_set_background if app_paintable
When a widget is app_paintable, its background should not be drawn by
the theme, thus we should not try to override its background again when
style-updated is fired.
This is a bit of a hack, but it fixes gray surfaces observed for DnD
windows with recent GTK+.
2012-06-18 10:33:42 -04:00
Bastien Nocera
50cd57020c gtkmenutoolbutton: Use GtkMenuButton
To implement the drop-down menu.

https://bugzilla.gnome.org/show_bug.cgi?id=668013
2012-06-15 17:24:42 +01:00
Bastien Nocera
9fef2dc0d1 gtkmenubutton: Add menu button widget
As used in Totem and gnome-contacts. The widget
takes either a GtkMenu or a GMenuModel to construct
its menu, and can be given a parent widget to use to
position the drop-down (as used in GtkMenuToolButton).

https://bugzilla.gnome.org/show_bug.cgi?id=668013
2012-06-15 17:24:42 +01:00
Bastien Nocera
ffe1e31a2c gtk: Always load the atk-bridge
Slightly modified by Alejandro Piñeiro

https://bugzilla.gnome.org/show_bug.cgi?id=677491
2012-06-15 17:09:19 +01:00
Benjamin Otte
49c618c59c image: Don't add border twice
Failed to delete these lines in d40c496e6e
2012-06-15 03:30:52 +02:00
Benjamin Otte
5c46f81e7b iconview: Special case the empty iconview
If the icon view is empty, we cannot get a reasonable size request from
the cell renderers. So all values we would compute are pretty much
useless.
So we special case it.

This also gets rid of a bunch of crashers from div-by-0 in corner cases.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-15 02:44:45 +02:00
Benjamin Otte
d40c496e6e image: background and border should be drawn around the widget
... not around the contents. If you want the widget to not be larger
than the contents, don't use ALIGN_FILL.
2012-06-14 20:06:39 +02:00
Benjamin Otte
c187386fe1 iconview: Add a descriptive function
I want to special-case empty icon views in the sizing code to avoid
various bugs, and having such a function is nice.
2012-06-14 18:52:09 +02:00
Benjamin Otte
fd4c330500 iconview: Ensure icons are at least 1x1 pixels
This is useful for 2 reasons:
(1) Items actually exist and are clickable
(2) Size computations don't divide by 0

I've not seen problems with this in the wild (mostly because
item-padding defaults to non-0), but noticed this while fixing other
bugs.
2012-06-14 18:44:44 +02:00
Benjamin Otte
62292dc247 iconview: Don't add item-padding
... to item sizes when there are no items.
2012-06-14 07:41:40 +02:00
Benjamin Otte
6d9d87806a iconview: clamp item size to be in [minimum, natural]
Minimum size is necessary so you can see the item. If we can't get that
we need to scroll.
Natural as the maximum is used so that the spacing between items doesn't
increase when resizing the iconview, but empty space is added to the
right/bottom instead.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:40 +02:00
Benjamin Otte
7c1b561194 iconview: Include column spacing in calculation
The function is probably almost never used, so nobody has ever seen this
bug, but we should still get it right.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:40 +02:00
Benjamin Otte
4b83be0e26 iconview: Add documentation abour different sizes
Did I mention I hate code that has different kinds of "boxes" or
coordinate systems but no clear way to distinguish them?
It's all ints here...

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:40 +02:00
Hans de Goede
c32a5a80b7 iconview: gtk_icon_view_compute_n_items_for_size bugfix
While working on the "iconview: Don't shrink items" patch I noticed that
gtk_icon_view_compute_n_items_for_size modifies the natural and minimum
item sizes it got from gtk_icon_view_get_preferred_item_size when
calculating the max number of items which will fit, but later on it
checks against these sizes when calculating the item_size, and these
checks expect these values to be unmodified.

This patch fixes this by modifying the natural and minimum values in
advance and doing all computations with modified values.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:39 +02:00
Benjamin Otte
ec755541ab iconview: Don't shrink items
The previous code assumed that the width was always enough for more than
one column, which is obviously not correct when a number of columns is
hardcoded.

With this patch, it will now always check that the width is enough and
otherwise cause scrolling.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:39 +02:00
Cosimo Cecchi
ad63d1b59e toolbar: don't call gtk_style_context_set_background()
GtkToolbar doesn't have its own GdkWindow to draw on (it calls
gtk_widget_set_has_window(FALSE) in _init), but only an event window
(input-only).
Since gtk_widget_get_window() in that case will return the GdkWindow of
the parent container, by calling gtk_style_context_set_background() here
we're overriding the base background of the container instead of our.
While in most cases this doesn't have any noticeable effect, since
the toplevel GtkWindow will paint its background on top of it at the
beginning of the draw cycle, when the classic window hierarchy is
broken, such as when widgets are rendered through a clutter-gtk
offscreen embedding, the background will become visible, which is
undesirable.
Fix this by having GtkToolbar not call gtk_style_context_set_background
in its style_updated handler.
2012-06-13 20:10:41 -04:00
Matthias Clasen
7e37b45787 Fix up the deprecation annotation for gtk_widget_get_pointer
When I added the versioned annotation, I accidentally backdated
it, so the Deprecated: tag in the docs said 3.4, but the annotation
said 3.0. Fix it so we say 3.4 in both places.
2012-06-13 18:25:17 -04:00
Jasper St. Pierre
bbe0784865 assistant: Set the proper stock images on the proper buttons
Copy/paste typo.
2012-06-13 17:39:08 -04:00