Commit Graph

18411 Commits

Author SHA1 Message Date
Cosimo Cecchi
e9c4dcd3f8 Sync from nautilus commit d2bfffc574c1e6305d862c041b35c9c45ba67674
Coding style fix.
2013-04-20 15:59:04 -04:00
Cosimo Cecchi
755e37ffdf Sync from nautilus commit 277a6a45bee8186b2493ad1b286234ac52f1aed8
Use gtk_tree_view_set_activate_on_single_click().
2013-04-20 15:58:55 -04:00
William Jon McCann
fa1f7d3f97 Sync nautilus commit 95400548176688f3d2f5e8888f48410756bd96b8
Switch location on hovering the places sidebar during a DnD operation -
kind of for spring-loaded folders.
2013-04-20 15:56:59 -04:00
Federico Mena Quintero
3c8cce8f87 Merge branch 'places-sidebar' 2013-04-20 14:56:16 -04:00
Federico Mena Quintero
3b34e70f13 Remove the drop feedback row a little time after drag_leave
Since ::drag-leave gets emitted before ::drag-drop, we can't just remove the drop feedback row
in drag-leave, as we *need* it during drag-drop.  So, we use the same trick as in testdnd.c - we
install a timeout handler in our drag-leave callback, and remove the feedback in the timeout callback.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-20 14:53:03 -04:00
Federico Mena Quintero
9c38ff7dfb Drop in the right place when the feedback row is active
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-20 14:53:03 -04:00
Federico Mena Quintero
3083308d1c Actually use the drop_state, instead of encoding things in new_bookmark_index
This lets us keep the new_bookmark_index untouched even when the drop state goes from armed to unarmed.
That will in turn let us drop in the right place...

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-20 11:42:04 -04:00
Federico Mena Quintero
cab1d6712d Merge branch 'places-sidebar' 2013-04-19 17:26:39 -05:00
Federico Mena Quintero
2db8e25cdb treeview: Use equal areas in the computation of drag dest row positions
We used to divide the row in thirds vertically, and use the outer thirds for GTK_TREE_VIEW_DROP_BEFORE and AFTER, respectively.

Now we use *fourths*.  This is so that we get equal areas for these:

  GTK_TREE_VIEW_DROP_BEFORE
  GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
  GTK_TREE_VIEW_DROP_INTO_OR_AFTER
  GTK_TREE_VIEW_DROP_AFTER

This makes hovering tree rows much more positive.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:24:03 -05:00
Federico Mena Quintero
a1b9bf7fbc Adjust the drag destination row when it is above the currently highlighted row
This makes the feedback accurate and without hysteresis.  Haven't I written this code ten times before?

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:24:03 -05:00
Federico Mena Quintero
3815f5d956 Dropping on the feedback row is always possible
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:24:03 -05:00
Federico Mena Quintero
bc0a9a33b0 Add a temporary row for feedback when inserting a bookmark is possible
We'll prettify this gradually.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:23:55 -05:00
Matthias Clasen
264b4bf118 extract-strings: Deal with multiline strings
When putting out N_(...) macros, we must split multiline strings,
otherwise xgettext complains.
2013-04-19 15:22:03 -04:00
Federico Mena Quintero
624b352d77 Move the drop feedback code to stub functions
For now it is the old, simple call to gtk_tree_view_set_drag_dest_row().  We'll do something
fancier in the following commits.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 11:30:23 -05:00
Federico Mena Quintero
7d52dff5ec Add a DropState enum to the internal state of the sidebar
We want to show a little animation when a DnD operation is happening and the user hovers
between existing bookmarks.  The animation should indicate the user that he's about to
create a new bookmark from the file right there.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 11:20:13 -05:00
P. F. Chimento
29c7562ca7 doc: Documented icon-shadow CSS property
The docs say that text-shadow applies a drop shadow to both text
and icons, but icons need to use the icon-shadow property.

https://bugzilla.gnome.org/show_bug.cgi?id=698181
2013-04-19 10:19:25 -04:00
Matthias Clasen
163542f545 Fix mouse interaction in combo cell renderer
Pass the event on when calling gtk_cell_editable_start_editing.
https://bugzilla.gnome.org/show_bug.cgi?id=504901
2013-04-19 10:11:48 -04:00
Ryan Lortie
a37ddbe74b menu binding docs: Link to insert_action_group()
It's pretty useless to make a menu without actions behind it and people
who are using gtk_menu_shell_bind_model() directly are probably not
interested in doing it the GtkApplicationWindow way (so they won't get
the "app" and "win" groups for free).  People are going to need to call
gtk_widget_insert_action_group(), so mention this in the docs to help
them along.
2013-04-18 07:11:15 -04:00
Christian Persch
9f0ee69552 bindings: Fix gtk_binding_entry_skip
This fixes a regression from commit 9a3466832c.

