Commit Graph

806 Commits

Author SHA1 Message Date
William Jon McCann
4b5a389e88 Deprecate and ignore gtk-entry-password-hint-timeout
This feature offers a number of benefits related to providing
feedback to the user when the password is masked. Some experts have
argued that password masking is harmful. I tend to agree with this
setting providing a better and more moderate solution. Some agree:
https://www.schneier.com/blog/archives/2009/07/the_pros_and_co.html

In order to further lessen the impact I've only enabled the feature
on the primary display since the likelyhood of a non-primary display
being visible by others is higher.
2013-07-11 17:08:15 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
72c3879893 Add missing G_PARAM_DEPRECATED to stock deprecations 2013-07-08 15:39:55 -04:00
Alexander Larsson
f258e757bd entry: Set the window on the icon helper 2013-07-03 14:39:26 +02:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00
William Jon McCann
424e1d0059 Start deprecating some GtkStock API 2013-06-25 19:05:32 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Jonh Wendell
c27ddc66c5 GtkEntry: ellipsize placeholder text
The placeholder string is truncated when there's no
room for it in entry's width.

So, by ellipsizing it, the user can notice the text
was truncated so that they can workaround that by,
for example, maximizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=702763
2013-06-21 09:29:15 -03:00
Matthias Clasen
4a62d19da7 GtkEntry: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:10:15 -04:00
Bastien Nocera
ffbe7f6eb6 GtkEntry: Focus the entry without selecting the text
Focusing the text entry without selecting all the text is needed in
some places (GtkTreeView, and some uses of GtkSearchEntry) so
create a private helper to avoid replicating the hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Sébastien Wilmet
6b50045f90 Doc: various small fixes
https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:28 +02:00
Alexander Larsson
72cd8b4dab GtkEntry: Support baselines 2013-04-23 05:58:06 +02:00
Bastien Nocera
ea043cab57 GtkEntry: Sanity check the end_pos value in _get_display_text() 2013-03-06 15:50:31 +01: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
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
bb3c56abe2 Do without GtkSelectionWindow
Just populate a toolbar directly, in GtkEntry and GtkTextView.
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
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
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
Alexander Larsson
7319a0f237 GtkEntry: Fix text handle painting
We only draw the main entry on should_draw (widget->window), because
otherwise we also draw it on the GtkTextHandle widgets.

This is necessary due to the recent change for that to not return
TRUE and swallow the rest of the drawing operation.
2013-02-18 09:38:11 +01:00
Paolo Borelli
bae84bdf23 [entry] unregister icon windows 2013-02-16 16:28:45 +01:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
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
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
Matthias Clasen
a1cf2315a0 Fix up signal ordering issues in GtkEntry
Ensure that text and selection boundaries are in a
consistent state when we emit notifications, that ::insert-text
and ::delete-text are emitted before any changes, and that
::changed is emitted after property notifications when inserting
or deleting text.
2011-07-05 16:08:08 -04:00
Matthias Clasen
918514d51d First cut at GailEntry -> GtkEntryAccessible
Replace the factory for entry and spin button with
gtk_widget_class_set_accessible_type() calls, and move then
to the GtkAccessible namespace.
2011-07-05 16:08:08 -04:00
Claudio Saavedra
ca801abb4c Use a PAGE_STEP macro instead of a magic number
Helps to understand the code.

https://bugzilla.gnome.org/show_bug.cgi?id=653512
2011-06-28 09:47:44 +03:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Cosimo Cecchi
aa37e7323f entry: use the current state when rendering symbolic icons
Make sure the current state is picked up when rendering symbolic icons
too.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
8efa8a067e entry: use GTK_STYLE_CLASS_IMAGE when rendering the entry icon 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
02e82d69b8 entry: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Matthias Clasen
d2c682c9e9 Remove an unneeded include 2011-06-07 13:04:22 -04:00
Matthias Clasen
0705474be6 GtkEntry: don't forget to disconnect idles
As pointed out by John Lindgren in bug 650114, GtkEntry forgets
to disconnect an idle source when the completion is set to NULL.
2011-05-31 20:11:28 -04:00
Matthew Barnes
54c3f05848 Desensitize "Select All" when GtkEntry is empty
This avoids possible confusion in some situations, and
selecting an empty string is not very useful.

