Commit Graph

19010 Commits

Author SHA1 Message Date
Benjamin Otte
c417bf6d73 cellrendererpixbuf: Always follow state
... not just in PRELIT | SELECTED.
2013-09-05 18:48:46 +02:00
Matthias Clasen
930f580857 Trivial formatting fixes 2013-09-04 20:59:56 -04:00
Jiro Matsuzawa
e2036a3986 Fix a typo in an error message
https://bugzilla.gnome.org/show_bug.cgi?id=707488
2013-09-04 19:40:59 -04:00
Alexander Larsson
5ed8db986f GtkListBox: ref_sink new object in set_header and set_adjustment
These are taking ownership of the object in the hierarchy, so should
sink any floating refs to make it easy to use in C code.
2013-09-04 21:01:50 +02:00
Jasper St. Pierre
d6559251fb gtkwidget: Fix issues with baseline alignment comparison 2013-09-03 17:59:19 -04:00
Giovanni Campagna
ed9f55d521 wayland: restore support for the application menu
If the compositor supports the gtk-shell interface, use it to
export the application ID, dbus name and paths that can be used
for the application menu.

https://bugzilla.gnome.org/show_bug.cgi?id=707129
2013-09-03 17:03:43 +02:00
Paolo Borelli
fa3a0963ee textview: Use guint since we specify ": 1" 2013-09-01 12:16:27 +02:00
Mike Gorse
3f2aacca52 a11y: Check whether a widget is mapped before querying its parent
Call gtk_widget_get_mapped() in a couple of places before looking at the
widget's parent, since it might be set to a widget that has been
finalized, causing an invalid read.
2013-08-31 16:42:07 -05:00
Cosimo Cecchi
89214cad5b pathbar: fix positioning of the down slider button
So that it's always linked with the rest of the pathbar.

https://bugzilla.gnome.org/show_bug.cgi?id=706722
2013-08-31 17:25:49 -04:00
Cosimo Cecchi
c9cc58de49 pathbar: remove unused spacing private member
It's always zero.

https://bugzilla.gnome.org/show_bug.cgi?id=706722
2013-08-31 17:25:49 -04:00
Matthias Clasen
68b34b1bba GtkPathBar: Don't make current dir bold
This is closer to the nautilus path bar.

https://bugzilla.gnome.org/show_bug.cgi?id=706451
2013-08-31 17:25:49 -04:00
Matthias Clasen
5c90b46722 Revert "a11y: Check whether a widget is mapped before querying its parent"
This reverts commit 7e3db6fdd3.

It broke the testsuite.
2013-08-31 16:27:38 -04:00
Jasper St. Pierre
de1f5b8bb3 gtkwindow: Don't set an opaque region if the window is app-paintable
This means the background is effectively unused. This fixes bad drawing
errors with cc-rr-labeller and potentially also notify-osd.
2013-08-31 15:53:10 -04:00
Aleksander Morgado
90de3c4fc0 win32: use the input locale to decide the default input method
GTK+ tries to automatically assign the best input module based on the
'system locale'. In the specific case of the IME input method, it will
be the default for the whole GTK+ application if the system locale is
either Japanese (ja), Korean (ko) or Chinese (zh). Other defaults are
equally applicable, e.g. if system locale is Catalan (ca), the special
'Cedilla' input module is chosen.

System locale can be changed (e.g. Win7) through the following sequence
(reboot required):
  Control Panel
    Region and Language
      Administrative
        Language for non-Unicode Programs
          Change system locale...

The problem with this behaviour is that changing the 'default input
language' (e.g. from English to Japanese+IME) doesn't affect the GTK+
application. Therefore, I can have an English system locale (where GTK+
will choose Simple IM by default) but then have Japanese+IME as input
language.

Default input language can be changed (e.g. Win7) through the following
sequence (no reboot required):
  System locale can be changed (e.g. Win7) through:
    Control Panel
      Region and Language
        Keyboards and Languages
          Keyboards and other input languages
            Change keyboards...

Default input language can also be changed using the language bar directly.

So, instead of using the system-wide default locale to decide which input
method to use as default, better use the input language specified by the
user, which may be the same as the system-wide default locale, or different.
Following the previous example, with an English system locale and a
Japanese+IME input language, the default input method will now be IME
instead of Simple, which is closer to what's expected by the user.

This change only affects the application during startup; i.e. if the user
changes the input language while the application is running, we wouldn't be
changing the default input method to use. We could do this processing the
WM_INPUTLANGCHANGE messages, though.

https://bugzilla.gnome.org/show_bug.cgi?id=700428
2013-08-31 14:28:10 -04:00
Pavel Vasin
2df6174038 GtkClipboardWayland: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=706493
2013-08-31 12:28:19 -04:00
Pavel Vasin
1f2ed31f28 css shadow: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=706493
2013-08-31 12:28:17 -04:00
Arnel A. Borja
0c19be899d printsettings: Add missing docs for output constants
GTK_PRINT_SETTINGS_OUTPUT_DIR and GTK_PRINT_SETTINGS_OUTPUT_BASENAME
doesn't have documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=706802
2013-08-31 12:27:50 -04:00
Matthias Clasen
445204acca Fix an age-old typo
GtkIconView was not properly propagating key release events,
since forever.