https://bugzilla.gnome.org/show_bug.cgi?id=695380
2013-04-17 13:21:44 +02:00
Juan Pablo Ugarte
1a06842425 GtkSwitch: moved focus drawing from outside border inside the handle. 2013-04-16 03:16:43 -03:00
Federico Mena Quintero
3b3eb4bdbc Merge branch 'merge-places-sidebar'
This is the new GtkPlacesSidebar widget, which is the sidebar used in
GtkFileChooser to display a list of places/folders that the user may
want to use.  File managers are encouraged to use this widget for
their own global list of folders.
2013-04-15 19:29:37 -05:00
Tristan Van Berkom
a6f9ef0d3a Load the file chooser's widgets from the .ui file
This is Tristan's *excellent* work, minus the old code for the shortcuts bar - that is all done
in GtkPlacesSidebar now.

The UI gets loaded from a Glade resource; most of the old code to create the UI by hand is gone.

There is still code for save_widgets_create(); this needs to be moved into the UI file, but it
is not a big deal.

gtk_file_chooser_default_init() calls a new post_process_ui() that takes care of all the things
that cannot be done directly in Glade.
2013-04-15 19:29:12 -05:00
Federico Mena Quintero
1d946367d3 For now, add GtkPlacesSidebar to the Glade catalog for private widgets
Although GtkPlacesSidebar is a public widget, we can't have that in Glade's general catalog
as this branch is not merged into GTK+ proper yet.  We'll move the widget to Glade's
catalog when this is done.
2013-04-15 19:29:12 -05:00
Federico Mena Quintero
c297d4de68 Add .ui file for GtkFileChooserDefault 2013-04-15 19:29:12 -05:00
Simon Kågedal Reimer
d29a441106 doc: Clarify gtk_widget_queue_draw_region() doc 2013-04-15 15:43:26 +02:00
Alban Browaeys
ad764c8a58 print: disconnect source_changed_handler on printeroptionwidget finalize
Printing a web page without window.print (which still segfault),
that is Ctrl+P is fixed (does not attempt to execute the
source_changed_handler on a printeroptionwidget that has been
destroyed) by disconnecting this handler in the printeroptionwidget
finalize.

https://bugzilla.gnome.org/show_bug.cgi?id=696622
2013-04-14 20:20:14 -04:00
Carlos Garcia Campos
c737e1d194 gtkprintjob: release the surface and backend before the output io channel
If the GtkPrintJob is freed too early when the surface has been created
but the job hasn't been sent to the printer, it's possible that the
file print backend tries to write to the io chaneel when it is already
closed. This produces runtime critical warnings:

GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel->is_writeable' failed

https://bugzilla.gnome.org/show_bug.cgi?id=685420
2013-04-14 12:19:09 +02:00
ammonkey
4445dce697 fix mem leak in gtk_drag_set_icon_surface, destroy pattern
https://bugzilla.gnome.org/show_bug.cgi?id=681446
2013-04-13 20:06:43 -04:00
Matthias Clasen
83e104b093 Revert "Use natural size to set adjustment ranges"
This reverts commit 666d10ec76.

