Commit Graph

42 Commits

Author SHA1 Message Date
Timm Bäder
11a38dd455 entry: Remove unused function 2019-10-22 09:37:08 +02:00
Matthias Clasen
2ef8bd0b95 entry completion: Make final 2019-05-27 20:23:50 -04:00
Matthias Clasen
45fb1d06e3 entry: Delegate to GtkText
Use a GtkText child, and delegate the editable functionality
to it. Also forward all the properties that are provided by
GtkText.

Some of the more internal APIs, such as layout and im context
access and caps-lock warning, are removed here, but we preserve
most of the plain GtkEntry API by forwarding it to the GtkText
child.
2019-02-19 00:25:59 -05:00
Timm Bäder
135cf16969 entry: Remove _gtk_entry_grab_focus
We have API for both the select and !select behavior these days, so use
that one.

Fixes #1457
2019-01-16 19:18:13 +01:00
Carlos Garnacho
aaf1e4995c gtkfilechooserentry: Use GtkEntry key controller for focus-out handling
Expose the GtkEntry key controller in private API, so we don't have to
create yet another one just to handle focus-out.
2018-06-21 12:50:57 +02:00
Matthias Clasen
e283ed5523 Export some entry functions privately
This will be used in the following commits.
2018-04-23 18:54:43 -04:00
Carlos Garnacho
80c3ebe3a0 gtkentrycompletion: Stop using ::key-press-event
Use GtkEventControllerKey for the task
2018-04-05 19:26:54 +02:00
Benjamin Otte
f08bc40fbb a11y: Don't include gtk.h
Also add missing includes and sort them for all the widgets that relied
on that before.
2018-02-08 15:25:53 +01:00
Matthias Clasen
9ceafd7c38 entry completion: Drop initial selection avoidance
This is a minor thing, and it is hard to recreate
with event controllers, so drop it for now.
2018-01-16 14:14:10 -05:00
Timm Bäder
24f79bbae4 Remove some unneeded includes 2017-07-19 21:27:13 -04:00
Timm Bäder
37d6fd1ffa Entry: Remove gadget 2017-07-19 21:27:11 -04:00
Timm Bäder
3c2d2545b2 spinbutton: Inherit from GtkWidget
Use a box, an entry and the current 2 buttons.
Remaining problems: Entry sizing and activation.
2017-07-19 21:27:11 -04:00
Timm Bäder
ca889b6e21 gtkentryprivate: Remove unused prototype 2017-01-16 17:23:01 +01:00
Benjamin Otte
3982f05be4 entry: Move spinbutton size hack
If we want to do special sizing for the text, we need to do it for the
text. Otherwise paddings, borders and entyr icons will screw up
everything.
2016-01-25 15:49:17 +01:00
Benjamin Otte
a6845091f9 spinbutton: Make the entry gadget be the entry's gadget
This is a big and somewhat evil hack: We replace the entry's gadget's
node with the spinbutton's entry node.
2016-01-22 13:46:01 +01:00
Benjamin Otte
624fb8b360 entry: Always render like with is_cellrenderer
And remove the API to set that variable.
If you want the entry to not fill its whole allocated area,
  gtk_widget_set_valign (entry, GTK_ALIGN_FILL);
will give you the old behavior.
2015-10-28 19:44:26 +01:00
Georges Basile Stavracas Neto
1f96f351e0 entrycompletion: no need to return boolean
The boolean _gtk_entry_completion_resize_popup's return
value is not used anywhere, and only adds more complexity
for the method.

https://bugzilla.gnome.org/show_bug.cgi?id=751913
2015-07-03 15:51:06 -03:00
Matthias Clasen
e5317f0f9a Improve struct packing in various places 2013-09-21 23:50:55 -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
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
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
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
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00: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
8275a20026 entry: change _gtk_entry_get_borders() to return a GtkBorder 2012-01-31 10:04:25 -05:00
Tristan Van Berkom
7b61cd8257 Merge branch 'master' into treeview-refactor 2010-12-05 13:14:39 +09: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
Tristan Van Berkom
84eb40b57e Added GtkEntryCompletion:cell-area construct property.
- Removed most of GtkCellLayout implementation in favor of ->get_area()
  - This allows GtkBuildable cell layout implementation to implement
    the child "cell-properties"
  - Also allows feeding a custom/different GtkCellArea implementation to
    layout cells.
  - Share the internal area with the created GtkTreeViewColumn.
