Commit Graph

17263 Commits

Author SHA1 Message Date
Benjamin Otte
912d5a5c23 cssvalue: Make the array parser no longer parse "none"
Arrays that support it, handle it themselves.
2012-09-03 12:54:14 +02:00
Benjamin Otte
44ba5d253f css: Redo bindings parsing
I want to get away from the ability to have 0-length arrays, all css
arrays are single element.
Even if the element is "none", it is still a "none" element.
2012-09-03 12:54:14 +02:00
Claudio Saavedra
21d0db8254 gtkliststore: fix documentation typo 2012-09-03 11:00:15 +03:00
Matthias Clasen
8c3a668d52 Add a way to test touch features
The GTK_TEST_TOUCHSCREEN envvar is now checked in entries
and textviews to allow testing of text handles with other
kinds of devices.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
5bda3a001d Implement touch text selection in GtkTextView
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions and possibly
obscure portions of the selected text.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
d38efb1713 Implement touch text selection in GtkEntry
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions (This is more
important though on GtkTextView, as inverted handles may
obscure portions of the selected text, good for consistence
though)
2012-09-03 00:19:46 -04:00
Carlos Garnacho
1f7e375c33 Add GtkTextHandle
This is a helper object to allow text widgets to implement
text selection on touch devices. It allows for both cursor
placement and text selection, displaying draggable handles
on/around the cursor and selection bound positions.

Currently, this is private to GTK+, and only available to
GtkEntry and GtkTextView.
2012-09-03 00:19:03 -04:00
Carlos Garnacho
8c632417c4 scrolledwindow: don't capture events meant for non-child windows
GtkTextHandle creates temporary override redirect windows, but still
hook to the text widget for events, so those are effectively captured
by GtkScrolledWindow if a text widget is within it
2012-09-02 20:30:53 -04:00
Matthias Clasen
95f64a4d4d Revert "menubutton: make it work with custom content in .ui file"
This reverts commit 6e6487b461.
2012-08-31 23:10:30 -04:00
Matthias Clasen
9e4b550c98 GtkMenuButton: Override add
By removing an existing child in add, if it is our own arrow,
we can make things work better in GtkBuilder.

https://bugzilla.gnome.org/show_bug.cgi?id=682291
2012-08-31 22:58:25 -04:00
David Zeuthen
6e6487b461 menubutton: make it work with custom content in .ui file
This was reported in bug 682291.

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

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-08-31 22:58:10 -04:00
Rui Matos
ed7a417dcb window: Add a delay before automatically showing mnemonics
Showing mnemonics immediately on modifier press can be annoying and
distracting when the user is just trying to Alt+Tab into another
application/window since the mnemonic will show up and quickly vanish
again when we receive the focus out event.

https://bugzilla.gnome.org/show_bug.cgi?id=672431
2012-08-31 22:53:23 -04:00
Matthias Clasen
adcd3a039e Fix positioning of file format radios
When the file name changes, the file format radios were dancing
around. This commit keeps them flush right.
2012-08-31 22:50:29 -04:00
Matthias Clasen
97ee5efb4b Fix mnemonic activation for some printer option widgets
The file type radio group has a mnemonic on its label, but
activating it did not work, since GtkPrinterOptionWidget did
not know to forward the activation to one of the buttons.
2012-08-31 22:50:28 -04:00
Sebastian Geiger
4c67e71c63 Improve print to file options in print dialog
* This patch gets rid of the separated
   fields for selecting a print to file
   target by removing the folder selection
   button and the entry. It is replaced by
   a browse button,  which opens a file
   selection dialog, that can select both
   the path AND the filename.
 * If the filename is relativ to the home
   folder it will substitute ~/ instead of
   the home folder. Additionally if the
   resulting filename is longer than 30
   characters, it cut of the first part
   and replace it by '...' so that
   the button text never gets too long.