https://bugzilla.gnome.org/show_bug.cgi?id=706740
2013-08-31 12:27:31 -04:00
Matthias Clasen
3442933dd7 Revert "Deprecate and ignore gtk-entry-password-hint-timeout"
This reverts commit 4b5a389e88.

This change caused considerable concern about accidental
leaking of passwords, see e.g.

https://bugzilla.gnome.org/show_bug.cgi?id=706563
https://bugzilla.gnome.org/show_bug.cgi?id=706873
https://bugzilla.redhat.com/show_bug.cgi?id=994237

We may have to do something else for password entries, such
as the windows-style 'peekabo' icon.
2013-08-31 00:16:28 -04:00
Matthias Clasen
350569124d Don't mark a space as translatable
There is no point in translating a string that consists just
of a single space. Pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=706778
2013-08-30 23:45:08 -04:00
Mike Gorse
7e3db6fdd3 a11y: Check whether a widget is mapped before querying its parent
Call gtk_widget_get_mapped() in a couple of places before looking at the
widget's parent, since it might be set to a widget that has been
finalized, causing an invalid read.
2013-08-30 09:42:41 -05:00
Mike Gorse
d7e07a8470 Don't access memory after freeing it when destroying a tick callback
https://bugzilla.gnome.org/show_bug.cgi?id=704278
2013-08-30 09:42:41 -05:00
Stefano Facchini
d59c9429de Remove leftover from commit 889e63faed 2013-08-30 14:47:17 +02:00
Paolo Borelli
798c2b60ec [headerbar] Do not hardcode title and subtititle style
Let the css theme define them

https://bugzilla.gnome.org/show_bug.cgi?id=707051
2013-08-29 15:59:53 +02:00
Emmanuele Bassi
889e63faed headerbar: Remove hpadding and vpadding properties
We really want these to be set by the theme, not programmatically.

https://bugzilla.gnome.org/show_bug.cgi?id=706929
2013-08-29 14:39:38 +01:00
Stefan Sauer
d4679c0a13 frame: annotate the @label params with (allow-none) 2013-08-29 09:06:31 +02:00
Claudio Saavedra
343a259e4a gtkwindow: fix a critical warning
Do not map the title box if it's not visible.
2013-08-28 20:10:38 +03:00
Matthias Clasen
13f92834f7 Fix a regression in GtkAssistant child property handling
GtkAssistant is bending the rules about child properties
of non-direct children, and the recent fix to accomodate
GtkInfoBar changes broke things. The effect was that child
properties of assistant pages in ui files were just not
applied, so all pages ended up without titles and with
the normal page type, leading to broken assistants all
over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=706756
2013-08-28 11:51:19 -04:00
Jasper St. Pierre
3c2c3ab6f9 gtkwindow: Calculate the opaque window based off of the style
https://bugzilla.gnome.org/show_bug.cgi?id=706922
2013-08-28 10:33:58 -04:00
Jasper St. Pierre
64cf8b731e gtkwindow: Consistently set the style classes for window-frame
In one place, we forgot to remove the BACKGROUND style class before
adding window-frame. Add a helper method so these are all the same.

https://bugzilla.gnome.org/show_bug.cgi?id=706922
2013-08-28 10:33:57 -04:00
Stefano Facchini
b2b8c4d4bc revealer: clamp minimum size to natural one
Instead of just setting them equal.

https://bugzilla.gnome.org/show_bug.cgi?id=706938
2013-08-28 10:34:11 +02:00
Matthias Clasen
a9dae69b51 Fix anonymous assistants
GtkAssistant supports not showing the sidebar with the page
titles (if the page have no titles). Unfortunately, we were
hiding the sidebar in this case, but still rendering the frame
behind it, leading to a broken appearance.
2013-08-27 23:14:14 -04:00
Kristian Høgsberg
459e6a35cd clipboard: Fix text mime type handling on Wayland 2013-08-27 16:03:55 +02:00
Alexander Larsson
de1f551271 GtkTextView: Use *some* extra size for horizontal scrolling
Horizontal scrolling is unusual, but specifying some extra offscreen
space for it in free in the normal case where the viewport is the
same width as the canvas anyway, so lets do it.
2013-08-26 21:17:45 +02:00
Alexander Larsson
2d0bdee075 pixel cache: Allow growing of cache surface
If the new requested surface size is enough larger than the previous
one (but the old is still larger than the absolute minimum),
reallocate it anyway.

This fixes an issue where the text view initially requested a really
small extra size which was then increased but that didn't "take".
2013-08-26 21:17:45 +02:00
Christian Hergert
d96882bc16 textview: use pixelcache to indirectly renderer to widget.
This patch uses GtkPixelCache to render the contents of the widget,
and typically a bit more, to an offscreen surface. The pixel cache in
turn manages rendering to the actual surface for the widget.

The current strategy for the size to render is the size of the widget
plus half the height.

