Commit Graph

620 Commits

Author SHA1 Message Date
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
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
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
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
Cosimo Cecchi
f30eab099b entry: guard for != NULL before unreffing the pixbuf
In gtk_entry_get_icon_pixbuf() we unreference the pixbuf that
_gtk_icon_helper_ensure_pixbuf() gives us back, since the function
doesn't return a reference, and by doing so we're able to return the
reference owned by the cached icon helper.
Since the icon helper method can return NULL though, if no icon
properties have been set on it, guard for != NULL before unreffing the
pixbuf, as that would cause a critical warning.

https://bugzilla.gnome.org/show_bug.cgi?id=679537
2012-07-08 00:34:33 -04:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Cosimo Cecchi
3851a1cf90 entry-completion: don't move to leftmost character with inline-selection
When inline-selection is set, and the completion popup is showing,
pressing left abruptly jumps to the beginning of the entry text.
This is not expected, since the cursor is at the end of the text before
the left key is pressed, and this behavior is completely inconsistent
with how an entry would normally behave.
The behavior can be observed in Epiphany by selecting a completion match
and pressing left.

This patch changes the code so that it just runs the default entry key
press keybindings in such a case.

https://bugzilla.gnome.org/show_bug.cgi?id=677915
2012-06-13 17:09:09 -04:00
Matthias Clasen
b5d18b3e59 fix a typo 2012-06-13 16:33:47 -04:00
Matthias Clasen
4a25bac0e7 Update docs for GtkEntry::activate
Remove the 'you shall not connect' message from this signal.
While it is a keybinding signal, using it from applications is
fine and, in fact, expected.
2012-06-11 19:27:25 -04:00
José Alburquerque
7604e2d418 gtk_entry_[get|set]_inner_border(): Clarify the deprecation docs. 2012-05-06 15:05:27 -04:00
Bastien Nocera
c1f01eb929 Add support for disabling middle click paste
Adds a gtk-enable-primary-paste setting that is backed by
and X setting, and make GtkEntry and GtkTextView respect it.

https://bugzilla.gnome.org/show_bug.cgi?id=665243
2012-05-03 21:59:54 -04:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Matthias Clasen
d718fd79b6 entry: Don't show a num lock warning
Hardware lies about num lock, and we have no way of knowing.

https://bugzilla.gnome.org/show_bug.cgi?id=658875
2012-03-22 00:16:12 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Carlos Garnacho
367cc4fc0f entry: Handle ::grab-notify
Store the device, and unset private fields whenever the device
is shadowed by another GTK+ grab, so popping up menus while
selecting (i.e. press-and-hold) doesn't leave the entry in a
confused state.
2012-02-23 16:45:06 -05:00
Cosimo Cecchi
925c800e5d entry: fix progressbar area size for interior-focus = FALSE
No need to subtract focus line width again, since the progressbar is
rendered starting at (0, 0).
This also fixes the entry-progressbar-coloring reftest.
2012-02-21 12:14:50 +01:00
Cosimo Cecchi
5f9c8f653d entry: trim the progress bar area if the text area is resized
When a subclass of GtkEntry (e.g. GtkSpinButton) resizes the available
text area (by overriding the get_text_area_size vfunc), we need to
ensure we don't draw a possible progressbar over the part that got
removed from the text area.
This fixes drawing a progressbar in GtkSpinButton and in its subclasses,
such as GimpSpinScale, and makes Mitch happy too!
2012-02-20 11:44:51 +01:00
Cosimo Cecchi
7e78d75e7a entry: don't force zero Y coordinate for insertion cursor
Subclasses of GtkEntry could set a larger height request, so we need to
apply the same calculations to the insertion cursors than we do on the
PangoLayout to render it centered under all circumstances.
2012-02-18 19:39:29 +01:00
Murray Cumming
a0b4ab109d Documentation: Correct references to properties.
These should use :, not ::, though signals would use ::.
See
http://developer.gnome.org/gtk-doc-manual/unstable/documenting_syntax.html.en
and
http://developer.gnome.org/gtk-doc-manual/unstable/documenting_symbols.html.en
2012-02-15 11:43:33 +01:00
Javier Jardón
9d7a722b38 gtkentry: Fix compilation warnings 2012-01-31 20:46:14 +00:00
Cosimo Cecchi
0e395ea5a2 entry: deprecate the progress-border style property
Since we don't use it anymore.
2012-01-31 10:04:27 -05:00
Cosimo Cecchi
8dab59e5c9 entry: use the CSS margin for the progress margin offset
The progressbar inside GtkEntry has a progress-border style property,
which is actually the margin of the progressbar inside the GtkEntry
allocation.
Use a CSS margin instead of reading the progress-border property.
2012-01-31 10:04:27 -05:00
Cosimo Cecchi
5ec36a015c entry: use padding on the image area to position the image
Don't assume the padding of the icons is the same padding of the rest of
the entry.
This also allows to set different paddings for left and right icons.
2012-01-31 10:04:27 -05:00
Cosimo Cecchi
2cbe088674 entry: deprecate inner-border and gtk_entry_get/set_inner_border()
They're unused in GTK now and have suitable replacements in the CSS
properties.
2012-01-31 10:04:27 -05:00
Cosimo Cecchi
4b90ba2701 entry: always add padding to the allocation
Even when we don't have a frame. We just ignore the borders in this
case.
2012-01-31 10:04:26 -05:00
Cosimo Cecchi
d140411698 entry: don't consider inner-border for allocation and layout
We want to deprecate the inner-border property and use the standard CSS
border/padding properties. Start with replacing its uses in GtkEntry.
2012-01-31 10:04:26 -05:00
Cosimo Cecchi
3ca795d447 entry: don't blindly center the text area in the allocated height
Since top/bottom borders might be different.
2012-01-31 10:04:25 -05:00
Cosimo Cecchi
8275a20026 entry: change _gtk_entry_get_borders() to return a GtkBorder 2012-01-31 10:04:25 -05:00
Cosimo Cecchi
5b2c1ee828 entry: allocate the CSS borders to GtkEntry
Every widget should allocate its borders. Make this true for GtkEntry.
2012-01-31 10:04:25 -05:00
Carlos Garcia Campos
d088e729e5 gtkentry: Use symbolic names for button numbers 2012-01-27 09:47:43 +01:00
Rui Matos
754eabeb19 entry: Use the widget state flags as a base for drawing icons and text 2011-12-19 19:21:16 +00:00
Rui Matos
a0fd344217 entry: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Matthias Clasen
020c1846b7 Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
2011-12-18 14:29:16 -05:00
Benjamin Otte
92a72ce3e5 entry: Move freeze/thaw into begin/end_change 2011-12-16 20:09:11 +01:00
Benjamin Otte
cf8f3c07f2 entry: Don't try to handle Tab in entry completions
Instead, fall through to the default handler after closing the
completion. This has the advantage of letting the file chooser entry
capture the tab key properly, so one can't accidentally move out of the
entry by pressing tab while the completion is popped up.