https://bugzilla.gnome.org/show_bug.cgi?id=682129
2012-08-31 22:50:28 -04:00
Matthias Clasen
1ac2982265 Allow setting Pango attributes on entries
This is useful to adjust the weight or scale of the text.
2012-08-31 15:09:55 -04:00
Sebastian Geiger
afc7466dfd [GtkFileChooserButton] bgo#645065 - Restore the previously-selected file when the button's GtkFileChooserDialog is canceled
The file chooser is asynchronous, so doing 'select_file (old_file)' and subsequently querying
the file for updating the labels is not going to work.  However, the underlying file chooser
will emit 'selection-changed' as appropriate when it finishes restoring the old file.  So,
we only need to update the labels when the file chooser dialog is confirmed, not cancelled.
2012-08-31 12:02:00 -05:00
Matthias Clasen
e5b2ca5d89 Move entry completion code where it belongs
This commit moves all the entry completion implementation
into gtkentrycompletion.c. It also gets rid of an unnecessary
completion_device member in GtkEntryPrivate.
2012-08-31 10:47:23 -04:00
Matthias Clasen
ee2ad441ca GtkEntry: pack GtkEntryPrivate a bit better 2012-08-30 22:14:23 -04:00
Erik van Pienbroek
9d3c8122f1 Also compile gtkdbusgenerated.c on non-UNIX environments
When compiling gtk on Win32 then the file gtkdbusgenerated.c also needs to be
compiled and linked into the gtk library as it's needed for GtkMountOperation

https://bugzilla.gnome.org/show_bug.cgi?id=682825
2012-08-30 21:19:13 -04:00
William Jon McCann
9fa1b4f65f Always make primary headings bold in message dialogs
Unless they have markup. But only use big text if there is
secondary text.

https://bugzilla.gnome.org/show_bug.cgi?id=683001
2012-08-30 14:09:42 -04:00
Matthias Clasen
df40ba521b Remove unintentional symbol export
Just a forgotten static.
2012-08-29 18:16:34 -04:00
Matthias Clasen
3d591ef112 Revert "gtk: Fix exports for new symbols"
This reverts commit 07b33586e2.
2012-08-29 18:15:46 -04:00
Rico Tzschichholz
07b33586e2 gtk: Fix exports for new symbols 2012-08-29 08:17:36 +02:00
Cosimo Cecchi
582a3a3193 scrolled-window: fix rendering of scrolled window background
- don't poke at the children's background pattern at draw time, but just
  call gtk_render_background()
- we should propagate rendering of the background to the overshoot
  window when the state flags or the style changes, or it won't respond
  to e.g. focused/backdrop changes correctly

https://bugzilla.gnome.org/show_bug.cgi?id=682854
2012-08-28 11:51:18 -04:00
Benjamin Otte
fe026b3b2f css: Remove unused macro
GTK_CSS_DEPENDS_ON_EVERYTHING was used as a placeholder when
implementing dependencies. Now that dependencies are completely
implemented, it's no longer necessary.
2012-08-28 15:42:25 +02:00
Benjamin Otte
e1a1432bd3 cssimage: Implement dependencies for images 2012-08-28 15:42:25 +02:00
Benjamin Otte
3a65fbfc13 cssvalue: Implement dependency tracking for gradients 2012-08-28 15:42:25 +02:00
Benjamin Otte
3cf6db8b1a cssvalue: Handle dependencies for typed values 2012-08-28 15:42:24 +02:00
Benjamin Otte
11d0f9e408 css: Make color lookup handle dependencies 2012-08-28 15:42:24 +02:00
Matthias Clasen
27fd3fdf81 css: Handle some more simple cases of dependencies 2012-08-28 15:42:24 +02:00
Benjamin Otte
012526241a cssvalue: First step of proper dependency tracking
Instead of using the EVERYTHING aka FIXME value for tdependencies,
actually compute the dependencies in a bunch of simple cases.
2012-08-28 15:42:24 +02:00
Benjamin Otte
8ff08e7c5e stylecontext: Update computed values when dependencies change
This fixes the longstanding bug where GTK would not update styles when
parent styles would change.

