Commit Graph

631 Commits

Author SHA1 Message Date
Alexander Larsson
e6de45964d entry: No need to reset layouts on style_updated
With pango handling changes to the PangoLayout there now is no
style changes that can affect the layout for the entry, so we don't
have to reset the layout whenever the style is updated.
2012-12-06 19:54:05 +01:00
Benjamin Otte
7747910b9d gtk: Use context's font
Instead of using gtk_style_context_get_font() in
pango_context_get_metrics(), use pango_context_get_font_description().
The context contains the font description we are about to use after all.
2012-12-06 02:57:18 +01:00
Mike Gorse
77c0f9d8e6 Send a notification when a GtkEntry icon's tooltip text changes 2012-11-12 09:15:46 -06:00
Cosimo Cecchi
d05191a010 entry: fix requisition width/height to use the current pango layout
This way, we can ensure that width/height changes due to the use of
gtk_entry_set_attributes() are correctly reflected in the size request.

https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Paolo Borelli
afd99d3579 Make spinbutton orientable
https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04: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
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
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
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
Matthias Clasen
0cb56312b9 Trivial: Fix a whitespace messup
Pointed out by Carlos Garnacho in bug 651244.
2012-08-25 14:24:20 -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
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