https://bugzilla.gnome.org/show_bug.cgi?id=701125
2013-08-26 21:17:45 +02:00
Christian Hergert
b1745d68cd pixelcache: allow specifying content type and extra size.
Allow forcing the cairo_content_t of the surface as well as the
amount of extra size to render.

https://bugzilla.gnome.org/show_bug.cgi?id=706728
2013-08-26 21:17:45 +02:00
Carlos Garcia Campos
247ebbd17c iconview: Respect the fixed item width when adjusting the wrap width
Restore the code the way it was in GTK2.

https://bugzilla.gnome.org/show_bug.cgi?id=680953
2013-08-26 18:23:55 +02:00
Chun-wei Fan
c8cad49108 gtk/gtkwindow.c: Fix build on non-X11
There were some code added to this file that is meant for the X11 backend,
but they are being unconditionally built.  Add build-time checks for the
X11 backend for these to fix the build on non-X11 platforms.
2013-08-26 21:32:09 +08:00
Chun-wei Fan
0e01f9cc9c GDK/GTK on Windows: Fix build
Due to the work on gdk_cursor_new_from_surface (commit b2113b73),
get_cursor_for_pixbuf() in GdkDisplayClass was converted to
get_cursor_for_surface(), which means the GDK Win32 backend needs to be
updated for the code to build and run on Windows, plus some function
prototypes and declarations/calls need to be updated as well.

https://bugzilla.gnome.org/show_bug.cgi?id=705980
2013-08-26 10:29:23 +08:00
Kristian Høgsberg
2ffcc8a453 wayland: Set type for GtkSelectionData for incoming contents
This is set from the incoming property type under X11.  Under Wayland
it will always be what we requested, so we can just set it to the target.
2013-08-23 23:15:54 -07:00
Kristian Høgsberg
8e8951df72 wayland: Only set wayland selection for GDK_SELECTION_CLIPBOARD
Wayland only has one selection, which corresponds to GDK_SELECTION_CLIPBOARD.
2013-08-23 23:15:54 -07:00
Matthias Clasen
7e4bcf9102 Add workspace handling to the window menu
The reimplements the current mutter window menu for
workspace changes.

https://bugzilla.gnome.org/show_bug.cgi?id=706323
2013-08-24 00:53:00 -04:00
Matthias Clasen
8f69721ed4 Add an 'Always on Top' item to the csd window menu
We want to make the csd window menu as similar as possible to the
mutter window menu.

https://bugzilla.gnome.org/show_bug.cgi?id=706323
2013-08-23 22:46:04 -04:00
Cosimo Cecchi
6928aedb2c window: add a style class when we automatically create the titlebar
To distinguish it from custom titlebars added from applications.

https://bugzilla.gnome.org/show_bug.cgi?id=706592
2013-08-23 20:17:24 -04:00
Cosimo Cecchi
fde3d5afe8 window: don't change bottom margin for automatic CSD
We'll use a style class to be able to give this a different appearance,
but for the time being we don't really need to give this such different
margin.

https://bugzilla.gnome.org/show_bug.cgi?id=706592
2013-08-23 20:17:24 -04:00
Benjamin Otte
4787a1ac61 label: Initialize lines value to -1
Fixes defaultvalue test.
2013-08-23 18:27:12 +02:00
Benjamin Otte
64a1f30468 label: Fix gcc warning 2013-08-23 18:24:20 +02:00
Matthias Clasen
eab0ff8e4e Add api to ellipsize labels to multiple lines
When setting the lines property, the label will be ellipsized
to that many lines, with the ellipsis only appearing in the
last line. This is different from how ellipsization of multi-line
labels normally works in GTK+.
2013-08-22 20:38:01 -04:00
David King
4415d087c6 combobox: Add missing Since tags for entry constructors 2013-08-22 20:36:17 +01:00
Jasper St. Pierre
51f229519d gtkwindow: Enable CSD when windows set a titlebar
https://bugzilla.gnome.org/show_bug.cgi?id=706529
2013-08-22 09:33:08 -04:00
Jasper St. Pierre
a2eafe2f57 gtkwindow: Disable CSD if we aren't running under a supported WM
Also, split the checks for CSD out into a separate function.

https://bugzilla.gnome.org/show_bug.cgi?id=706529
2013-08-22 09:33:00 -04:00
Jasper St. Pierre
7462de8fba gtkwindow: Split code that detects if we want CSD out
This will get a bit more complex when we enable CSD for custom headerbars

https://bugzilla.gnome.org/show_bug.cgi?id=706529
2013-08-22 09:25:39 -04:00
Jasper St. Pierre
a95cabd787 gtkwindow: Have a separate "titlebar" pointer for decorations we create ourselves
This cleans up the code a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=706529
2013-08-22 09:25:39 -04:00
Jasper St. Pierre
cae2b697ef gtkwindow: Rename title_icon, etc. to titlebar_icon
"title_box" is used for both a custom header bar and for a titlebar.
Since we want to help differentiate these cases in the code, rename
everything titlebar-internal to use "titlebar_".