https://bugzilla.gnome.org/show_bug.cgi?id=672046
2012-08-28 15:42:24 +02:00
Benjamin Otte
a770f0c3eb stylecontext: Refactor some code
This just changes the arguments passed to build_properties() and moves
that function around in the source file. No functional changes are
happening.
2012-08-28 15:42:24 +02:00
Benjamin Otte
1d7b23845f css: Pass relevant properties to css lookup code
This is not used yet in this patch.
2012-08-28 15:42:24 +02:00
Benjamin Otte
6fbd8b0003 computedvalues: Pass dependencies to set_value()
This simplifies the code.
2012-08-28 15:42:24 +02:00
Benjamin Otte
8874a06ba0 stylecontext: Compute correct changes
... in the case where no change of the DOM tree actually happened.

We don't do anything yet with that information, this patch just
correctly computes it.
2012-08-28 15:42:24 +02:00
Benjamin Otte
5d2acb1fe9 stylecontext: Split out a function for simplicity 2012-08-28 15:42:23 +02:00
Benjamin Otte
9b228c59d5 cssomputedvalues: Track dependencies
We now track what values have dependencies on what other values so that
we could in theory recompute them when we need to.
2012-08-28 15:42:23 +02:00
Benjamin Otte
2cb9dac14c stylecontext: Pass the changes in the parent to validation function
This way, inherited properties can be updated.
2012-08-28 15:42:23 +02:00
Benjamin Otte
0e2f35ed88 css: Introduce dependencies for value computations
When values are computed, they might depend on various other values and
we need to track this so we can update the values when those other
values change. This is the first step in making that happen.

This patch does not do any dependency tracking at all, instead it uses
GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.
2012-08-28 15:42:23 +02:00
Benjamin Otte
9e7e65ca6e css: Move computing of initial and inherit values
... to the compute vfunc. Simplifies code quite a bit. But makes the
code no longer a simple step-by-step implementation of the spec.
2012-08-28 15:40:57 +02:00
Benjamin Otte
6dc3113edc cssstyleproperty: Get rid of unused API
Both _gtk_css_style_property_print_value() and
_gtk_css_style_property_compute_value() aren't necessary anymore and are
replaced by _gtk_css_value_print() and _gtk_css_value_comptue()
respectively.
2012-08-28 15:40:57 +02:00
Benjamin Otte
36c79712a1 csscustomproperty: Move compute code to GtkCssTypedValue
This way, we don't need the print_value vfunc anymore.
2012-08-28 15:40:57 +02:00
Benjamin Otte
c9b918b70f cssstyleproperty: Don't set print or compute vfuncs anymore
Nobody does that these days.
2012-08-28 15:40:57 +02:00
Benjamin Otte
ec4c1e5682 cssstyleproperty: Remove all useless compute vfuncs
Now that we call _compute() by default, we don't need any special cases
anymore that do the same thing.
2012-08-28 15:40:57 +02:00
Benjamin Otte
bc5d383b9d cssstyleproperty: Call _compute() in the compute function
... instead pof just reffing the value.
2012-08-28 15:40:57 +02:00
Benjamin Otte
c0df9067dc css: Move special case for 0px borders
This is in preparation for the next commits.
2012-08-28 15:40:56 +02:00
Benjamin Otte
09f9fd42b4 css: Fold color value computation into gtksymboliccolor.c
This gets rid of the public function
_gtk_css_rgba_value_compute_from_symbolic().
The fallback is now handled using a switch statement instead of letting
the caller pass the function.
2012-08-28 15:40:56 +02:00
Benjamin Otte
9b4ed66218 css: Pass property_id to compute function
This is a reorganization of how value computing should be done.
Previously the GtkCssStyleProperty.compute vfunc was supposed to take
care of special cases when it needed those for computation. However,
this proved to be very complicated in cases where values were nested and
only the last value (of a common type) needed to be special cased.

A common example for this was the fallback handling for unresolvable
colors.

