Commit Graph

18089 Commits

Author SHA1 Message Date
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
Christian Persch
953253f685 gtk: gtk_init_with_args allows NULL for parameter_string 2013-03-18 14:12:12 +01:00
Matthias Clasen
c4dc3a779a Revert "GtkHeaderBar: Allow window dragging"
This reverts commit 30a1a79322.

This turns out to be unnecessary when you can set the titlebar
on the window and let GtkWindow handle the events. As a benefit,
we get the window menu on custom titlebars for free.
2013-03-18 08:50:23 -04:00
Matthias Clasen
30d0542309 Add documentation for gtk_window_set_titlebar 2013-03-18 08:50:22 -04:00
Matthias Clasen
4afbaf699f Add gtk_window_set_titlebar
A new function that sets a custom titlebar on a GtkWindow.
With client-side decorations, the custom titlebar simply
replaces the one that GtkWindow would otherwise create itself.
With traditional decorations, we tell the window manager
to just decorate the window with a border. This works ok
at least with metacity and mutter.
2013-03-18 08:50:22 -04:00
Matthias Clasen
105c808d0a Small cleanup in gtk_window_draw
Get the allocation once, at the beginning.
2013-03-18 08:50:22 -04:00
Matthias Clasen
4a2c3bbf3c window: Don't draw titlebar background
GtkHeaderBar can do its own drawing, no need to do this
in gtk_window_draw.
2013-03-18 08:50:22 -04:00
Matthias Clasen
e29c25cd1b Trivial whitespace fix 2013-03-18 08:50:22 -04:00
Matthias Clasen
63f0f03a73 Add forgotten check
We don't want to create titlebar widgets if the window
is not decorated anyway.
2013-03-18 08:50:21 -04:00
Matthias Clasen
bec5798180 Fix a typo 2013-03-18 01:20:08 -04:00
Matthias Clasen
30a1a79322 GtkHeaderBar: Allow window dragging
We use the same window-dragging style property here to enable
this as for menubars and toolbars.
2013-03-18 01:02:19 -04:00
Matthias Clasen
2fe07c9068 Fix double accounting of border width
For csd, we were subtracting the border width one too many
times from the child height, causing clipped off content e.g.
in the 'Properties' window in testgtk.
2013-03-17 19:01:25 -04:00
Matthias Clasen
75a1e8251e Allocate the titlebar height according to width 2013-03-17 19:01:25 -04:00
Matthias Clasen
68b9bafd1d Add some visible border to the default csd 2013-03-17 19:01:25 -04:00
Matthias Clasen
df96b0239f GtkFontButton: default show-preview-entry to TRUE
This is what the property declaration says, after all.
https://bugzilla.gnome.org/show_bug.cgi?id=695948
2013-03-17 16:24:34 -04:00
Alban Browaeys
da961b7ab8 GtkEntryAccessible: also handle entry icon tooltip NULL in notify_gtk.
To clear the tooltip one is to set the tooltip to NULL. Though
the GtkEntryAccessible expect this tooltip to not be NULL in
gtk_entry_accessible_notify_gtk (already handling this case
 in its _init).