This change severely broke any treeviews without horizontal
scrollbars. Basically, ellipsization never kicks in, and instead
the treeview content just extends outside the visible area,
rendering it inaccessible. This broke e.g. the control-center
keyboard shortcuts panel, the gnome-disks device list, etc etc.
2013-04-13 16:24:10 -04:00
Matthias Clasen
ff56d02d7b csd: Don't use a content_window for o-r windows
This fixes drawing of dnd icons.
https://bugzilla.gnome.org/show_bug.cgi?id=697886
2013-04-12 22:49:40 -04:00
Federico Mena Quintero
4d4904ed8a Move all of GtkFileChooserDefault's fields into a private structure
I love Emacs macros, by the way.
2013-04-11 22:44:19 -05:00
Federico Mena Quintero
b0eed8680c Move GtkFileChooserDefault to gtkfilechooserdefault.c
We will move all the fields to a private structure next.
2013-04-11 21:44:21 -05:00
Federico Mena Quintero
e2c9797994 Move GtkFileChooserWidgetPrivate to gtkfilechooserwidget.c
In addition, remove the unused "file_system" field from that
structure.
2013-04-11 20:51:09 -05:00
Federico Mena Quintero
70fce923bc Move GtkFileChooserDialogPrivate into gtkfilechooserdialog.c
We'll take private structures out of gtkfilechooserprivate.h and move
them to the appropriate place.
2013-04-11 20:46:47 -05:00
Federico Mena Quintero
456c318f6e Remove unused #define 2013-04-11 20:42:43 -05:00
Federico Mena Quintero
9a3bc21dc9 Don't include gtkfilechooserprivate.h from the file chooser's tests
We will make that file a fully private header; the tests have no
business poking inside the file chooser's internals at this point.
2013-04-11 20:40:05 -05:00
Federico Mena Quintero
d3985dec1d GtkPlacesSidebar: Hold a reference to the sidebar while a D-Bus proxy is being created
The creation is async, and the sidebar could be destroyed while the D-Bus proxy is being created.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-11 20:04:53 -05:00
Federico Mena Quintero
5b827c53e5 Merge branch 'places-sidebar' into master
This lands the GtkPlacesSidebar widget.  It is used in
GtkFileChooserDefault, and it can also be used by third-party
applications.
2013-04-11 19:45:12 -05:00
Federico Mena Quintero
21083978f0 Revert "GtkFileChooserDefault: Define children with a GtkBuilder template"
Having the changes for composite widget templates makes it impossible
to merge the places-sidebar branch.  So, we will merge that branch,
and *then* apply the changes for composite templates.

This reverts commit bf909f5615.
2013-04-11 16:47:38 -05:00
Alexander Larsson
5ac3edf77f Update gtk.symbols
This fixes win32 build
2013-04-11 11:25:26 +02:00
Alexander Larsson
8c61659225 win32: Fix build
Need to take ".exe" into account for file dependencies on win32.
2013-04-11 11:25:26 +02:00
Matthias Clasen
c402e89299 csd: Use symbolic icons for window buttons
With symbolic icons, we can recolor the icons as needed, and we
can use icon shadows, etc.
2013-04-10 06:13:26 -04:00
Chris Cummins
e707eadaf2 Update GtkCssProvider box-shadow documentation
Non-inset box-shadows are no longer ignored by the GTK+ theming engine,
outset shadows are supported.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-04-09 12:52:52 +01:00
Chris Cummins
f478f16dba cds: enable outset shadows
Adds conditional code paths to GdkCssShadowValue for painting outset
shadows, and allows shadows to be applied in two passes (first outset
then inset). This can be used to draw csd shadows in outer window
borders.

https://bugzilla.gnome.org/show_bug.cgi?id=695998
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-04-09 12:52:47 +01:00
Carlos Garnacho
7ffcd85d13 quartz: Fix call to missing symbol
This patch can be considered a leftover of commit 6f607fc8b4 ,
replace the no longer existing function with the GDK function
meant to replace it.

This was noticeable on regular clipboard operations in quartz
2013-04-09 12:38:46 +02:00
Benjamin Otte
c4dc0e8e40 window: Remember current size
Don't just look at previously remembered sizes, also look at the current
size.
This is useful for cases where the window was resized by the user or WM
and not by the application itself.

https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-04-09 12:09:12 +02:00
Benjamin Otte
70dbb14f89 window: Split out a function
We don't want to remember sizes in the not resizable case. Also a
function named "guess_default_size" should not look at previous sizes,
it should guess.
2013-04-09 12:09:12 +02:00
Benjamin Otte
33f1210f72 window: Remove an unused function.
Luckily, we don't need to support an implementation of a minimal WM for
linux-fb anymore (which is what this function was added for).
2013-04-09 12:09:12 +02:00
Benjamin Otte
72290fb538 docs: Fix Since tag for frame clock functions 2013-04-09 12:09:11 +02:00
Benjamin Otte
21f11eb0e6 window: restore size after hide/show properly
Old code assumed the size was stored in widget.allocation. This is no
longer true as the allocation is cleared upon hide. However, we store
the last configure request, and that one tracks the last size, so we can
just use that number.

Sometimes things are so easy - once you figure them out...

https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-04-08 16:34:19 +02:00
Benjamin Otte
b662e96e7e plug: Don't unregister windows that were never registered
Fixes warnings when trying to unregister the socket window. The socket
window is foreign, so we shouldn't register it in the first place.