Now, we pass the property's ID along with all compute functions so we
can do the special casing where it's necessary.
Note that no actual changes happen in this commit. This will happen in
follow-ups.
2012-08-28 15:40:56 +02:00
Benjamin Otte
9b953829fb css: Introduce _gtk_css_value_compute()
This commit is essentially a large reorganization. Instead of all value
subtypes having their own compute function, there is the general
_gtk_css_value_compute() function that then calls a vfunc on the
subtype.
2012-08-28 15:40:56 +02:00
Adel Gadllah
13a821e70b gkimmulticontext: Remove left over debug print
Remove the g_print debug statement from propagate_purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=682747
2012-08-26 22:26:23 -04:00
William Jon McCann
b3a65248f5 Fix a typo in the the comments
https://bugzilla.gnome.org/show_bug.cgi?id=682724
2012-08-26 22:54:55 +08:00
Thomas Hindoe Paaboel Andersen
3e7b66fcee Docs: GtkAspectFrame: use top/bottom for vertical alignment
Before left/right was used.

https://bugzilla.gnome.org/show_bug.cgi?id=682662
2012-08-26 01:01:59 +02:00
Matthias Clasen
870c39fafe GtkIMMultcontext: Propagate input purpose and hints
The lack of this was pointed out by Carlos Garnacho in
https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-25 15:42:42 -04:00
Carlos Garnacho
8d4487b0be Add GTK_INPUT_HINT_INHIBIT_OSK to GtkInputHints
This hint may be used in text widgets to inhibit their
input methods. The most compelling usecase is calculator
applications, which already have a builtin and better
suited onscreen keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-25 15:42:30 -04:00
Matthias Clasen
0cb56312b9 Trivial: Fix a whitespace messup
Pointed out by Carlos Garnacho in bug 651244.
2012-08-25 14:24:20 -04:00
William Jon McCann
e296bff85f Improve the layout of the mount operation dialog
This improves the layout of the mount operations dialog to:
 * Make primary labels bold in all cases
 * Lay out the widgets in a grid
 * Put space between the two radio groups to distinguish them

https://bugzilla.gnome.org/show_bug.cgi?id=682552
2012-08-24 18:10:39 -04:00
Ryan Lortie
828a97d773 GtkWidget: fix insert_action_group(NULL)
gtk_widget_insert_action_group (widget, "foo", NULL) is valid, but
g_action_muxer_insert (muxer, "foo", NULL) is not.  Use
g_action_muxer_remove() for that case.
2012-08-23 08:18:11 -04:00
John Ralls
d6a559216f Protect pasteboard GtkTargetPair flag values from being out of range 2012-08-22 14:43:20 -07:00
John Ralls
398dc1cf27 Copy in annotations missing from gtkdnd-quartz and gtkclipboard-quartz 2012-08-22 14:39:11 -07:00
Ryan Lortie
81e76746ff GtkActionHelper: two small fixups in _set_target_value()
First, ensure we always consume floating values, as documented.

Second (and more serious), don't try to query the action if the
action name is not set yet.  This will cause crashes...
2012-08-22 00:54:57 -04:00
William Jon McCann
515e211d0b Don't left align label in check buttons when they have no indicator
Because they should be normal buttons in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=681617
2012-08-21 07:09:14 -04:00
Cosimo Cecchi
de3cfa6034 modelmenu: fix a GCC warning
This should not be a const string, since the caller is supposed to free
it.
2012-08-21 11:15:32 +02:00
Cosimo Cecchi
4e9f4fbc77 textview: fix a typo in method gtk-doc annotation
This was causing a warning from the introspection scanner.
2012-08-21 11:14:46 +02:00
Cosimo Cecchi
f6079f6406 menubutton: use consistent parameter names
Or the introspection scanner will emit a warning.
2012-08-21 11:14:16 +02:00
Matthias Clasen
79eeb78c46 Fix the doc build 2012-08-20 23:38:03 -04:00
Matthias Clasen
ed04b879c0 Fix exports for new symbols 2012-08-20 23:38:00 -04:00
Matthias Clasen
0101a735a3 Add documentation
Document the new API and properties, and their interaction with
existing properties.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:22 -04:00
Matthias Clasen
7d1c1a8d20 GtkTextView: Add input purpose and hints
Add input-purpose and input-hints properties and pass these through
to the GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:22 -04:00
Matthias Clasen
eaaee081b1 GtkEntry: Add input purpose and hints
Add input-purpose and input-hints properties to GtkEntry,
and pass these on to GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:21 -04:00
Matthias Clasen
3cb4aa44b3 GtkIMContext: Add purpose and hints
Add input-purpose and input-hints properties to GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:21 -04:00
Krzesimir Nowak
8a8c434737 enums: Add purpose enum and hints flags.
This commit adds two enumerations that will be used
to pass additional information to input methods, in
the subsequent commits.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:20 -04:00
Ryan Lortie
0244dc8017 GtkMenuButton: rename _set_menu() to _set_popup()
It's too close to the release so we'll keep _set_menu() around, but
deprecate it, pointing to the new API.  It will be removed (and the name
reused) before the 3.6.0 release.