Fixes:
** (epiphany:23914): CRITICAL **: atk_object_set_description: assertion
`description != NULL' failed
when epiphany g_object_set the entry icon tooltip to NULL (clear the
tooltip) in its find bar.

https://bugzilla.gnome.org/show_bug.cgi?id=695375
2013-03-17 16:12:52 -04:00
Sébastien Wilmet
8e65fa1b43 GtkLabel: fix mnemonic-keyval when use-markup is true
To extract the mnemonic key value, the string must contain the
underscore. But when the "gtk-auto-mnemonics" setting is true and when
the Alt key is not pressed, the underscore must not be displayed. The
problem was that the 'new_str' variable was used for both purposes:
extract the text to display, and extract the accelerator character.

When the underscore must not be visible, the underscores were removed
from the 'new_str' variable before extracting the accelerator character.

Now there are two strings, one for each purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=674759
2013-03-17 16:10:10 -04:00
Rob Bradford
37509621bd css: Add style entries for client side decorations to default CSS 2013-03-17 12:19:51 -04:00
Matthias Clasen
a41f7e4741 window: Render inner and outer border separately
This lets themes render a window frame in the inner border,
and a shadow or nothing in the outer border.
2013-03-17 12:19:50 -04:00
Matthias Clasen
70ccfb0efc window: Split the border into inner and outer
For now, nothing changes, we're using the sum of inner and
outer border everywhere.

In the future, we will make the inner border the visible
window frame, and the outer border the shadow/resize border.
2013-03-17 12:19:50 -04:00
Matthias Clasen
41aad21693 window: Hide the border when maximized
Dragging windows from the border is not useful when maximized.
2013-03-17 12:19:50 -04:00
Matthias Clasen
003d9f4225 window: Add a window menu to the titlebar
The menu is triggered by right-click on the titlebar
or with the menu key.
2013-03-17 12:19:50 -04:00
Matthias Clasen
bf03c85e43 window: Allow resizing by clicking on the border
We also change cursors to indicate what interactions
are possible in various window regions.
Double clicking on the titlebar maximizes the window.
2013-03-17 12:19:50 -04:00
Matthias Clasen
037b1435ae window: Allow theme control over window buttons
Add a style property to control the presence and order of
window buttons. We allow buttons at the left and right side,
they can be specified like this: icon,close:minimize,maximize.

Also, change the default button layout back to have just a close
button on the right, use icons in buttons, and set style classes
on the buttons, to allow better theming.
2013-03-17 12:19:50 -04:00
Matthias Clasen
7d71f8888d Add icons for frame buttons
Add window-minimize, window-maximize, window-restore and window-delete
icons to the builtin icon theme. These will be used for icons in
the window buttons, and the expectation is that the icon theme
will provide icons matching the desired decoration style.

window-delete is used instead of window-close, since window-close
is also used for GTK_STOCK_CLOSE, and the two may require different
styles when used inside the application vs in the window frame.
2013-03-17 12:19:50 -04:00
Matthias Clasen
93c345e49f window: Hide frame buttons when appropriate
Hide the close button if the window is not deletable, hide the
maximize button if the window is not resizable, and hide all
buttons if the window is a dialog.

Update buttons when the window state changes.
2013-03-17 12:19:49 -04:00
Matthias Clasen
d05d08a2f3 window: Use same title fallback mechanism as X backend
This looks at the application name or program name and uses that
as the title if gtk_window_set_title has not been called.
2013-03-17 12:19:49 -04:00
Matthias Clasen
b141121ef6 window: Add support for enabling client decorations on non-Wayland
Client side decorations can be enabled on non-Wayland platforms by
setting the GTK_CSD="1" environment variable.

We must ensure we have a GdkVisual that has an alpha channel since
the decorations rely on transparency. If we cannot get a visual with
an alpha channel then we do not enable client side decorations.
2013-03-17 12:19:49 -04:00
Rob Bradford
f17b7136dd window: Hide the decorations on fullscreen
This is expected behaviour for fullscreen windows.
2013-03-17 12:19:31 -04:00
Rob Bradford
4618e0dcc7 window: Don't set a background pattern/colour when client decorated
Otherwise we'll potentially get some background sticking through our rounded
corners in our decorations. The actual background will get drawn as part of
the decoration drawing.
2013-03-17 12:13:35 -04:00
Kristian Høgsberg
6a8362111e window: Add initial support for client-side decorations under Wayland
This change comprises four main parts:
 * the creation of the widgets that form the decorations,
 * implementation of get_preferred_height/width, and the for_width/for_height
   variants,
 * taking the decorations into account when allocating,
 * and drawing the decorations themselves.

Kristian did the bulk of the original work on this but any bugs are almost
certainly mine through the many refactorings and rebasings.
2013-03-17 12:13:35 -04:00
Matthias Clasen
3f9455301e Add GtkHeaderBar
This widget has been developed as GdHeaderBar in libgd.
The copy here has been renamed and changed to use GTK+
internals.
2013-03-17 12:12:53 -04:00
Rob Bradford
55a98da4d4 window: Allow _gtk_window_set_allocation to return a modified allocation
Update the documentation and users of this function to handle
the future case that that we have some internal decorations to the window and
useable allocation is thus smaller.

By having a separate out parameter there is no need to have an in/out function
and allows for greater robustness.

The current implementation simply returns the allocation provided.
2013-03-17 11:28:26 -04:00
Sébastien Wilmet
66dfab0b0a Small API doc fixes
For gtk_text_iter_get_char(), due to the "Returns" at the beginning of
the description, the description was not visible. So the first sentence
has been reworded.
2013-03-16 22:18:50 +01:00
Matthias Clasen
5e1a06d1b1 GtkGrid: Tweak size allocation
If there are rows that contain only spanning children,
our algorithm was unnecessarily distributing extra space
to the other rows, even if they contain only non-expanding
children.

We improve the behaviour by treating rows containing only
spanning children as expanding.
2013-03-15 23:38:30 -04:00
Benjamin Otte
f9f6c4fa49 stylecontext: Do invalidation on first resize container
... instead of taking the last one we find. This is necessary as
attached widgets (mostly menus) can be attached to an invisible widget,
but we still want to invalidate styles for them.

https://bugzilla.gnome.org/show_bug.cgi?id=695772
2013-03-16 00:06:55 +01:00
Christian Persch
af0007d0d8 docs: Typo fix 2013-03-15 18:51:11 +01:00
Benjamin Otte
bda5987335 separator: Don't use padding and borders wrongly
Borders for size requests and padding for drawing? Really?

Removed them, as that is the least invasive fix shortly before a
release.
2013-03-15 18:18:40 +01:00
Matthias Clasen
a731cd1ef6 Minor doc cleanup
Remove widget references from interface docs.

https://bugzilla.gnome.org/show_bug.cgi?id=695874
2013-03-14 20:29:00 -04:00
Benjamin Otte
feb64f40b0 a11y: Emit text-changed signals directly
When setting new text on the label, the text-changed::delete signal
needs to be emitted before deleting the text (so that atk-bridge can
query the old text) while the text-changed::insert event needs to happen
afterwards (for the same reason). The old code using the notify signal
was only emitted after changing the text.
2013-03-15 00:58:29 +01:00
Bastien Nocera
ee44ed75ca GtkApplication: Allow passing windows on non-X11 targets
It's not the application's fault that we don't do anything
with the passed GtkWindow on non-X11, so don't try to get an XID
on non-X11.

https://bugzilla.gnome.org/show_bug.cgi?id=695783
2013-03-14 17:48:20 +01:00
Chun-wei Fan
b9e189150b gdk/gdkwindow.c, gtk/gtkwidget.c: Include fallback-c89.c
Both of them started to make use of round(), a C99 function.  So, include
fallback-c89.c to provide a fallback implementation for round() for
compilers that don't have round()

https://bugzilla.gnome.org/show_bug.cgi?id=694339
2013-03-13 13:22:48 +08:00
John Lindgren
5e2c232145 treeview: Don't emit cursor-changed in destruction
This is a workaround until we have a good idea on how we want to handle
signal disconnection before/during/after dispose and destroy vfunc
calls.

https://bugzilla.gnome.org/show_bug.cgi?id=671939
2013-03-13 02:06:29 +01:00
Matthias Clasen
0cc688aa92 Drop the Motif DND protocol
The implementation is not working and unused, since XDND is the
de-facto standard under X nowadays.

https://bugzilla.gnome.org/show_bug.cgi?id=695476
2013-03-12 20:03:19 -04:00
Federico Mena Quintero
563eb60666 filechooserbutton: Duh, remove all the timeouts after tests
Otherwise tests may start failing if they start after an old timeout triggers.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
d84f5ae17e filechooserbutton: Add a description string to assertions about emitted signals
On failed tests, this lets us more easily see see which assertion failed.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
aaedf5a352 filechooserbutton: Give proper names to the SELECT_FOLDER tests with cancelled dialog
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
79695ee64d filechooserbutton: Don't duplicate tests for GTK_RESPONSE_DELETE_EVENT
Instead, re-run tests made for GTK_RESPONSE_CANCEL with the delete-event response.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
3b2182e711 filechooserbutton: Do not propagate state from the dialog unless it is active
Change of plans to match the tests from the previous commit.

The state of the underlying dialog is never reflected by GtkFileChooserButton's API,
as the dialog is a transient thing.  The file chooser button only updates its state from the dialog,
and reflects the dialog's state, when the dialog has been confirmed and dismissed by the user.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
1865b9a111 filechooserbutton: whitespace fixes 2013-03-12 14:31:47 -06:00
Federico Mena Quintero
f5217289ca filechooserbutton: For the open-dialog-cancel-* tests, add a real nomenclature and test all the combinations
We used to have numeric names, which are a pain to maintain when new tests are added.
Now we have a real nomenclature (see the comment at the beginning of the open-dialog-cancel-* tests),
which lets us see easily if we have tested all the combinations.

Also, added all the combinations that were missing and removed redundant tests.
Not all the tests pass currently.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
2cfc56ced8 filechooserbutton: Update the button's state only on programmatic changes to the filechooser's state
The idea is that the button will only update its state of the selection and current folder
when changes to those are done either by the calling program (with the filechooser's API)
or when the user actually confirms and dismisses the underlying GtkFileChooserDialog.

If the user makes changes to the dialog but has not dismissed it yet, those changes
will not be reflected in the button (as one would expect).

This commit also makes sure the current-folder-changed and selection-changed signals
are emitted at the right times.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
fa4878979e filechooserbutton: Emit 'selection-changed' when changing the selection programmatically
We only emitted that signal when the selection changed through the underlying GtkFileChooserDialog.

To do this when the dialog is not active and the selection is changed by the calling program
(instead of by the user), we need to wait until the GtkFileChooserButton's UI has been updated
via an async callback from GIO.  So, we keep track of whether an entry point into the
button's API caused a programmatic change in the selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
a8c4d0935b filechooserbutton: For tests, wait for signals instead of just sleeping
This should let tests complete faster.  Also, this will let us test
that the correct signals are actually being emitted.

The tests now fail, as the signals are not being emitted when they
should.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
1247a842a2 filechooserbutton: whitespace fixes 2013-03-12 14:31:47 -06:00
Carl-Anton Ingmarsson
5d011386a6 label: Fix memleak
Caused by recent refactoring in e09957a47d
2013-03-12 20:23:09 +01:00
Benjamin Otte
fb170239c7 stylecontext: If we force invalidate, invalidate all properties
We only FORCE_INVALIDATE when something weird changes that the CSS
machinery can't detect. But now that our style_updated functions skip
recomputations when some properties don't change we want to make sure
these recomputations are still run. So we just claim all properties
changed.

http://bugzilla.gnome.org/show_bug.cgi?id=695482
2013-03-12 12:46:37 +01:00
Benjamin Otte
e09957a47d label: refactor code
If text didn't change, don't change it.

And if that sentence made no sense, that might explain why I refactored.
2013-03-12 12:46:37 +01:00
Aleksander Morgado
24fa277329 combobox: popdown the combobox when on 'grab-broken-event'
And also explicitly remove pointer/keyboard grabs from the display.

Whenever the grab is reported lost, we should popdown the combobox, so that the
GDK_WINDOW_TEMP window is hidden and removed from the toplevel, as done with
the menu for example.

Leaving the GDK_WINDOW_TEMP window open when re-activating the application
triggers several issues in the win32 backend, due to restacking windows of the
non-toplevel group into the toplevel group:

https://bugzilla.gnome.org/show_bug.cgi?id=695200
2013-03-12 07:23:17 -04:00
Federico Mena Quintero
1c796018d1 filechooserbutton: During unselect_all(), update the widgets in all situations
Not just if we thought we had a selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-11 18:16:29 -06:00
Federico Mena Quintero
3a86af43fa filechooserbutton: Add tests for unselect_all()
These all pass except one.
2013-03-11 18:16:29 -06:00
Federico Mena Quintero
f2d6def72e filechooserbutton: HACK: Set a reasonable size for the dialog in the tests' second iteration
Something is causing the GtkFileChooserDialog to be resized really small on the second time it is run
during each test for GtkFileChooserButton.  So as a temporary hack we set it to 500x500 pixels on
the second run, so the size allocation code doesn't bomb on us.
2013-03-11 18:16:29 -06:00
Federico Mena Quintero
cade42d509 gtkfilechooserbutton: In tests, allow the possibility of doing unselect_all 2013-03-11 18:16:29 -06:00
Federico Mena Quintero
45ad8a06ad filechooserbutton: When the combo box changes, set the *file*, not the current folder
The currently-selected file *is* the selection even in SELECT_FOLDER mode.  Do not confuse this
with the current folder.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-11 18:16:29 -06:00
Cosimo Cecchi
fd51c8f5e9 treeview: fix a critical warning
gtk_tree_view_column_unset_tree_view() resets column->priv->tree_view to
NULL.
The function is called when a column is removed, but later from the same
function we would call _gtk_tree_view_column_unrealize_button(), which
expects column->priv->tree_view to be != NULL, causing these critical
warnings

Gtk-CRITICAL **: gtk_widget_unregister_window: assertion
`GTK_IS_WIDGET (widget)' failed