https://bugzilla.gnome.org/show_bug.cgi?id=697427
2013-04-08 16:34:19 +02:00
Colin Walters
5e7df8bf14 build: Fix srcdir != builddir 2013-04-08 10:16:58 -04:00
Matthias Clasen
d90ddf85f6 Extract strings from .ui files without intltool 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
92a8c76b31 GtkVolumeButton: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
36bacc4674 GtkFontButton: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
4c81151a20 GtkFileChooserButton: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
42f53ab58e GtkPathBar: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
0f3ef7eea6 GtkColorEditor: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
65080c6755 GtkColorPlane: Added construct-only properties to setup the adjustments.
This allows basic construction of this private type in GtkBuilder script,
so it can be used in the GtkColorEditor UI.
2013-04-08 21:19:29 +09:00
Tristan Van Berkom
9accb95b9f GtkPrintUnixDialog: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
0f16d7c6d5 GtkPageSetupUnixDialog: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
a58412027f GtkRecentChooserDefault: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
6f8162a2e1 GtkFontChooserDialog: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Tristan Van Berkom
21391027c4 GtkFontChooserWidget: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
b537e1badd GtkFileChooserDialog: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
bf909f5615 GtkFileChooserDefault: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
09b44d7ab5 GtkColorChooserDialog: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
d50516ebd7 GtkAppChooserDialog: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
ae690479a0 GtkAppChooserWidget: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
c6aa7cc92d GtkStatusbar: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
b9fd422aca GtkScaleButton: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
90cd240c6d GtkAssistant: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
3c39c388c9 GtkLockButton: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
67a2cdb303 GtkAboutDialog: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
56167944e5 GtkInfoBar: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
671871b43e GtkMessageDialog: Define children with a GtkBuilder template 2013-04-08 21:19:27 +09:00
Tristan Van Berkom
33f6195d0e GtkDialog: Define children with a GtkBuilder template
As the first composite widget in GTK+, this patch also
adds some Makefile mechanics to list the ui files as
dependencies of the global GTK+ resources, and adds the
initial test case where composite classes should be tested.
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
a41c628a3b Added directory with Glade catalog
This catalog can be used to work with GTK+'s private widget types,
this patch exposes a private function gtk_glade_catalog_init() which
Glade will use for the sole purpose of initializing some private widget
types in GTK+ that are referenced from various GTK+ composite widget
xml files.
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
3b7fc8cdc9 Add Composite Child machinery and APIs to GtkWidget
This commit implements the needed machinery for GtkWidget
to build it's composite content from GtkBuilder XML and
adds the following API:

  o gtk_widget_init_template()

    An api to be called in instance initializers of any
    GtkWidget subclass that uses template XML to build it's components.

  o gtk_widget_class_set_template()

    API to associate GtkBuilder XML to a given GtkWidget subclass

  o gtk_widget_class_automate_child()

    API to declare an object built by GtkBuilder to be associated
    with an instance structure offset and automatically set.

 o gtk_widget_get_automated_child()

   API for bindings to fetch a child declared to be automated by
   gtk_widget_class_automate_child(), for the case where bindings
   do not generate GObjects under the hood and cannot use structure
   offsets to resolve composite object pointers.

 o gtk_widget_class_declare_callback[s]()

   Declare static functions to be used in signal callbacks from
   a given class's template XML

 o gtk_widget_class_set_connect_func()

   API for bindings to override the signal connection machinery
   for a given GtkWidget derived class.
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
64b87824c7 GtkBuilder: Allow G_PARAM_CONSTRUCT properties to be set on internal children.
This patch allows properties of type G_PARAM_CONSTRUCT to be set
on internal children or explicitly constructed objects (built
with <constructor>) while previously, G_PARAM_CONSTRUCT properties
being set on already constructed objects would result in an misinformed
warning that "construct-only properties cannot be set".

G_PARAM_CONSTRUCT_ONLY properties are still refused as parameters
to already constructed children.
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
b7da0d21f8 GtkBuilder: Add private _gtk_builder_extend_with_template()
This adds the definition of the <template> tag with some documentation
on the variant of the format.

_gtk_builder_extend_with_template() is to be used while GtkContainer
builds from composite templates. A couple of error codes are also added
to handle a few new possible failure cases.

DTD Files gtkbuilder.rnc and gtkbuilder.rng have been updated to include
the new <template> tag and it's attributes.
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
82583640a2 GtkBuilder: Added api to allow private signal callbacks
In preperation for composite objects, for better encapsulation
the following APIs are added to allow handling of signals declared
in the XML with callbacks declared statically.

  o gtk_builder_add_callback_symbol[s]()

    Adds a symbol to the internal symbol hash

  o gtk_builder_lookup_symbol()

    Looks up a symbol, exposed in case added symbols are used
    in conjunction with gtk_builder_connect_signals_full()