https://bugzilla.gnome.org/show_bug.cgi?id=706529
2013-08-22 09:25:39 -04:00
Federico Mena Quintero
354db1d69d filechooser: Don't use an underline mnemonic in the 'Save in folder' label
This used to point to the GtkPathBar, which doesn't accept mnemonic activation, anyway.
This whole thing was a leftover from when we had a combo box to select a folder, but
this is no longer the case.

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

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-08-21 09:50:44 -05:00
Saleem Abdulrasool
ec26a909f6 clipboard: fix build without wayland
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
2013-08-20 20:28:01 -07:00
Piotr Drąg
60ec788489 Fix minor typos 2013-08-21 04:15:52 +02:00
Matthias Clasen
9f8514cc06 Fix distcheck
We need to clean up the ui.h files somewhere if they are generated
during the build from tarball. Reuse the existing distclean-local
hack for it.
2013-08-20 18:53:57 -04:00
Matthias Clasen
22378bbab5 GtkHeaderBar: Add the titlebutton style to the close button
This will let the theme unify the appearance of this button with
the window buttons in 'traditional' title bars.
2013-08-20 15:23:36 -04:00
Volker Sobek
112374b4be doc: Fix typos
Fix two typos in gtk/gtktexttag.c.

https://bugzilla.gnome.org/show_bug.cgi?id=706335
2013-08-20 17:35:44 +02:00
Benjamin Otte
e38e47d7d3 clipboard: Reimplement Wayland clipboard using vfuncs
This way, the Wayland and the regular clipboard implementation can both
be compiled in and selected based on the display in use.

One thing potentially broken now is text mime type handling as Wayland
seemed to use different mime types in some places.
2013-08-20 16:34:29 +02:00
Benjamin Otte
aee5bcf9e2 clipboard: Make a bunch of functions vfuncs 2013-08-20 16:34:29 +02:00
Benjamin Otte
4009c8241b clipboard: Split struct definitions into private header 2013-08-20 16:34:29 +02:00
Matthias Clasen
8383f003f3 Avoid deprecation warnings 2013-08-20 00:15:37 -04:00
Cosimo Cecchi
417d6666e5 iconhelper: refactor some code into a single function
https://bugzilla.gnome.org/show_bug.cgi?id=705443
2013-08-20 02:50:40 +02:00
Cosimo Cecchi
19c5a00f3a iconfactory: cache/invalidate pixbufs according to the effect
The state of the widget is not enough now to cache the pixbuf - we also
have to take into consideration the image effect itself, since the state
on the actual GtkStyleContext we use might not change, e.g. because the
change was on a parent context.

https://bugzilla.gnome.org/show_bug.cgi?id=705443
2013-08-20 02:50:40 +02:00
Cosimo Cecchi
b6cf6d52ef themingengine: apply image effects according to GtkCssImageEffect value
Instead of only looking at the state flags.

https://bugzilla.gnome.org/show_bug.cgi?id=705443
2013-08-20 02:50:40 +02:00
Cosimo Cecchi
736b350d7a css: Add a GtkCssValue for GtkCssImageEffect
This will allow us to use the CSS machinery to apply a highlight or dim
effect when images are prelit or insensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=705443
2013-08-20 02:50:40 +02:00
Cosimo Cecchi
723a589bdd themingengine: refactor a conditional branch
Return early when the state is not wildcarded - makes the code more
readable.

https://bugzilla.gnome.org/show_bug.cgi?id=705443
2013-08-20 02:50:40 +02:00
Cosimo Cecchi
844dade070 pathbar: add back GTK_STYLE_CLASS_LINKED
This was accidentally removed in commit
42f53ab58e

https://bugzilla.gnome.org/show_bug.cgi?id=706028
2013-08-20 02:47:07 +02:00
Matthias Clasen
64d0ecaec8 Redo style class handling
We should set the appropriate style classes when we have
constructed the content and know if it is a label, an image,
or both. Doing this in the convenience constructors is
problematic for language bindings, and misses out when the
content is changed after construction.
2013-08-19 14:42:18 -04:00
Matthias Clasen
27cb50b48c Revert "Add the "text-button" style to button created with gtk_button_new_with_{label,mnemonic}"
This reverts commit 8d7bab7d7b.
2013-08-19 14:42:18 -04:00
Yosef Or Boczko
6e88b76178 Fix a typo 2013-08-19 20:59:50 +03:00
Andrew Walton
19be4edbea GtkEntry: add a "tabs" property for setting a PangoTabArray in the layout.
I'm currently working on porting view::FieldEntry (from libview) to C for use in
upstream GTK+. FieldEntry is a widget which allows users to enter structured
text such as IPv4 addresses or serial numbers. The way that FieldEntry
delineates the fields within the entry is with tabstops, using PangoTabArray
entries to precisely position the fields and delimiters. Because GtkEntry
rebuilds its internal PangoLayout fairly frequently, this requires a property in
the entry that will set the tabs on the layout whenever that happens. This API
looks very similar to one in GtkTextView.

Patch by David Trowbridge <trowbrds@gmail.com>. Updated for Gtk+ 3.10.