This commit moves the call to unset the tree view after the button is
unrealized.

https://bugzilla.gnome.org/show_bug.cgi?id=695473
2013-03-08 20:20:28 -05:00
Matthias Clasen
1f8286004f Avoid a warning under Wayland
Just having an ifdef is not enough, we need to check the type
of the window at runtime.
2013-03-08 19:49:00 -05:00
Federico Mena Quintero
f076b6bb02 filechooserbutton: Update the combo box even after the dialog is cancelled
We assumed that we didn't have to update the combo box if the dialog got cancelled,
as it should simply retain its previous contents.  But this assumption doesn't work
as the dialog is brought up with the 'Other...' item - we don't want the
combo box to keep showing 'Other...' if the dialog is cancelled.

The test from the previous commit now passes.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:43:21 -06:00
Federico Mena Quintero
e4c2ef108c filechooserbutton: New test for opening the Other item in the combo box and then canceling the dialog
There is this bug:

1. Start with a file chooser button in SELECT_FOLDER mode, and select a folder from the combo box.

2. Click on the button's combo box, select 'Other...'

3. You get the file chooser dialog. Cancel the dialog.

4. The file chooser button's combo box still shows 'Other...' instead of
   showing the selection from (1).

This is a test to ensure that the original selection is restored.
The test fails right now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:37:21 -06:00
Matthias Clasen
1ddfc3a985 Fix the build
This was broken in commit 5bbbc47a4c
2013-03-08 06:26:34 -05:00
Aleksander Morgado
5bbbc47a4c spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
2013-03-08 11:23:11 +01:00
Federico Mena Quintero
67f5e595a7 filechooserbutton: Don't show the (None) item when the combo box is popped up
This is surprisingly tricky, since the (None) item *has* to be a visible item while
the combo box is *not* popped up, so that it can show its contents.  But the item
has to be *not* visible when the combo box is popped up.