The default implementation of gtk_builder_connect_signals() now
does not have a strong requirement on GModule (or a strong requirement
on symbols being declared in the global namespace). Instead GModule
is used as a fallback in the case that symbols are not declared
explicitly.
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
4ec6d6006e Work around access to global resources without calling gtk_init()
Some utilities such as GIR and gtk-doc, initialize class vtables without
initializing GTK+, with composite templates accessing resources this
causes a hand full of unneeded warnings.

The workaround for now is the use a private function _gtk_ensure_resources()
which is both called while initializing GTK+, and at the beginning of
gtk_widget_class_set_template_from_resource() (the private function
ensures that the resource will only ever be registered GOnce).
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
c6ab515735 Deprecate gtk_widget_push_composite_child & friends
Deprecate gtk_widget_push_composite_child, gtk_widget_pop_composite_child,
gtk_widget_set_composite_name, gtk_widget_get_composite_name.

This API is just bloat and was never useful, this patch deprecates
it and removes all internal calls to the composite child APIs
2013-04-08 21:19:27 +09:00
Tristan Van Berkom
38dc4733c0 GtkScale: Properly chain up in GtkBuildableIface->custom_finished()
This was causing <style> markup to be ignored when specified
on GtkScale types.
2013-04-08 21:18:47 +09:00
Matthias Clasen
e47689d9ea csd: Implement hide-titlebar-when-maximized 2013-04-06 17:24:29 -04:00
Tristan Van Berkom
909e82a2a6 GtkRecentChooserMenu: avoid accessing a NULL action
When the GtkActivatable sets the related action, the activatable
properties are sync'ed. In this case the null check is important
to avoid updating from a NULL action.
2013-04-06 18:46:20 +09:00
Tristan Van Berkom
fbb9447785 gtk_recent_chooser_set_filter: Allow NULL value to unset the filter.
While GtkRecentChooser implementations accept for the "filter" property
to unset the current filter, the API fires an unneeded assertion.

This patch removes the assertion.
2013-04-06 18:06:51 +09:00
Benjamin Otte
b315868663 gtk: Simplify code for reduced screen count 2013-04-06 10:47:55 +02:00
Benjamin Otte
e255cf15fb icontheme: Remove unused function 2013-04-06 10:47:55 +02:00
Tristan Van Berkom
c771a8a3a6 objects-finalize test: Blacklist gdk_pixbuf_simple_anim_iter_get_type() 2013-04-05 21:11:13 +09:00
Tristan Van Berkom
33b9865651 Added test case to assert all object types finalize properly.
The test case uses a weak ref to assert objects can finalize,
and then spins the main loop shortly after finalizing to assert
that the finalized object did not leak GSources into the main context
causing latent crashes.
2013-04-05 20:14:38 +09:00
Alexander Larsson
a2c65d47b0 Fix gtk_window_set_opacity()
We *do* want to call gdk_window_set_opacity() on toplevels, because
this particular case does work.

https://bugzilla.gnome.org/show_bug.cgi?id=697263
2013-04-04 15:42:02 +02:00
Pavel Vasin
edbb522f1f GtkHeaderBar: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=696767
2013-04-03 19:20:54 -04:00
Sébastien Wilmet
14c9023a05 GtkWindow: fix notify of :attached-to
https://bugzilla.gnome.org/show_bug.cgi?id=697200
2013-04-03 19:32:21 +02:00
Cosimo Cecchi
a60ddd9a02 window: don't schedule a display of mnemonics if window has no modifier
When the window has no mnemonics modifier set, as in the case of a
GtkMenu, never schedule a display of mnemonics on focus-in.

Previously, for those windows, the GdkModifierType mask fetched from the
device would typically have been zero, leading to the

mnemonic_modifier == (mask & gtk_accelerator_get_default_mod_mask ())

check to succeed, so we would always trigger a display for popup menus.

https://bugzilla.gnome.org/show_bug.cgi?id=697144
2013-04-02 17:39:44 -04:00
Cosimo Cecchi
cfb1e56561 window: refactor a function
Instead of having maybe_set_mnemonics_visible(), separate the checks
from the actual scheduling of mnemonics display.

https://bugzilla.gnome.org/show_bug.cgi?id=697144
2013-04-02 17:39:43 -04:00
Cosimo Cecchi
58209e1138 window: rename functions dealing with mnemonic delayed display
Don't mention "auto mnemonics", since those methods are purely about
scheduling a delayed display, and that makes understanding the code a
bit harder.