https://bugzilla.gnome.org/show_bug.cgi?id=697399
2013-08-19 13:43:32 -04:00
David Trowbridge
a864f9d052 Fix GtkEntry drawing to provide visual feedback when editable=FALSE.
GtkEntry currently draws exactly the same no matter what the state of the
'editable' property. This is pretty confusing for users because there's
no visual feedback at all, it just seems like their keyboard is broken.

This change adds a "read-only" class to the StyleContext, which will
continue to allow the user to select/copy the text, but will draw the
entry as if it were insensitive, providing some indication that the
contents can't be changed.

Signed-off-by: David Trowbridge <trowbrds@gmail.com>

http://bugzilla.gnome.org/show_bug.cgi?id=694831
2013-08-19 13:41:39 -04:00
Alexander Larsson
d5e5616ae6 icon-theme: Add ScaledDirectories support
For backwards compat support we don't want old implementations not
supporting scaling to see the new scaled directories, so move these
to a separate list.
2013-08-19 16:01:57 +02:00
Alexander Larsson
8ae81bb395 icon-theme: Use "Scale" for key as per the spec
The latest spec proposal uses "Scale", not "OutputScale", so use this.
2013-08-19 16:01:57 +02:00
Matthias Clasen
dc4f555d25 Fix keyboard activation of menu buttons
Keyboard activation relies on the menu not being visible,
so ensure that it isn't when the menu is attached.

Problem tracked down by Vincent Le Garrec,
https://bugzilla.gnome.org/show_bug.cgi?id=688738
2013-08-18 22:22:22 -04:00
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -04:00
Yosef Or Boczko
8d7bab7d7b Add the "text-button" style to button created with gtk_button_new_with_{label,mnemonic}
https://bugzilla.gnome.org/show_bug.cgi?id=706220
2013-08-18 10:12:49 +03:00
Stef Walter
6a837c668a window: Some protection against nested set_focus() calls
Since set_focus() can triger events, have a check to make
sure state is still valid before firing is-focus signal.

https://bugzilla.gnome.org/show_bug.cgi?id=706152
2013-08-17 09:55:27 +02:00
Cosimo Cecchi
9896b9960d window: set GTK_STYLE_CLASS_TITLEBAR to custom titles
When a custom title is added to a GtkWindow, add the
GTK_STYLE_CLASS_TITLEBAR to it, so the theme can apply the default rules
for its style.

https://bugzilla.gnome.org/show_bug.cgi?id=706045
2013-08-16 23:12:23 -04:00
Cosimo Cecchi
3ea0e4a019 stylecontext: add GTK_STYLE_CLASS_TITLEBAR define
For consistency with the other stock style classes.

https://bugzilla.gnome.org/show_bug.cgi?id=706045
2013-08-16 23:12:22 -04:00
Matthias Clasen
f8412eca34 Revert "Deprecate and ignore the cursor blink settings"
This reverts commit b2e666bf8f.

We need to keep cursor blinking configurable for accessibility
reasons.

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

Conflicts:
	gdk/win32/gdkproperty-win32.c
	gdk/x11/gdksettings.c
	gtk/gtksettings.c
	gtk/gtktextview.c
2013-08-16 22:45:13 -04:00
Matthias Clasen
7b4f82ccc6 Make symbolic icons work with the current rsvg
The rsvg loader now restricts what external files it will
allow to load from an svg. Thus our xinclude trick doesn't work
anymore. To work around that, embed the payload in a  data: uri.
This is somewhat ugly, but the best we could come up with.
2013-08-16 22:05:38 -04:00
Matthias Clasen
77059dbaba Add style classes to headerbar titles
The current theme just makes all text bold that appears anywhere
in a headerbar, which is not great. We add 'title' and 'subtitle'
style classes to allow more targeted overriding of the font.
2013-08-16 13:39:25 -04:00
Joanmarie Diggs
e67d0119fe gtksearchentry: Provide an accessible name
https://bugzilla.gnome.org/show_bug.cgi?id=706014
2013-08-15 16:37:29 +02:00
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Jasper St. Pierre
e80d1f0523 gtkdnd: Use a more modern spring back animation for cancelled drags
https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Jasper St. Pierre
2b2162dd5f gtktextutil: Remove the border and background from drag icons
https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
David King
1e3e123c17 docs: Convert GtkMenuShell comment to documentation
https://bugzilla.gnome.org/show_bug.cgi?id=448637
2013-08-14 09:53:16 +01:00
Yosef Or Boczko
89f701ab2e oopx - fix typo
Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
2013-08-14 10:45:35 +03:00
Yosef Or Boczko
2f77a61e61 Add gtk_button_new_from_icon_name
This function is a convenience wrapper around
gtk_button_new() and gtk_button_set_image().

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

Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
2013-08-14 10:41:42 +03:00
Alban Browaeys
6ea4c1a1f4 paned: minus the size by the handle for the for_child1 computation.
Fixes:
(rhythmbox:22802): Gtk-CRITICAL **:
_gtk_widget_get_preferred_size_for_size: assertion 'size >= -1' failed

that is gtk_paned_get_preferred_size_for_opposite_orientation calls
_gtk_widget_get_preferred_size_for_size on child2 with a negative
size.