Also, update the whole button's selection, not just the underlying dialog's, when
the combo box changes its selection - based on a patch by Paul Davis in
https://bugzilla.gnome.org/show_bug.cgi?id=691040#c20

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
1074aa0c49 filechooserbutton: In SELECT_FOLDER, when the selection is empty, show (None) in the combo box
We do this by adding a new row type, ROW_TYPE_EMPTY_SELECTION.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
bbf915118b filechooserbutton: Update the button/combo at construction time
This way the internal labels will show the correct selection even if nothing
has been selected programmatically.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
32aa7f0582 filechooserbutton: Update the button/combo whenever the selection is changed programmatically
We didn't change it when the file chooser button's dialog was inactive, and so
the actual file chooser button would not visually reflect the current selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
cc75ebec15 filechooserbutton: Test that the expected filename is shown
We do some gymnastics to pull the string out of the GtkButton or the GtkComboBox that is
being used in GtkFileChooserButton to show the current selection when the dialog
is inactive - namely, we look for the subwidget with the correct ATK role, and pull its
accessible name.

Currently the test fails; this is https://bugzilla.gnome.org/show_bug.cgi?id=691040#c18

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
8a17cad2e5 Don't mention gtk_set_locale() in docs; this function does not exist 2013-03-07 20:45:57 -06:00
Giovanni Campagna
ca2368dba9 GtkTextView: don't popdown a bubble if we don't have one
This causes a segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=695304
2013-03-06 17:08:48 +01:00
Bastien Nocera
ea043cab57 GtkEntry: Sanity check the end_pos value in _get_display_text() 2013-03-06 15:50:31 +01:00
Bastien Nocera
32825a66ac GtkLabelAccessible: Sanity check _get_text() input values 2013-03-06 15:50:30 +01:00
Federico Mena Quintero
a89d420270 filechooser: Use _gtk_file_has_native_path() throughout when testing for local_only
In the case of checking for local_only, g_file_is_native() is not useful, since it
will return FALSE for something in a FUSE mount.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Federico Mena Quintero
d484721b5c filechooser: Also convert get_uris() to returning native paths
It was only being done in gtk_file_chooser_get_uri().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Federico Mena Quintero
56bcb1933f filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
Negatives in names of boolean functions are confusing.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Timothy Arceri
cf216d780c filechooser: Show FUSE mounted locations in shortcuts
Since FUSE locations can be handled safely by applications show these mounted locations regardless of whether gtk_file_chooser_set_local_only()
is set to TRUE