https://bugzilla.gnome.org/show_bug.cgi?id=682235
2012-08-20 17:04:14 -04:00
William Jon McCann
c5c46a125e icon-view: emit selection-changed when changing the model
Only if there was a selection active.

https://bugzilla.gnome.org/show_bug.cgi?id=681613
2012-08-20 13:59:09 -04:00
Lars Uebernickel
710674720e gtkmodelmenu: add support for action namespaces
If a section or submenu item has a "action-namespace" attribute, the
action names of the created GtkModelMenuItems will be prefixed with that
namespace.  Namespaces can be cascaded.
2012-08-20 13:13:50 -04:00
Ryan Lortie
5634eb226f GtkApplicationWindow: drop GActionMuxer use
There are no remaining users of the GActionMuxer in GtkApplicationWindow
because they've all been ported over to using the one on GtkWidget (via
GtkActionHelper, for the most part).
2012-08-20 13:13:50 -04:00
Ryan Lortie
4dd7de2e68 Drop GSimpleActionObserver
The only place that this was being created was in GtkApplicationWindow
and the last commit dropped that code.
2012-08-20 13:13:49 -04:00
Ryan Lortie
315d43e8a9 Remove private appwindow observer creation API
There are no remaining users of the GtkApplicationWindow API to create
GSimpleActionObserver or to get the GActionObservable (ie: muxer) for
the appwindow.  Drop those APIs.
2012-08-20 13:13:49 -04:00
Lars Uebernickel
86d7c9d5b5 ApplicationWindow: setup accels with widget muxer
Use the muxer from GtkWidget to setup the accels rather than our own
local muxer (which will soon be removed).
2012-08-20 13:13:49 -04:00
Ryan Lortie
fd9b7bbfac Remove #include for muxer from gtkapplication.c 2012-08-20 13:13:49 -04:00
William Hua
fe48e077bd Action helper support in Mac OS menus. 2012-08-20 13:13:49 -04:00
Ryan Lortie
dd45862a06 gtkmodelmenu: move to new action regime
Drop the explicit passing of GActionGroup into the GtkMenu(Bar)
constructors and operate from the action context instead.

With GtkMenuItem implementing GtkActionable, this turns out to be pretty
easy (and most of the code can be removed from GtkModelMenuItem,
including the GActionObserver implementation).
2012-08-20 13:13:49 -04:00
Ryan Lortie
ea5a56dacf GtkMenuItem: implement GtkActionable
...using the new GtkActionHelper
2012-08-20 13:13:45 -04:00
Ryan Lortie
694be447e3 port GtkButton to GtkActionHelper 2012-08-20 13:11:02 -04:00
Ryan Lortie
fbb38e95ac port GtkSwitch to GtkActionHelper 2012-08-20 13:11:01 -04:00
Lars Uebernickel
ab3b41374a Add two users of gtk_widget_insert_action_group
Each GtkWindow with an associated GtkApplication should add this as
"app" to its action context.  Each GtkApplicationWindow is its own
GActionGroup, and it should add itself to itself with the prefix "win".