As gtkpaned size was (32), child1 minimum size was (55) then
for_child1 became (32) for an handle_size of (5). Thus for_child2
ended up as (-5).

https://bugzilla.gnome.org/show_bug.cgi?id=705624
2013-08-14 00:10:08 -04:00
Matthias Clasen
b7e41a7eda GtkSpinButton: disconnect signals in the accessible
Just as for GtkRangeAccessible, we were not even trying to disconnect
the signal handler from the adjustment. The same fix works here:
override the widget_set and widget_unset vfuncs.

https://bugzilla.gnome.org/show_bug.cgi?id=705692
2013-08-14 00:04:46 -04:00
Matthias Clasen
b9a6e012d5 GtkRange: disconnect signals in the accessible
We were only disconnecting the signal in finalize, when
the widget was already unset. Instead, override the widget_set
and widget_unset vfuncs of GtkAccessible, and keep a reference
to the adjustment.

https://bugzilla.gnome.org/show_bug.cgi?id=705692
2013-08-14 00:04:05 -04:00
Matthias Clasen
38e51b27c2 Trivial typo fix 2013-08-13 22:25:16 -04:00
Matthias Clasen
4790857da6 Improve a deprecation hint
Don't point to a replacement that is itself deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=705372
2013-08-13 20:41:59 -04:00
Stefano Facchini
f462dded36 searchbar: ignore GDK_KEY_Menu in handle_event()
https://bugzilla.gnome.org/show_bug.cgi?id=705524
2013-08-13 20:40:06 -04:00
Chun-wei Fan
3b82b97e73 GTK-Win32: Avoid Using Deprecated API
Replace the deprecated API calls with the updated APIs, and fix the build
of modules/input/gtkimcontextime.c, as we really needed
gdk/gdkkeysyms-compat.h (gdk/gdkkeysyms.h was already included)

https://bugzilla.gnome.org/show_bug.cgi?id=705068
2013-08-14 08:05:53 +08:00
Matthias Clasen
35a4bba902 csd: Implement middle-click action for titlebar
The default middle-click action on the titlebar should be to lower
the window. Implement that.

https://bugzilla.gnome.org/show_bug.cgi?id=705809
2013-08-13 18:24:37 -04:00
Matthias Clasen
1398f8ea4c Add some missing deprecation annotations
These were reported missing in bug
https://bugzilla.gnome.org/show_bug.cgi?id=705672
2013-08-13 18:09:47 -04:00
Matthias Clasen
9463c78bac GtkWindow: fix an init/finalize asymmetry
Make sure we always deal with the same screen when
connecting / disconnecting the theme-variant changed handler.
Pointed out by Morten Welinder in
https://bugzilla.gnome.org/show_bug.cgi?id=705640
2013-08-13 17:44:04 -04:00
Matthias Clasen
3923ba1605 Avoid overlong file chooser buttons
When bookmarks are long, the file chooser button would
grow too much. This can be avoided by ellipsizing.

Patch by Ritesh Khadgaray,
https://bugzilla.gnome.org/show_bug.cgi?id=672220
2013-08-13 17:35:28 -04:00
Cosimo Cecchi
b52844031f icontheme: correctly fallback to symbolic icons
When an icon is requested as symbolic, our generic fallback algorithm
uses fullcolor icons when the specified icon name is not found, treating
the "-symbolic" suffix as another component of the icon name.

Change the algorithm to check beforehand if the icon is symbolic, remove
the suffix if so, and re-add it at the end for all the generated icon
names.

https://bugzilla.gnome.org/show_bug.cgi?id=680926
2013-08-13 17:22:47 +02:00
Jasper St. Pierre
8818d8a19b gtkwindow: Export our custom frame extents
This allows CSD windows to be maximized, tiled, and constrained
properly.

https://bugzilla.gnome.org/show_bug.cgi?id=705765
2013-08-13 10:38:49 -04:00
Benjamin Otte
ed5c35306d alignment: Remove dead assignment
.. and clean up code
2013-08-13 16:25:26 +02:00
Benjamin Otte
7f8497f850 gtkmenuitem: Remove dead assignment 2013-08-13 16:25:26 +02:00
Matthias Clasen
ea715a49e4 Deal with platform-specific im modules
With multiple GDK backends in the process, we run into problems where
we try to use the Wayland im module on X, which crashes. This commit
adds a quick backend filter that removes the wayland, xim and ime
input methods from consideration  unless the corresponding GDK backend
is in use.
2013-08-11 15:42:19 -04:00
Matthias Clasen
f4a138c7bd GtkIMModule: Use default screen when determining context id
This code is called early on, without a window, and then later on
with a window. Currently, it returns different results for these
cases when the setting contains a value. That leads to pointless
construction and destruction of im contexts. Instead, just look
at the settings of the default screen. In practice, there is only
one screen, ever.
2013-08-11 15:38:25 -04:00
Christian Hergert
a0bc600140 dnd: Motif DnD is no longer supported, update docs. 2013-08-08 16:06:00 +02:00
Kalev Lember
653fc4fd4b listbox: Reorder code
This just moves the gtk_list_box_insert function to where the rest of the
public API is defined.