https://bugzilla.gnome.org/show_bug.cgi?id=586367
2013-03-05 17:17:42 -06:00
Cosimo Cecchi
e54f8f4c62 GtkBubbleWindow: use OSD style class 2013-03-05 16:48:02 -05:00
Cosimo Cecchi
3c8e1c92a8 GtkBubbleWindow: rework how drawing is done
Use gtk_render_frame_gap(), refactoring the code fetching coordinates to
be usable by it. This allows for rounded corners in the window shape.
2013-03-05 16:48:01 -05:00
Cosimo Cecchi
6f1476edd3 GtkBubbleWindow: allocate CSS borders and paddings 2013-03-05 16:48:01 -05:00
Matthias Clasen
e1edc998a2 Rename property to be more neutral
Don't put toolbar in the name of the property - we may use
a different container down the road, and then this name
would be misleading.
2013-03-05 16:48:01 -05:00
Matthias Clasen
3c04597306 Really keep GtkBubbleWindow private
_-prefix the symbols to keep them from leaking out.
Also, un-doc-commentize the sources.
2013-03-05 16:48:01 -05:00
Matthias Clasen
7c2a752b37 Small documentation tweak 2013-03-05 16:48:01 -05:00
Matthias Clasen
190dcfe050 Popdown the bubble window when text view is scrolled 2013-03-05 16:48:01 -05:00
Matthias Clasen
88623b98a7 Allow to populate bubbles with extra content
We do this by making the ::populate-popup signals a little more
flexible. They used to just accept a GtkMenu as argument, now
they can take a menu or a toolbar. To not break the expectations
of existing callbacks, we only emit ::populate-popup with a toolbar
if the :populate-toolbar property is TRUE.
2013-03-05 16:48:00 -05:00
Matthias Clasen
f1f3a033e5 Drop GtkSelectionWindow
It is no longer used.
2013-03-05 16:48:00 -05:00
Matthias Clasen
bb3c56abe2 Do without GtkSelectionWindow
Just populate a toolbar directly, in GtkEntry and GtkTextView.
2013-03-05 16:48:00 -05:00
Matthias Clasen
a8ea64dbb1 Fix a typo 2013-03-05 16:48:00 -05:00
Carlos Garnacho
ceeed09d07 Made GtkBubble/SelectionWindow private at the moment 2013-03-05 16:48:00 -05:00
Carlos Garnacho
0ba92bc26d Use gdk_threads_add_timeout to popup the selection window
Second granularity may bite us back there
2013-03-05 16:47:59 -05:00
Matthias Clasen
9f41970832 Fix includes
gtkbubblewindow.h was including gtk.h, which in turn included
gtkselectionwindow.h, leading to build failure.
2013-03-05 16:47:59 -05:00
Carlos Garnacho
51ecaa062d Don't allow individual #includes for GtkBubble/SelectionWindow 2013-03-05 16:47:59 -05:00
Carlos Garnacho
a960230a20 GtkBubbleWindow: Use style border color to stroke the bubble shape
This improves themeability a bit, corners are still square though...
2013-03-05 16:47:59 -05:00
Carlos Garnacho
320613c439 textview: Use GtkSelectionWindow for touch text selection
This enables touch devices to manipulate the text selection
2013-03-05 16:47:59 -05:00
Carlos Garnacho
6767541ead entry: Use GtkSelectionWindow for touch text selection
This enables touch devices to manipulate the text selection
2013-03-05 16:47:59 -05:00
Carlos Garnacho
7260e0570c Add GtkSelectionWindow
This is a helper object to provide context-dependent content
edition apt for touch devices.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
51be6b88db Add GtkBubbleWindow
This popup window widget can be used for touch friendly context
menus that point to a concrete area.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
a97178af65 texthandle: Set a bigger input shape, covering the line height
Now, even if the handles being rendered are small, the handle touch
input shape will be as wide as the visible part of the rendered asset, and
high enough to cover both the handle and the height of the line where
the selection bound is.