https://bugzilla.gnome.org/show_bug.cgi?id=697144
2013-04-02 17:39:42 -04:00
Cosimo Cecchi
68b437eea2 window: reset timeout source id before setting property
gtk_window_set_mnemonics_visible() will try to g_source_remove() it
otherwise, which seems harmless, but conceptually wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=697144
2013-04-02 17:39:39 -04:00
Benjamin Otte
e69e609bd7 style: Add missing deprecation markers
Some functions in gtkstyle.h were overlooked when we added the
GDK_DEPRECATED macros.

Also add IGNORE_DEPRECATIONS to the few remaining callers of those
functions.
2013-04-02 11:45:45 +02:00
Benjamin Otte
f47f94be42 window: Remove call to gtk_widget_reset_rc_styles()
First of all, that call is deprecated. Second, we don't have RC styles
anymore. Third, what that function does today is invalidate style
contexts, but that happens automatically when setting the screen on the
style context later.

So this function is completely unnecessary.
2013-04-02 11:45:44 +02:00
Benjamin Otte
225dec6940 celrendererspinner: Don't use deprecated API 2013-04-02 11:45:44 +02:00
Benjamin Otte
231520af8f widget: Get rid of deprecation warnings 2013-04-02 11:45:44 +02:00
Ryan Lortie
45a94ccc88 tests: improve gtkmenu testcase
Don't just create a menushell and populate it with random data -- verify that
the resulting menu layout is actually correct.

This is introduced in a separate commit because the old code was failing this
part of the test.

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:20 -04:00
Ryan Lortie
5617b58420 Introduce GtkMenuTracker
GtkMenuTracker folds a nested structure of sections in a GMenuModel into
a single linear menu, which it expresses to its user by means of 'insert
item at position' and 'remove item at position' callbacks.

The logic for where to insert separators and how to handle action
namespaces is contained within the tracker, removing the need to have
this logic duplicated in the 3 or 4 places that consume GMenuModel.

In comparison with the previous code, the tracker no longer completely
destroys and rebuilds menus every time a single change occurs.  As a
result, the new gtkmenu testcase now runs in approximately 3 seconds
instead of ~60 before.

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:19 -04:00
Ryan Lortie
e250e52175 tests: add a test for gtk_menu_shell_bind()
Borrow the RandomMenu code from the GLib testsuite and hook it up to
gtk_menu_shell_bind().

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:19 -04:00
Sébastien Wilmet
d599985a41 gtktextattributes: move comment above relevant struct
https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
a5f52afd38 GtkTextTagTable: simplify a bit the code
https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
97dfcc1073 GtkTextView: remove some dead code
https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
6f990fa7e4 gtktextattributes: explain what is "pg_bg"
I didn't know what "pg" stands for.

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
3a8f70dd1e gtktextattributes: include the right headers
Some function prototypes in gtktexttagprivate.h are implemented in
gtktextattributes.c.

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
fd84704d94 gtktexttypes: remove inline_byte_begins_utf8_char()
The function was used only in gtk_text_byte_begins_utf8_char().

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Benjamin Otte
cbee390148 cssvalue: At cycle detection to color resolving
The following CSS would infloop:

@define-color self @self

as it would infinitely lookup the color named "self" and try to resolve
it. This patch adds detection of such cycles to the resolve function by
keeping a list of currently resolving colors in the cycle_list variable.
2013-03-28 23:18:59 +01:00
Benjamin Otte
c25d8e3aea cssvalue: Handle named colors not resolving
If a named color references a nonexistant named color, we didn't catch
that error and ended up crashing on a NULL-dereference.
This crashed Boxes, because its CSS referenced values from the theme
that didn't exist in any theme.
2013-03-28 23:18:59 +01:00
Benjamin Otte
dded6a0673 menuitem: Remove old themeing enhancement
CSS doesn't allow themeing parents based on the state of their children,
so this code just causes extra redraws today.
2013-03-28 23:18:59 +01:00
Benjamin Otte
d20ac0acf9 menushell: Remove unused header 2013-03-28 23:18:58 +01:00
Benjamin Otte
436af3fcb5 menu: Move enum declaration to correct header
That enum is used in GtkMenuShellClass, so put it there.
2013-03-28 23:18:58 +01:00
Benjamin Otte
030c65f299 tearoffmenuitem: Use public API, don't poke GtkMenuPrivate 2013-03-28 23:18:58 +01:00
Alexander Larsson
7df7e092b9 GtkOverlay: Respect overlay child min size
Never allocate an overlayed child less than its minimum request.
If the minimum doesn't fit we will gracefully clip via the
widget window.