https://bugzilla.gnome.org/show_bug.cgi?id=705558
2013-08-08 11:00:32 +02:00
Kalev Lember
43c68e118f listbox: Implement gtk_list_box_insert()
... to make it possible to insert rows in the middle of the list without having
to fiddle with the sort functions. One of the first users is going to be Glade.

https://bugzilla.gnome.org/show_bug.cgi?id=705558
2013-08-08 11:00:26 +02:00
Jasper St. Pierre
5674f2ce50 gtkiconview: Take padding into account when getting the cursor hotspot
This makes the icon view look completely seamless when dragging.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-07 11:53:05 -04:00
Jasper St. Pierre
d72252c7d6 gtkiconview: Remove the border and background from drag icons
This doesn't look good when combined with rounded corners on
selected items.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-07 11:53:04 -04:00
Jasper St. Pierre
b9d85b9412 gtkdnd: Clean up the doc comment of gtk_drag_begin 2013-08-07 11:53:04 -04:00
Jasper St. Pierre
0c49f734a2 gtkstylecontext: Remove some dead code when rendering layouts 2013-08-07 11:53:04 -04:00
Ignacio Casal Quinteiro
fb2bc06f50 headerbar: use a more standard headerbar look for the close button
https://bugzilla.gnome.org/show_bug.cgi?id=705601
2013-08-07 16:49:34 +02:00
Alexander Larsson
8e423ba292 gtkdnd: Use surface based cursor APIs
This allows things to correctly scale things on HiDPI screens.
2013-08-07 13:34:10 +02:00
Alexander Larsson
9bde6b10ef gtkiconhelper: Add _gtk_icon_helper_ensure_surface to private header 2013-08-07 13:34:10 +02:00
Paolo Borelli
0b200aaa32 Add gtk_list_box_prepend
Add a convenience method for prepending rows to a list box without
having to fiddle with a sort function.

https://bugzilla.gnome.org/show_bug.cgi?id=705558
2013-08-07 10:52:11 +02:00
Sébastien Wilmet
425deda2be Improve doc of gtk_text_tag_table_remove()
It's obvious, but it's better to say it.

https://bugzilla.gnome.org/show_bug.cgi?id=705529
2013-08-05 23:01:37 +02:00
Alexander Larsson
0296f1a43a gtkdnd: Use RGBA windows when dragging if possible
If we have rgba visuals and a composited screen we should
just use a RGBA window rather than shaped windows.
2013-08-05 16:49:18 +02:00
Alexander Larsson
499cef1bb0 css: Inherit device scale in _gtk_css_image_get_surface
To handle hidpi support we need to make sure we don't
downscale scaled css images.

Note: If cairo_surface_create_similar starts doing this
by itself we need to back this out.
2013-08-05 16:14:25 +02:00
William Jon McCann
8c7a8e9314 Add autoscroll when dragging past boundary of range
A problem with the zoom scroll mode is that you have to restart
if you hit the bottom of the screen before you hit the bottom
of your document.

This commit adds an autoscroll feature to the zoom scroll: if
you move outside the window while in zoom scroll mode, we keep
scrolling in the direction you were going until you let go
of the mouse button.

https://bugzilla.gnome.org/show_bug.cgi?id=704703
2013-08-05 08:47:27 +02:00
William Jon McCann
c3e172e546 Add press and hold support to set zoom scroll mode
Triggering zoom scroll mode by Shift click was too much
of an easter egg. It also requires using keyboard and
mouse together, which is hard to do for many users.

Instead, we now trigger zoom scroll mode by click-and-hold
(or touch-and-hold).

https://bugzilla.gnome.org/show_bug.cgi?id=704703
2013-08-05 08:47:27 +02:00
William Jon McCann
46302c522b Add mouse pointer support to press and hold
The internal class GtkPressAndHold was so far only
reacting to touch events. But in most cases where
a touch-and-hold or 'long press' pattern is useful,
click-and-hold can also be used.

This patch makes GtkPressAndHold react to mouse
clicks as well.

https://bugzilla.gnome.org/show_bug.cgi?id=704703
2013-08-05 08:45:46 +02:00
Matthias Clasen
b38a096aee GtkHeaderBar: optionally add a close button
Add a boolean property that controls whether a window close button
will be shown in the header bar or not. Doing this in the toolkit
will ensure consistency of the visual apperance.