Also, make handles have the same virtual distance to the line top/bottom
when a drag starts, so the handle doesn't jump to another line after a
too short threshold.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
17d3775555 Ensure the insertion handle stays on fake events (eg from IM)
Don't set handles mode to none if the event has send_event set.
For consistency with GtkEntry, also make GtkTextView keep the
handle mode on buffer changes.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
d97861bd8b texthandles: Keep state internally to avoid X overhead
Handles now do sync X calls less often. As visibility state
is kept, it now can move+resize+show handles at once instead
of in separated steps.
2013-03-05 16:47:58 -05:00
Benjamin Otte
dc331ccb17 entrycompletion: Don't reconnect signals all the time
We block signal handlers areound GtkEntry signal emission and if those
signals get used to call functions on the completion that cause a
reconnection of the signals, then the reconnected signals will not be
blocked anymore (so they might get emitted?) and unblocking the old
signal id will later cause warnings.

Fixes spurious warnings in gtk/tests/filechooser tests.
2013-03-05 13:09:10 +01:00
Benjamin Otte
173317e9ce a11y: Emit active-descendants-changed when focus changes
This fixes the a11y/tree-relationships testcase.

The emission was lost in refactoring in commit
76670734f4
2013-03-05 11:56:56 +01:00
Alban Browaeys
aa08f4d8f5 bin: initialize out variables to zero for get_preferred_ functions.
Fixes case of child not visible then minimum_width/heigth natural_width
/heigth not initialized. Thus caller gets a random value.