https://bugzilla.gnome.org/show_bug.cgi?id=647962
2011-04-26 07:56:09 -04:00
Matthias Clasen
7d3693b82b GtkEntry: Explicitly disconnect keymap signals
Might fix https://bugzilla.gnome.org/show_bug.cgi?id=648419
2011-04-26 07:48:27 -04:00
Benjamin Otte
da1f618b09 entry: Translate progress region properly when drawing text 2011-04-19 22:18:19 +02:00
Benjamin Otte
76294fcf1d entry: No need to queue a redraw on state changes
GtkWidget already does that.
2011-04-19 22:18:19 +02:00
Benjamin Otte
2d58625e02 entry: Also update cached style values when the state changes 2011-04-19 22:18:19 +02:00
Benjamin Otte
66dc6ea150 entry: Initialize cached values 2011-04-19 22:18:19 +02:00
Benjamin Otte
a9a2a08162 entry: g_object_notify*( when we change the invisible char 2011-04-19 22:18:19 +02:00
Benjamin Otte
0aae66c15e entry: Split out style-updating things into their own function 2011-04-19 22:18:19 +02:00
Benjamin Otte
72ebc788a6 entry: Move cairo_save() call for clarity
We want save, clip, draw1, restore, save, clip, draw2, restore
and not save, save, clip, draw1, restore, clip, draw2, restore

Functionally the same thing, but not as obvious
2011-04-19 22:18:19 +02:00
Benjamin Otte
6fee78341a entry: Omit useless clip
We do the same clip further above, so no need to repeat it
2011-04-19 22:18:19 +02:00
Benjamin Otte
033d204b9e entry: Guard clipping with a save/restore
Just t be sure, so people don't get bugs later when they refactor code.
2011-04-19 22:18:18 +02:00
Benjamin Otte
c70698084c entry: Remove needless check
The only window we're ever called to draw is our own window. D'oh.
2011-04-19 22:18:18 +02:00
Benjamin Otte
49c7869582 docs fix typo
Was accidentally introduced in 1351d40cfe

Thanks Paolo for noticing.
2011-04-17 12:49:58 +02:00
Benjamin Otte
1351d40cfe entry: Fix gtk_entry_get_icon_at_pos()
The passed in coordinates are widget-relative, not window-relative.
2011-04-16 22:31:24 +02:00
Benjamin Otte
f2a20cd9fd entry: Use the new get_frame_size() argument in gtk_entry_draw_frame() 2011-04-16 22:31:24 +02:00
Benjamin Otte
fd9aac8225 entry: Add the ability to query frame size in two ways
TRUE: relative to widget->window
FALSE: relative to widget

For now, no caller has beeen changed.
2011-04-16 22:31:24 +02:00
Juan Pablo Ugarte
a77e6b1593 Added GtkEntry:completion property 2011-04-01 19:35:32 -03:00
Carlos Garcia Campos
ef061c4e96 gtkentry: Add hinting to GtkEntry
gtk_entry_set_placeholder_text() makes the entry display the given text
when it is empty and unfocused. Based on previous patch by Alberto
Garcia.

https://bugzilla.gnome.org/show_bug.cgi?id=440963
2011-03-21 09:37:37 +01:00
Carlos Garnacho
b93a2ebeed entry: Do not clobber state when rendering the default icons.
Use lower level methods that just require changing the state in the
GtkStyleContext instead. Fixes a problem where the insensitive state
was being set to the entry becasuse a parent was insensitive, spotted
by Alex Larsson.
2011-03-07 12:48:31 +01:00
John (J5) Palmieri
cdf69b4bed [gi] add missing annotations for signals that emit Gdk.Events 2011-03-03 16:05:28 -05:00
Matthias Clasen
63c7701ca3 Don't use GDK_NONE when GDK_SELECTION_CLIPBOARD is meant 2011-02-28 19:25:35 -05:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Michael Natterer
858ba35873 gtk: remove function gtk_entry_queue_draw() and call gtk_widget_queue_draw()
the old function was a leftover from when GtkEntry had a window
and was now invalidating the entire toplevel on each entry change.
2011-02-06 11:17:58 +01:00
Matthias Clasen
38f6065b2b Make GtkEntryCompletion::match-selected arguments consistent
For keynav, we were still passing it the filter model.
https://bugzilla.gnome.org/show_bug.cgi?id=640698
2011-01-31 10:48:40 -05:00
Paolo Borelli
001697a22a Move the get_cursor_color in GtkStyleContext
Move the private get_cursor_color method belongs to StyleContext. Change
the api so that retrieving both primary and secondary color is possible.
I left the method private for now, though it should probably be public
as all the other getters.
2011-01-29 13:13:42 +01:00
Paolo Borelli
9e20341775 Use GtkRGBA for the cursor color priv api. 2011-01-29 12:38:50 +01:00
Matthias Clasen
b42b47e7d3 Port gtk_draw_insertion_cursor to GtkStyleContext 2011-01-24 00:24:12 -05:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Michael Natterer
5d3106275a gtk: no need to add GTK_STYLE_FLAG_FOCUSED to the widget's state flags
because they correctly contain that flag now if the widget has focus.
2011-01-21 15:38:52 +01:00
Michael Natterer
287a388415 gtk: remove unused "window" variable from gtk_entry_draw_frame() 2011-01-21 14:19:48 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Carlos Garnacho
0e77486e91 Make GtkEntry set the style context state. 2011-01-17 04:43:23 +01:00
Matthias Clasen
8e420bca02 Unify handling of prelighted icons
Make GtkEntry use gtk_render_icon_pixbuf for rendering the
icons, and move the working icon prelighting code from GtkEntry
to GtkThemingEngine.

https://bugzilla.gnome.org/show_bug.cgi?id=636691
2011-01-14 23:59:22 -05:00
Tristan Van Berkom
3f911b2516 Fixed GtkEntry to report the proper default value for "primary/secondary-icon-activatable" 2011-01-10 22:26:46 +09:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Carlos Garnacho
e4c509837f GtkEntry: get font description from GtkStyleContext 2011-01-04 03:06:20 +01:00
Carlos Garnacho
55145e0e4e GtkEntry: Remove unneeded calls 2011-01-04 03:06:19 +01:00
Benjamin Otte
8f1f743903 gtk: Use g_object_unref instead of gdk_cursor_unref 2010-12-21 12:07:05 -05:00
Matthias Clasen
28cc7baef0 Make GtkEntry hide completely
When it was converted to no-window, we forgot to make it hide/show
its input window as necessary.
2010-12-20 12:28:05 -05:00
Tristan Van Berkom
df0d61e50d Fixed gtk_entry_set_icon_tooltip_text & markup to not crash
Setting this property before the icon is actually set was
resulting in a crash (found by way of Glade bug 606103).
2010-12-17 18:15:08 +09:00
Carlos Garnacho
8b8eab1c81 GtkEntry: Use GtkStyleContext. 2010-12-13 22:31:28 +01:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Carlos Garcia Campos
a5dba1670e GtkEntry: Use gtk_widget_render_icon_pixbuf()
Instead of gtk_widget_render_icon() which is now deprecated.
2010-12-08 17:12:14 +01:00
Javier Jardón
d351b40a0b Add internal accessor for GtkEntry->is_cell_renderer
This fixes commit fb3429e507
2010-12-04 22:06:02 -05:00
Matthias Clasen
fc10599ac8 Make unfocused selections visible in entries 2010-12-04 15:39:33 +01:00
Carlos Garnacho
f7f5ac1b09 GtkEntry: Set widget state as state flags. 2010-12-04 15:38:31 +01:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Javier Jardón
c4be956473 gtkentry: move public members to private structure 2010-11-19 08:38:12 +01:00
Javier Jardón
8c941d2b4e Add _gtk_entry_get_im_context() internal accessor
It's needed by gtktreeview
2010-11-19 06:15:27 +01:00
Michael Natterer
881282e055 gtk: honor entry->has_frame again draw the frame conditionally
when GtkEntry had visible windows, it was never noticed that we always
draw the frame, because the text_area window would cover it if
draw_frame was FALSE.
2010-11-18 01:06:57 +01:00
Michael Natterer
3ec8daa66c gtk: draw the progress only on the text area
so it doesn't extend under GtkSpinButton's buttons.
2010-11-18 01:06:57 +01:00
Javier Jardón
0e0c4ee129 docs: move documentation to inline comments: GtkEntry 2010-11-05 20:49:20 +01:00
Tristan Van Berkom
393bd507bb Fixed unused variable in get_preferred_height(). 2010-10-27 13:56:13 +09:00
Matthias Clasen
2432bf4a58 Remove size_request from GtkEntry 2010-10-26 21:41:13 -04:00
Matthias Clasen
520a6aeb8f Fix up docs 2010-10-23 23:41:08 +02:00
Michael Natterer
ba9efeda4b gtk: add gtk_entry_get_text_area() and gtk_entry_get_icon_area()
as replacement for the removed get_foo_window() functions, so draw()
callbacks can figure where to paint.
2010-10-22 14:48:08 +02:00
Benjamin Otte
e6f95e9316 entry: No, you can not haz ununused variables 2010-10-21 15:08:14 +02:00
Matthias Clasen
596da84312 Make GtkEntry a no-window widget
Use input-only windows for capturing input, and just draw onto
the parent window. This allows themes to make entries with rounded
corners. Patch by Boram Park.

https://bugzilla.gnome.org/show_bug.cgi?id=632736
2010-10-21 13:17:33 +02:00
Emmanuele Bassi
9f9edb662e settings: Move setting property registration in gtksettings.c
Some GtkSettings property are registered by other classes. This leads
to the "interesting" issue that setting GtkSettings:gtk-button-images
requires that the GtkButton class is referenced first - or that a
GtkButton is created.

https://bugzilla.gnome.org/show_bug.cgi?id=632538
2010-10-20 10:34:25 +01:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
90beb8a514 entry: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
34c6e35152 entry: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
67284a57de API: Get rid of gtk_draw_insertion_cursor()
and rename gtk_cairo_draw_insertion_cursor() to
gtk_draw_insertion_cursor().
2010-09-26 15:11:43 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
d13a2ad66a entry: Remove gtk_entry_is_drawable() checks when painting 2010-09-26 15:11:35 +02:00
Benjamin Otte
c412c1c752 entry: Port to draw signal 2010-09-26 15:11:35 +02:00
Benjamin Otte
696989d499 entry: Split else ifs into separate if statements
Preparation for the draw vfunc
2010-09-26 15:11:35 +02:00
Benjamin Otte
ec4be3619f entry: Add bug reference to workaround 2010-09-26 15:11:35 +02:00
Benjamin Otte
2ee8fdb79b gtk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Benjamin Otte
3d340d7449 text: Make _gtk_text_util_create_drag_icon() return a surface
And change its callers to handle it that way.
2010-09-26 15:03:00 +02:00
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Javier Jardón
efbf04236e Change GtkEditable typedef from GtkEditableClass to GtkEditabeInterface
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=323904
2010-09-17 19:57:09 +02:00
Javier Jardón
8345760fdb gtkentry: remove unnneded check in map/unmap functions 2010-09-15 03:28:24 +02:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Javier Jardón
9e81022bf6 Use gtk_size_request_get_size() instead deprecated gtk_widget_get_child_requisition()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177
2010-09-13 21:26:01 +02:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Benjamin Otte
78ccc74879 entry: Use the same state for the flat box of text area and icons 2010-09-03 17:01:06 +02:00
Matthias Clasen
399580f9e1 Remove GtkEntry::state-hint
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
2010-09-01 20:21:21 -04:00
Matthias Clasen
29aa3818a4 Remove deprecated text and text_length field in GtkEntry
These fields have been superseded by GtkEntryBuffer.
2010-08-28 22:27:36 -04:00
Javier Jardón
65266d971e gtk/gtkentry.c: Use accessor functions to access GtkWindow 2010-08-23 20:18:27 +02:00
Javier Jardón
4ddff2691b gtk/gtkentry.c: use accessor functions to access GtkWidget 2010-08-22 22:56:12 +02:00
Philip Withnall
3eb197b51f Bug 596125 — Property string fixes 2010-08-10 09:23:49 +01:00
Benjamin Otte
d203b830a9 entry: replace gdk_draw_pixbuf() call with Cairo version 2010-07-26 16:42:46 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
William Jon McCann
85e3f22c19 Show lock warning for num lock as well as caps lock
https://bugzilla.gnome.org/show_bug.cgi?id=623239
2010-07-01 21:46:08 -04:00
Colin Walters
905f988166 Revert "Add length to gtk_tree_path_get_indices"
This reverts commit eebb16eb1a.

Was an accidental commit.
2010-06-28 14:15:10 -04:00
Colin Walters
eebb16eb1a Add length to gtk_tree_path_get_indices
The old version wasn't introspectable as it didn't have a length
return parameter.  Also, delete gtk_tree_path_get_indices_with_depth,
since it's no longer needed.
2010-06-28 13:50:36 -04:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Matthias Clasen
bb91ebcb8f Fix signal parameters in GtkEntryCompletion
The ::match-selected and ::cursor-on-match signal were emitted
with the internal filter model instead of the user-provided model.

Fixes bug #555087.
2010-05-21 23:50:46 -04:00
Matthias Clasen
77d4d3cdae Merge branch 'gtk-2-90'
Conflicts:
	gtk/gtkentry.h
2010-05-06 22:55:02 -04:00
Javier Jardón
713f2b638e Use event instead key in the previous patch 2010-05-05 04:06:17 +02:00
Javier Jardón
7692a427a6 Added api to reset the im context in GtkTextView and GtkEntry
Also, added api to allow an input method to internally handle
key press and release events in the GtkTextView and GtkEntry
cases.
This is simply a wrapper to the gtk_im_context_filter_keypress()
function, but It's added to not access the ->im_context
directly.
Based on a Christian Dywan patch

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=163251
2010-05-05 03:14:28 +02:00
Christian Dywan
90d514a8a5 Remove deprecated GtkEntry functions 2010-05-03 01:51:18 +02:00
Matthias Clasen
5f29a679f8 Avoid spurious notifications from GtkEntry
Using gtk_entry_set_buffer() in dispose() causes problematic
notifications, so just get rid of the buffer manually. See bug 613241.
2010-03-19 23:24:33 -04:00
Tristan Van Berkom
e8c0920494 Refixed patch for bug 612505.
New patch makes sure to update the display even when
the GtkEntry's buffer is set to NULL, it also breaks the
reference to the buffer in ->dispose() instead of ->finalize().
2010-03-14 16:29:42 -04:00
Matthias Clasen
c55e0fc372 Fix tests 2010-03-13 00:49:10 -05:00
Matthias Clasen
233281fd39 Recompute label contents when the buffer changes
Also reset cursor positions to avoid assertions.
This fixes bug 612505, patch by Tristan Van Berkom.
2010-03-12 15:59:59 -05:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Javier Jardón
1934de4b65 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_REALIZED)
Use new API instead: gtk_widget_set_realized ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:51:33 +01:00
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
1fe7d3cefd Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:19:03 +01:00