There is now some duplication here because we have the new GActionMuxer
hierarchy managed by GtkWidget, but GtkApplicationWindow still carries
its own muxer.  The redundancy will be removed in a future patch.
2012-08-20 13:11:01 -04:00
Ryan Lortie
652f16dd98 introduce private GtkActionHelper
The current process of implementing GActionObserver is annoying and the
GSimpleActionObserver interface leaves a lot to be desired.  Introduce a
new class, GtkActionHelper that gives you pretty much everything you'd
want to do as an implementor of GtkActionable.

The GtkActionHelper also features an "application" mode that is not
associated with a particular GtkWidget but rather with whatever widget
happens to be the active window of the given GtkApplication at a
particular point in time.  This will be useful for the Mac OS menubar.
2012-08-20 13:11:01 -04:00
Lars Uebernickel
d30d56452c GtkWidget: Add gtk_widget_insert_action_group()
This allows adding a GActionGroup with a given name at an arbitrary
point in the widget tree.

This patch also adds an internal _get_action_muxer() API.  Calling this
will create a GActionMuxer associated with the widget.  The parent of
the muxer will be the muxer of the widget's conceptual parent.  For
non-menus, that is the normal parent.  For menus, it is the attach
widget.

In this way, we end up with a hierarchy of GActionMuxer that largely
reflects the hierarchy of GtkWidget, but only in places that the action
context has been requested.  These muxers are the ones on which the
inserted actions groups are installed.

A following patch will add a user of this API.
2012-08-20 13:09:04 -04:00
Ryan Lortie
2e57819477 GtkApplication: add 'active-window' property 2012-08-20 13:08:17 -04:00
Lars Uebernickel
d1c458f9e1 GActionMuxer: add support for parent muxers
If a muxer does not contain an action group with the given prefix, chain
up to the "parent" muxer to look for it.

This initial implementation is rather inefficient.  It will lead to
changes on action groups associated with parent muxers being broadcast
to all children (regardless of if anybody there is interested or not).
An optimised version will follow soon.
2012-08-20 13:08:17 -04:00
Alexander Larsson
6b7eaf86ed GtkMountOperation: Return the right password_save
If the buttons were never sent we returned the wrong
default value (i.e. not what the UI displayed).
2012-08-20 17:07:54 +02:00
Emmanuele Bassi
78107b1a7d docs: Fix up the RadioButton example in the description 2012-08-20 11:03:17 +01:00
Frédéric Péters
9399275089 doc: fix location of ATK documentation (GNOME bug 682193) 2012-08-19 19:07:22 +02:00
Colin Walters
9ca355b460 GtkEntryAccessible: Remove unused variable 2012-08-16 10:37:05 -04:00
Chun-wei Fan
628892bce8 gtk/gtklevelbar.c: Fix build on non-C99 compilers
-Include fallback-c89.c for the usage of round(), where an implementation
 of round() is provided for compilers that don't have it
-Use g_ascii_strtod() instead of strtof as strtof() may not be universally
 available.
2012-08-16 13:42:13 +08:00
Colin Walters
8ac04de2aa Fix _gtk_entry_get_borders() declaration
Regression introduced by https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-14 19:47:28 -04:00
David King
9d11da702b docs: Clarify GtkToggleButton action documentation
https://bugzilla.gnome.org/show_bug.cgi?id=373279
2012-08-14 12:43:39 +01:00
William Jon McCann
374d48c37b Fix typo in documentation 2012-08-10 13:03:10 -04:00
Mario Sanchez Prada
63e2a0ff0c Expose the masked string for password fields to assistive technologies.
Call _gtk_entry_get_display_text()from gtkentryaccessible.c to make
sure we always consider the actual text being displayed when
implementing the functions from the AtkTet interface.

https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-10 18:09:06 +02:00
Mario Sanchez Prada
58a9244518 Export gtk_entry_get_display_text() as a private function through
gtkentryprivate.h, so we can use it from gtkentryaccessible.c