https://bugzilla.gnome.org/show_bug.cgi?id=695131
2013-03-04 20:04:05 -05:00
Aleksander Morgado
d98b4fd0b4 clipboard: remove dead code
When setting contents of the clipboard and ownership or user data changes, we
end up calling clipboard_unset() to fully cleanup the previous clipboard state.
This call will itself call clear_func() for the previous user_data, and always
reset both 'get_func' and 'clear_func' to NULL.

So it's actually not possible to have 'get_func' being non-NULL once we have
called clipboard_unset(), so just remove that condition check and the code
inside.

https://bugzilla.gnome.org/show_bug.cgi?id=694924
2013-03-04 19:37:38 -05:00
Michael Hofmann
670e532a6b GtkColorChooserWidget: deselect swatch before removing palettes
When adding custom palettes, set the current swatch to NULL if the
palette it is on is going to be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=693995
2013-03-04 18:32:00 -05:00
Will Thompson
c6fbdb67f3 gtkenums: correct various documentation typos 2013-03-04 22:49:43 +00:00
Will Thompson
507bf6e5cf docs: correct various spelling and grammar errors
I noticed a few cases of "wether", and while fixing them noticed a few
"its" which should be "it's". It all went downhill from there.
2013-03-04 22:48:22 +00:00
Giovanni Campagna
9d81b69e06 GtkIconTheme: fix regression from 0db32f0632
icon_info_dup() is now called also for GtkIconInfos that already have
a pixbuf, so we must make sure that we correctly carry that from
the original icon_info to the copy.
2013-03-04 21:34:23 +01:00
Cosimo Cecchi
944fa635ae appchooserdialog: remove redundant checks
This is checked by GIO for us now.
Also, it's generally just a bad idea spawning error dialogs from inside
a library on top of other dialogs: lesson learned.

https://bugzilla.gnome.org/show_bug.cgi?id=675333
2013-03-04 14:41:21 -05:00
Giovanni Campagna
0db32f0632 GtkIconTheme: fix failed assertion when asynchrnously loading emblemed icons
If you tried to lookup an icon that was not emblemed, and then looked up
an emblemed icon with the same base, we would override the iconinfo adding
the emblems inline. Later, when the icon finished rendering, inside
gtk_icon_info_load_icon_finish, we would copy the result from the duplicate
(which did not include the emblem infos), but the icon would still fail the
assertion, because emblems infos are present but emblem_applied is false
(they were not requested in the first place!).
Solve this by avoiding the overwrite on a cached iconinfo, and instead duplicate
the iconinfo before adding the emblems. It is expected that another layer
of caching (such as StTextureCache in gnome-shell) will take care of avoiding
multiple rendering of the same icon+emblem combination.

https://bugzilla.gnome.org/show_bug.cgi?id=694968
2013-03-04 16:28:00 +01:00
William Jon McCann
cb27c4b08c Place the search icon in the primary slot of the entry
Instead of using the secondary slot for both clear and search. This
Makes it possible to use the search icon for actions regardless of
whether text has been entered, makes it possible to use the primary
icon to indicate search status, allows us to indicate the purpose
of the entry even if text has been already entered.

https://bugzilla.gnome.org/show_bug.cgi?id=694990
2013-03-03 11:16:09 -05:00
Matthias Clasen
b1fad0f478 Fix make check 2013-03-01 19:27:10 -05:00
Cosimo Cecchi
50065b7ba0 treeview: center expander allocated space
This patch centers the expander in the extra space allocated by the
horizontal-separator style property.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2013-03-01 13:55:05 -05:00
Cosimo Cecchi
d0895d6c0f treeview: properly calculate the treeview expander size
It should be expander-size + horizontal-separator / 2. Rework code
calculating the render position of the arrow to account for the larger
size.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2013-03-01 13:55:05 -05:00
Cosimo Cecchi
32bd10bf74 treeview: remove extra padding handling
We'll replace this with a proper calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2013-03-01 13:55:05 -05:00
Alexander Larsson
c4539df2f2 Re-fix opacity group handling
The last change fixed the windowed widget case but broke
opacity group handling for windowed child widgets. This fixes
up the code by making sure we norender_children in when there
is an opacity group.

This also cleans up the comments about how this works to something
that is hopefully more understandable.
2013-03-01 14:56:30 +01:00
Alexander Larsson
b5ee44b419 TextView: Properly render background
We always need to render the background, as the window
background is not always set (i.e. during gtk_widget_draw()) or
when its partially visible.