https://bugzilla.gnome.org/show_bug.cgi?id=696623
2013-03-28 13:32:09 +01:00
Alexander Larsson
785a916267 GtkOverlay: Don't allocate child except in size_allocate
We were calling gtk_overlay_child_allocate() both in realize
and in add as we wanted to create and position the child windows
for the widgets. However, this call also actually called
gtk_widget_size_allocate() on the child, which it shouldn't. In some
cases the overlay is realized before being allocated, and thus it
will allocate the child at 0x0 which is an invalid size for it to be in.
In particular, if the child has margins set this will result in negative
allocations and warnings.

This fix splits out the allocation computation so that
gtk_overlay_create_child_window can use it without callers
having to call gtk_overlay_child_allocate() to move the windows.

https://bugzilla.gnome.org/show_bug.cgi?id=696623
2013-03-28 13:32:06 +01:00
Kristian Rietveld
6f607fc8b4 quartz: move atom/pasteboard type conversions functions to GDK
(cherry picked from commit a269c2f8d2)
2013-03-28 13:10:38 +01:00
Matthias Clasen
93efaa5ebe Fix GtkApplicationWindow menubar placement
Since the menubar is part of the content, we need to give
it the content_window as parent window, to make things
work again.
https://bugzilla.gnome.org/show_bug.cgi?id=696561
2013-03-27 00:23:19 -04:00
Matthias Clasen
bdfd0d4638 Don't return FALSE from a non-boolean function
https://bugzilla.gnome.org/show_bug.cgi?id=696608
2013-03-26 23:30:10 -04:00
Sébastien Wilmet
6cb2816c45 GtkWidget: add missing deprecation marks
https://bugzilla.gnome.org/show_bug.cgi?id=696138
2013-03-24 14:22:38 -04:00
Sébastien Wilmet
30788062f7 GtkLabel: fix underlining of mnemonics
The underscore was shown in front of the mnemonic instead of underlining
it (e.g., _Save).

Thanks to Lars Uebernickel.

https://bugzilla.gnome.org/show_bug.cgi?id=674759
2013-03-24 15:07:40 +01:00
Matthias Clasen
d1ad324d3d csd: Reparent the content
This lets us avoid problems with cursor changes.
2013-03-24 01:15:33 -04:00
Matthias Clasen
65cd2a59c3 Make gtk_init_check work as expected
When no GDK backend can be initialized (either because
GDK_BACKEND has been set to the wrong value, or the backends
are simply not included), the expectation is that gtk_init_check
should return FALSE, not error out.
This commit makes it so, by using gdk_display_manager_peek
instead of gdk_display_manager_get in code paths that are used
during initialization.
2013-03-23 19:41:39 -04:00
Tarnyko
0f59ff4550 win32: Bring back spinner animation
Define the spinner animation in css.
https://bugzilla.gnome.org/show_bug.cgi?id=696202
2013-03-23 17:42:55 -04:00
Colin Walters
4f0e9cbf81 gtktoolpalette: Only call gdk_atom_intern when we're constructed
Otherwise we end up trying to instantiate a display manager in
class_init which breaks introspection scanning.

https://bugzilla.gnome.org/show_bug.cgi?id=696457
2013-03-23 17:07:15 -04:00
Tarnyko
7ffaab3f91 win32: Improve GtkAssistant theming
The highlighted color chosen for GtkAssistant header font
(deep blue) makes it hardly readable is most cases. Switch
to light gray.
https://bugzilla.gnome.org/show_bug.cgi?id=696171
2013-03-23 15:47:39 -04:00
Matthias Clasen
cc86a7bb7e Add gtk_grid_remove_{row,column}
It is sometimes convenient to deal with entire rows or
columns at a time.
https://bugzilla.gnome.org/show_bug.cgi?id=695994
2013-03-23 15:43:37 -04:00
John Lindgren
666d10ec76 Use natural size to set adjustment ranges
This is an (unintentional) side effect of my changes to GtkTreeView's
get_preferred_size() implementation.  It seems odd to me that
GtkTreeView directly determines its own size when inside a
GtkScrolledWindow, but since it does, it should be using its natural
size, not its minimum size.
2013-03-23 19:49:03 +01:00
Vadim Godunko
55012318a6 Fix drawing of grid lines in RTL
The vertical grid lines were not properly positions in
RTL locales.
https://bugzilla.gnome.org/show_bug.cgi?id=696051
2013-03-23 14:01:35 -04:00
Tristan Van Berkom
1a088d3aba GtkBuilder: Fixed documentation
The documentation was referring to an <external-object> tag
which we never implemented
2013-03-23 20:44:12 +09:00
Matthias Clasen
75f4f7a471 Update cursor theme on wayland
Call the new new api from gtksettings.c when it changes, just
as we do for X11.
https://bugzilla.gnome.org/show_bug.cgi?id=696428
2013-03-22 20:33:47 -04:00
Cosimo Cecchi
5568dcb53c appchooserbutton: filter out applications not supposed to be visible
Ensure NoDisplay=true applications don't end up in the list populated by
GtkAppChooserButton.