https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-10 18:09:06 +02:00
Cosimo Cecchi
319bb2641b appchooserdialog: add a missing label mnemonic
https://bugzilla.gnome.org/show_bug.cgi?id=681577
2012-08-10 13:28:01 +02:00
Claudio Saavedra
560952d3c0 Chain up relevant GObjectClass:notify vfuncs
These widgets have ancestors other than GObject which could eventually
implement the notify vfunc for their properties. For correctness, they
should chain up the notify vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=673478
2012-08-07 18:14:56 +03:00
Cosimo Cecchi
8062e471d1 toolbar: deprecate shadow-type style property
While shadow-type *properties* can make sense, to opt-out of the
padding/border machinery programmatically, having it as a style
property doesn't make any sense, since we have a better way to change
the bevel style from the theme already.
This commit deprecates the shadow-type style property in GtkToolbar.
2012-08-07 16:08:45 +02:00
Cosimo Cecchi
1ec6329f18 toolbar: don't request CSS padding twice
This is a regression from commit
d0d21a4f00.

We are requesting the CSS padding twice: once unconditionally and
another time if SHADOW_TYPE != NONE, which is usually the case.
2012-08-07 16:05:30 +02:00
Cosimo Cecchi
512fee6363 toolbar: deprecate internal-padding style property
This is equivalent to a regular CSS padding, and that's what people
should use.
2012-08-07 12:55:37 +02:00
Matthias Clasen
f89d5c8280 Optimize gtk_widget_path_copy() by preallocating "elems" array
gtk_widget_path_copy() currently calls g_array_append_val() in a loop,
which is inefficient due to reallocating the array's memory. Calling
g_array_set_size() before entering the loop reduces the number of CPU
cycles used by roughly 30%.

Patch by John Lindgren,
https://bugzilla.gnome.org/show_bug.cgi?id=679978
2012-08-07 00:38:48 -04:00
Matthias Clasen
e2c15e2791 Fix a memory leak
As Pavel Vesin pointed out in bug 681064, we were leaking
the container_restyle_queue.
2012-08-06 23:37:36 -04:00
Matthias Clasen
2661403f88 Fix DND keyboard control with XI2
We are using XI2 to grab the key events, but we did not do the
necessary extra work to make GDK deliver root window events to us.

https://bugzilla.gnome.org/show_bug.cgi?id=681006
2012-08-06 22:56:59 -04:00
Matthias Clasen
5a3442bf9c Improve GtkMenuButton menu positioning
Take the menu halign/valign into consideration when positioning
the menu. Also, document the various combinations.

https://bugzilla.gnome.org/show_bug.cgi?id=680988
2012-08-06 22:27:48 -04:00
Matthias Clasen
4942b6f5e4 Remove references to deprecated functions
This inconsistency of the docs was pointed out by
Pierre-Yves Luyten in bug 680949.
2012-08-06 22:27:48 -04:00
Javier Jardón
351c1ab149 gtk/gtkadjustment.c: Improve docs
Refer to #GtkAdjustment properties instead fields
2012-08-07 03:20:50 +09:00
Paolo Borelli
d0d21a4f00 Make GtkToolbar honour css border and padding
The widget is already calling gtk_render_frame, but is not measuring css
border and padding when negotiating its size. This patch replaces the
already existing get_internal_padding static helper with a function that
sums the old internal-padding value with the values specified via css.
2012-08-05 12:52:36 +02:00
Michael Natterer
13ad089bdf gtk: ref the action around gtk_action_emit_activate()
for the same reason we already ref the action's group in the function.
(cherry picked from commit ebe50bbecb)
2012-08-03 23:28:05 +02:00
René Stadler
e5269ebbcd iconview: fix get_tooltip_context transfer annotation
Just like treeview.

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

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

This is a regression from commit
325cf071d1.

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

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

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

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

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

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

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

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

.view.image {

}

CSS selector.

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

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

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

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

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

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

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

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

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

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

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

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

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

Pushed by mistake.
2012-07-11 07:15:34 -04:00