I also suspect it fixes bugs with weird tab keys and shift/ctrl
oddities. But who knows...
2011-12-16 20:09:11 +01:00
Cosimo Cecchi
2bf765ab49 entry: avoid a mismatched cairo_save/restore
Leftover from GtkIconHelper migration.
2011-12-04 19:58:28 -05:00
Paolo Borelli
2ef5844bac Introduce gtk_render_insertion_cursor
The new function provides an API that takes the PangoLayout and index
as input params, this way it handles strong and weak cursors internally
factoring out all code duplicated in the widgets that need to render
cursors.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Paolo Borelli
f18bbdff53 Remove draw_insertion_cursor in label and entry
Remove the the draw_insertion_cursor wrapper which just converts from
GtkTextDir to PangoDirection

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:38 +01:00
Cosimo Cecchi
d47e82ffdd entry: simplify code
We can unconditionally call into the icon helper methods now that we
removed the g_return_val_if_fail() checks.
2011-11-30 19:05:34 -05:00
Cosimo Cecchi
5224302a30 entry: always prepare the style context when using it for entry icons
Make sure to always prepare the entry's style context for the entry icon
style when passing it to GtkIconHelper.
2011-11-30 16:39:59 -05:00
Cosimo Cecchi
a4d6505cb3 entry: port to GtkIconHelper 2011-11-30 16:39:59 -05:00
Alexander Larsson
ca829b484c Add pulse style class and use in progress bar and entry
This is used for indeterminate progress reporting.
2011-11-18 10:15:04 +01:00
Matthias Clasen
41d4229155 Pop up context menus at the right device
When multiple pointers are in play, we need to be careful
not to loose track of the device between receiving a button
press and popping up a menu.

https://bugzilla.gnome.org/show_bug.cgi?id=663396
2011-11-05 01:24:17 -04:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
11f8c1ba6f gtk: remove the private GTK_EXTEND/MODIFY_SELECTION_MOD_MASK
and use the new public modifier abstraction API instead.
2011-09-27 12:06:10 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Michael Natterer
0955a59563 app: abstract which modifiers are used for extending and modifying selections
which are SHIFT and MOD2 on the Mac, and SHIFT and CONTROL otherwise.
Use the new define all over the place and rename variables and
members to not say "shift" or "control".
2011-09-26 16:01:50 +02:00
Matthias Clasen
22d046d7fe Add a note about placeholder text use
Explain how this is really not such a great feature...
2011-09-02 00:35:38 -04:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Matthias Clasen
d324a99454 Fix entry drawing in the presence of margins
Margins need to be taken into account when comparing requisitions
and allocations, which GtkEntry (and subclasses) do for some reason.
2011-08-09 15:12:21 +02:00