https://bugzilla.gnome.org/show_bug.cgi?id=696405
2013-03-22 15:27:41 -04:00
Matthias Clasen
69f12b1090 Don't react to clicks in content
This breaks way too many things, and we explicitly trigger
drags from menubars and toolbars, where we want it.
2013-03-21 18:07:21 -04:00
Matthias Clasen
02a0759c5d csd: Make link activation work reliably
The label code was just letting some button press events bubble
up, which caused misbehaviour with the window dragging code.
https://bugzilla.gnome.org/show_bug.cgi?id=695506
2013-03-21 18:07:21 -04:00
Matthias Clasen
6eaa5ffa8a csd: Allow moving maximized windows
This make the nice 'snap off' feature of gnome-shell work
with client-side decorations. weston moves the maximized window
around, which is less ideal...
2013-03-21 18:07:21 -04:00
Cosimo Cecchi
8fd9575ab6 window: don't add the background style class when drawing CSD elements
We already set it in init, so this is just redundant.
The additional window-content style class here is needed so that we can
distinguish between the full X window background and the background for
the actual window contents.
2013-03-21 16:32:00 -04:00
Cosimo Cecchi
4bcaadac51 window: add a "client-decorated" style class when the window is so
The theme might want to apply some specific theming to a client
decorated toplevel window, so add a style class for that.
2013-03-21 16:31:14 -04:00
Matthias Clasen
329f7af159 Fix DND
The removal of the Motif DND code accidentally changed the
value of the TARGET_DELETE enumeration value, breaking DND
pretty badly.
2013-03-21 00:00:19 -04:00
Matthias Clasen
2bc313c624 GtkColorChooserDialog: make alternative button order work
The alternative button order that we set did not actually
work, since the ok button did not have a response id.
Partial fix for
https://bugzilla.gnome.org/show_bug.cgi?id=695493
2013-03-21 00:00:19 -04:00
Matthias Clasen
98801b07b4 GtkColorChooser: Fix selection of colors
Prevent the new window dragging code from interfering with
selection of colors on button release, by handling button
presses we care about instead of letting them bubble up to
the window.
Partial fix for
https://bugzilla.gnome.org/show_bug.cgi?id=695493
2013-03-20 22:21:16 -04:00
Matthias Clasen
da2a102adb GtkWindow: clean up button event handling
We were not translating event coordinates to the toplevel
window, thus the regions we determined were not right.
We were also not respecting the maximized state, and we
were unnecessarily refusing to handle events when not decorated.
https://bugzilla.gnome.org/show_bug.cgi?id=696197
2013-03-20 18:21:12 -04:00
Alexander Larsson
76e466197a GtkWidget: Handle style updates before realize
If the style changes before we're realized we will delay the
style-updated signal until realize. However, we then lose
the changes bitmap. This means that gtk_widget_real_style_updated()
must treat a NULL change as "everything changed" and queue a resize.
2013-03-20 13:56:16 +01:00
Matthias Clasen
3731a2bd90 GtkHeaderBar: Add subtitle support
As seen in GdHeaderBar.
2013-03-19 22:07:26 -04:00
Matthias Clasen
d42c2c3f19 GtkHeaderBar: Survive toggling custom / non-custom titles
The code was always adding a label widget as a child, but
then skipping over it in forall if a custom_title was present.
This confuses internal logic of GTK+ which assumes that it
can iterate over the entire widget hierarchy with forall,
to maintain state. Fix this by destroying the label when
a custom_title is set, and recreating it as needed.
2013-03-19 20:52:54 -04:00
Matthias Clasen
3289b3efbf GtkHeaderBar: Don't leak
Should have a finalize function, if there's strings to free.
Also avoid some pointless extra ref on custom title widgets.
2013-03-19 20:35:28 -04:00
Rob Bradford
8cdbee7fd2 window: Use update_window_buttons to hide title on fullscreen
The function update_window_buttons shows or hides the title header after it
has finished updating the visibility of the various buttons. Unfortunately
this
conflicted with the hiding of the title done when going fullscreen.

This solves the problem and fixes the rendering of fullscreen applications by
using update_window_buttons to control the visibility of the box in the
fullscreen case.
2013-03-19 19:48:35 +00:00