https://bugzilla.gnome.org/show_bug.cgi?id=694925
2013-03-01 12:50:20 +01:00
Matthias Clasen
02e9152738 Fix DND with frame sync
Mutter magically ignores override-redirect windows with geometry
-100-100+1+1, and this breaks the frame synchronization between
gtk+ and mutter. For now, we avoid the issue by simply giving
the window a different geometry.
https://bugzilla.gnome.org/show_bug.cgi?id=694217
2013-02-28 07:48:06 -05:00
Matthias Clasen
4bb90a7443 Remove GTK_SELECTION_MODE_EXTENDED from the docs
It does not exist anymore as an enum value.
2013-02-28 07:48:06 -05:00
Cosimo Cecchi
d434a9103c range: don't draw origin when the slider is invisible
When the range of the GtkRange is zero (i.e. the upper and lower bounds
of the adjustment have the same value), don't use an origin to draw the
trough, as the slider will also be hidden, and the juncture between the
two sections of the trough will be visible.
2013-02-27 17:20:59 -05:00
Alexander Larsson
bbfc8f9a9b Fix opacity group hack
We can't norender the main window for a windowed widget as we then
never get any expose events.
2013-02-27 12:59:19 +01:00
Benjamin Otte
ce0675f1fb a11y: Emit text-changed signals when the text-buffer changes 2013-02-26 16:17:33 +01:00
Benjamin Otte
16e902d20a API: Export gtk_cell_renderer_class_set_accessible_type()
This function is necessary to implement cell renderer accessibility
support.
2013-02-25 21:42:31 +01:00
Matthias Clasen
b234025410 Some more documentation fixes
Make frame-clock-related symbols show up in the gtk docs.
2013-02-25 11:30:00 +01:00
Cosimo Cecchi
61344219d4 Revert "box: Don't special-case RTL hbox child positions anymore"
This reverts commit 6f86e57c4f.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:24 -05:00
Cosimo Cecchi
a07f767ed4 Revert "toolbar: Don't special-case RTL toolbar child positions anymore"
This reverts commit 821a675013.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:23 -05:00
Cosimo Cecchi
894f84c623 Revert "combobox: Don't special-case RTL child positions anymore"
This reverts commit cf712c462d.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:23 -05:00
Federico Mena Quintero
1708ae3f1a filechooserbutton: Don't ever use gtk_file_chooser_get_files()
The file chooser button only supports single-selection modes, so
switch the code to a simpler gtk_file_chooser_get_file() to avoid
dealing with GSLists of a single file.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-21 18:52:39 -06:00
Federico Mena Quintero
a41b73fbc7 GtkWidget::draw() - Document how to get the dirty region
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-21 18:48:13 -06:00
Руслан Ижбулатов
8e80fd1ab9 Make sure icon cache has /-separated subdirs only (v2 - use g_build_path)
https://bugzilla.gnome.org/show_bug.cgi?id=692955
2013-02-21 19:42:46 +01:00
Chun-wei Fan
d861779b69 Redo Completion of Visual Studio projects for gtka11y
Update the Visual Studio projects for gtka11y and the completion of the
projects that go along with it.  This have been distcheck'ed on my Ubuntu
12.04 system.
2013-02-21 15:48:04 +08:00
Federico Mena Quintero
77154f295f filechooserbutton: In tests, sleep after opening the dialog
This may ensure that the dialog is actually done initializing.  We need to kill this
sleeping business and really use signals, sigh...

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:13:07 -06:00
Federico Mena Quintero
158d74d257 filechooserbutton: Don't emit file-set signal when the change is not the result of a user action
We only emit that signal when the user confirms the button's internal GtkFileChooserDialog,
or when he drags-and-drops stuff into the button.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:13:03 -06:00
Federico Mena Quintero
cefcafc508 filechooserbutton: In the tests, run through the dialog more than one time
This ensures that data maintained by the button while the dialog opens/closes remains consistent.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:12:52 -06:00
Federico Mena Quintero
ac5cc19836 filechooserbutton: Add tests for cancelling the dialog via closing it (delete-event), instead of by simulating the Cancel button (response cancel)
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:09:13 -06:00
Federico Mena Quintero
2deb41fe63 filechooser: When stopping/clearing BROWSE model, really ensure that we end up in LOAD_EMPTY state
Previously we could end up in a situation where browse_list_model==NULL, and yet load_state==LOAD_FINISHED.
This is not a valid state.  So, when we get rid of the list model, really ensure that we end up
in LOAD_EMPTY so nothing assumes that there is a valid list model around.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:09:08 -06:00