2010-12-04 16:55:49 +09: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
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Xan Lopez
c5ce76fda2 Rember the user input that triggered the completion, add API to the
* gtk/gtkentry.c:
	* gtk/gtkentrycompletion.c:
	* gtk/gtkentrycompletion.h:
	* gtk/gtkentryprivate.h:

	Rember the user input that triggered the completion, add
	API to the retrieve it and reset the entry contents to it
	if the user cancels the tentative completion during
	the inline-selection.

svn path=/trunk/; revision=17666
2007-04-28 07:47:08 +00:00
Xan Lopez
f478d9f0f6 Support inline-selection in entries (#318459)
Support inline-selection in entries (#318459)
	
	* gtk/gtkentry.c:
	* gtk/gtkentrycompletion.c:
	* gtk/gtkentrycompletion.h:
	* gtk/gtkentryprivate.h:

	When enabled cursor-match is emited when the cursor is on
	a possible completion on the list. The default implementation
	will replace the contents on the entry with the contents of
	the text column in the completion model.

	Review and improvements by Matthias Clasen.

svn path=/trunk/; revision=17660
2007-04-27 16:50:04 +00:00
Matthias Clasen
83e9b96337 Export privately. Adjust all callers.
2006-08-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentryprivate.h:
	* gtk/gtkentry.c (_gtk_entry_effective_inner_border): Export
	privately. Adjust all callers.

	* gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use it
	here to get the actual inner border.  (#349429, Benjamin Berg)
2006-08-15 18:52:14 +00:00
Matthias Clasen
c8b214680d Export gtk_entry_reset_im_context privately.
2006-08-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.c:
	* gtk/gtkentryprivate.h: Export gtk_entry_reset_im_context
	privately.

	* gtk/gtkentrycompletion.c (gtk_entry_completion_action_button_press):
	* gtk/gtkentry.c (gtk_entry_completion_key_press): Reset the
	entry's im context here.  (#348478, Nguyen Thai Ngoc Duy, Christian
	Persch)
2006-08-06 03:32:59 +00:00
Matthias Clasen
6bd2df1ad5 Add a property to suppress the popup for single matches. (#154711)
2005-05-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtk.symbols:
	* gtk/gtkentrycompletion.c: Add a property to suppress the
	popup for single matches.  (#154711)

	* gtk/gtkentry.c (gtk_entry_completion_timeout): Respect it here.

	* gtk/gtkfilechooserentry.c (_gtk_file_chooser_entry_set_action):
	Use it here.
2005-05-26 20:36:36 +00:00
Johan Dahlin
3a51a0bc89 Remove symbols accidentally added. Add boolean property popup_set_width
2005-04-04  Johan Dahlin  <johan@gnome.org>

        * gtk/gtk.symbols: Remove symbols accidentally added.
        * gtk/gtkentryprivate.h: Add boolean property popup_set_width
        * gtk/gtktoggletoolbutton.c: (gtk_toggle_tool_button_class_init):
        Use object_class instead of gobject_class
2005-04-04 20:37:42 +00:00
Matthias Clasen
5351a4e444 Support inline autocompletion in entries (#135953)
2004-07-19  Matthias Clasen  <mclasen@redhat.com>

	Support inline autocompletion in entries  (#135953)

	* gtk/gtkentryprivate.h:
	* gtk/gtkentrycompletion.h:
	* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
	Add a new signal ::insert-prefix which can be used to override
	the default inline-completion behaviour. Add two new boolean
	properties, :popup_completion and :inline_completion which
	determine how the possible completions should be presented.
	(gtk_entry_completion_insert_prefix): New function to request
	a prefix insertion.

	* gtk/gtkentry.c: Add the necessary glue for inline completion.
2004-07-19 18:15:48 +00:00
Matthias Clasen
1640e34c8c Add an ignore_enter flag and use it as in the menu code to avoid the
Sat Jun  5 23:07:30 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentrycompletion.c: (gtk_entry_completion_init),
	(gtk_entry_completion_list_enter_notify),
	(gtk_entry_completion_list_motion_notify),
	(_gtk_entry_completion_popup), (_gtk_entry_completion_popdown):
	* gtk/gtkentryprivate.h: Add an ignore_enter flag and
	use it as in the menu code to avoid the initial selection if
	the window pops up under the pointer.  (Anders Carlsson)
2004-06-06 03:17:45 +00:00
Matthias Clasen
d7cb94614d Typo fix.
2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.

	* gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
	a shadow inside the scrolled window, add it around the vbox.

	* gtk/gtkentryprivate.h:
	* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
	Return a boolean indicating whether the popup is positioned above
	or below. Scroll the completions to the beginning or the end,
	depending on the positioning.

	* gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
	wrap around in the entry completion popup, and allow GDK_UP to
	enter the popup.  (#137440)

2004-04-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is
	there before using it.
2004-04-12 19:40:22 +00:00
Kristian Rietveld
18154a2ea4 add _gtk_entry_completion_resize_popup.
Mon Nov 17 22:56:09 2003  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkentryprivate.h: add _gtk_entry_completion_resize_popup.

	* gtk/gtkentry.c (gtk_entry_completion_timeout): popup when not
	mapped, else resize_popup.

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup),
	(_gtk_entry_completion_popup): moved all popup resizing code to
	_gtk_entry_completion_resize_popup, and show the window when there
	are more than zero items in the completion list again (sigh).
2003-11-17 22:02:21 +00:00
Kristian Rietveld
c3841e7019 Fixes based on comments from Marco Pesenti Gritti.
Sat Oct 11 15:23:27 2003  Kristian Rietveld  <kris@gtk.org>

	Fixes based on comments from Marco Pesenti Gritti.

	* gtk/gtkentry.c (gtk_entry_set_text): block the completion changed
	signal handler, avoids the completion popup to popup when text is
	set programmatically in most cases (we actually have to handle this
	in the _editable functions as well, but that will break popping up
	when the user actually typed something :),
	(gtk_entry_completion_key_press): when handling enter, bail out
	when nothing has been selected,
	(gtk_entry_completion_changed): don't popdown when the entry content
	changed.

	* gtk/gtkentrycompletion.c (gtk_entry_completion_init),
	(gtk_entry_completion_selected_changed): unselect_all on the
	first selected changed signal. Avoids having a default row selected,
	(_gtk_entry_completion_popup): don't select the first row by default.

	* gtk/gtkentryprivate.h (struct _GtkEntryCompletionPrivate): add a
	first_sel_changed field.
2003-10-11 13:32:16 +00:00
Kristian Rietveld
edef7d00d9 Landing GtkTreeModelFilter and the completion code. (Test program and
Fri Jul 11 14:32:43 2003  Kristian Rietveld  <kris@gtk.org>

	Landing GtkTreeModelFilter and the completion code. (Test program
	and documentation will follow next week).

	* gtk/gtkcellayout.[ch], gtk/gtkentrycompletion.[ch],
	gtk/gtktreemodelfilter.[ch], gtk/gtkentryprivate.h: new files.

	* gtkentry.[ch]: added gtk_entry_{get,set}_completion, wrote
	necessary code to hook up completion.

	* gtktreeviewcolumn.c: made GtkTreeViewColumn implement the new
	GtkCellLayout interface.

	* gtkmarshalers.list: added BOOLEAN:OBJECT,BOXED.

	* gtk/gtk.h, gtk/Makefile.am, po/POTFILES.in: all updated for the new
	source files.
2003-07-11 12:51:24 +00:00