https://bugzilla.gnome.org/show_bug.cgi?id=702971
2013-08-05 01:37:58 +02:00
Benjamin Otte
40506cf648 range: Remove dead assignment 2013-08-04 17:27:30 +02:00
Cosimo Cecchi
3ebde5303a themingengine: use gtk_icon_source_get_state_wildcarded()
A recent refactor of this code missed a check for the wildcarded state
on the icon source.
2013-08-04 09:19:03 +02:00
Matthias Clasen
eece18d21d GtkTreeView: Remove a dead assignment
This was found by the clang static analyzer.
2013-08-04 01:27:39 +02:00
Cosimo Cecchi
ab88110b51 iconhelper: clear the surface on invalidation
This was missed during the pixbuf->surface conversion, so when the state
changed we were not recreating a new surface for it.
2013-08-03 18:08:33 +02:00
Matthias Clasen
bd9ad3c9c2 Add .ui.h files to git
These files are generated, so adding them to git is somewhat
icky, but it helps translators who currently can't use intltool-update
on a fresh git checkout.
2013-08-03 17:26:27 +02:00
William Jon McCann
362d4fb686 Fix layout of infobar
Make sure the close button is right aligned and centered vertically.
2013-08-03 15:15:12 +02:00
Christian Hergert
6424739819 searchbar: use gtk_search_bar_connect_entry() in documentation. 2013-08-03 15:13:27 +02:00
Matthias Clasen
aace5a8946 Add a revealer to GtkInfoBar
Make GtkInfoBar slide in and out as it is shown or hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=704334
2013-08-03 09:04:47 +02:00
Matthias Clasen
0645369817 GtkFileChooserDefault: Remove redundancy
Don't specify packing properties for internal children.
This doesn't work unless the internal children are actually
direct children of the container (which we are about to
change for GtkInfoBar). Also, it is redundant, since we
just set the properties to the values they already have
anyway.
2013-08-03 09:04:47 +02:00
Matthias Clasen
e6a8848d0c Be more forgiving about child properties
Packing properties in ui files are parsed and handled by
the container, which assumes that the child is a direct
descendant. For internal children, this is inconvenient,
because we don't want to reconstruct the entire internal
structure between the container and the child in the ui
file.

It would be best to not specify packing properties
in that case, but since existing ui files do this for
GtkInfoBar and we are about to change the internal
structure of GtkInfoBar, be more forgiving here.
2013-08-03 09:04:47 +02:00
Matthias Clasen
e63bfabb07 Revert "Add a revealer to GtkInfoBar"
This reverts commit 1198ffb0bc.

This change needs more work, to avoid breaking existing
ui files.
2013-08-02 17:57:11 +02:00
Bastien Nocera
1c63d295ec Revert "Disable primary paste by default"
This reverts commit fbbcb5c01b.

We will be doing this in gnome-settings-daemon itself instead,
as some X11 based platforms using GTK+ will want to override this.
2013-08-02 16:42:41 +02:00
Alberto Ruiz
ef77e4727c fontchooser: set the minimum size of the spinner to 1 2013-08-02 15:56:54 +02:00
Alberto Ruiz
20adc37a01 fontchoser: Fix slider position update when switching from fonts with different recommended sizes 2013-08-02 15:51:33 +02:00
Ryan Lortie
03147b0e72 gtkicontheme: check for GdkPixbuf first
We checked for G_IS_LOADABLE_ICON() before GDK_IS_PIXBUF().

Since we made GdkPixbuf implement GLoadableIcon, the special case for
pixbufs is never used, and the much much slower GLoadableIcon path is
taken instead.  Move the GdkPixbuf one to be first to fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=705320
2013-08-02 15:00:08 +02:00
Chun-wei Fan
ca2dea0a5a Add Visual Studio 2010 Build Support for Broadway
Add the Visual Studio 2010 projects to build the GDK Broadway backend, just
like the Visual Studio 2008 project files in the last commit.  Similarly,
split up the property sheets so that they are easier to maintain and can
be made more flexible for different build types.  Also remove some unneeded
stuff from some of these items.

Also, fix the filter file completion for GTK, as a source file was excluded
for that and this was overlooked as it seemingly did not cause any trouble.
2013-08-02 17:05:57 +08:00
Matthias Clasen
1198ffb0bc Add a revealer to GtkInfoBar
Make GtkInfoBar slide in and out as it is shown or hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=704334
2013-08-01 10:55:49 +02:00
Chun-wei Fan
9232899c69 gtkprintoperation-win32.c: Drop unneeded include
Don't include gtkstock.h as it's not really needed here, and it has been
recently deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=705060
2013-07-29 20:10:03 -04:00
Kalev Lember
ceda38ee4e listbox: handle row sensitivity
When a row is insensitive, don't emit button press events and avoid
prelighting it.
2013-07-29 12:50:16 +02:00
Simon Feltman
b1a0773112 Add explicit transfer annotations to gtk_icon_view_get_cursor
The cell out argument to gtk_icon_view_get_cursor is a pass-through
for gtk_cell_area_get_focus_cell which is transfer none. Without
this explicit annotation, transfer full is defaulted and introspection
bindings will assume ownership of the GtkIconViews reference to the
cell, causing crashes. Additionally add explicit transfer full to
the path parameter because it is expected the caller will free the
returned memory.

https://bugzilla.gnome.org/show_bug.cgi?id=704700
2013-07-28 21:25:57 -07:00
Matthias Clasen
398f9e8b5b Change the way GtkSearchEntry does delayed change notification
We add a GtkSearchEntry::search-changed signal which gets emitted
with a 150 millisecond delay. The ::change signal goes back to its
expected semantics.

https://bugzilla.gnome.org/show_bug.cgi?id=700229
2013-07-28 21:49:37 -04:00