Michael Catanzaro
c3d611fcf2
entry: Fix typo
2015-12-20 11:52:30 -06:00
Matthias Clasen
18e8842a7e
entry: Don't clear when setting icons
...
Clearing the icon doesn't appear to be necessary with
todays code, and it has the unfortunate side-effect of
temoorarily hiding the icon's window, which breaks grabs
and makes us miss the button release event when the icon
is changed from a button press handler.
2015-12-18 19:38:07 -05:00
Matthias Clasen
51ba8421c3
entry: Remove some dead code
...
These defines are no longer used.
2015-12-18 10:55:26 -05:00
Matthias Clasen
2e25407638
Fix a problem with entry gadgets
...
place_windows is accessing the gadgets allocation, so make sure
to allocate the gadget before calling it.
2015-12-17 15:17:23 -05:00
Matthias Clasen
35c243b26f
entry: use a gadget
...
Use a gadget for the entry. Selection and progress still
just use a CSS node. Most things seem to work correctly
with non-zero margin or padding.
2015-12-17 00:01:58 -05:00
Benjamin Otte
3a77da9df2
entry: Turn icons into gadgets
2015-12-15 08:41:16 -05:00
Benjamin Otte
b79a187d47
iconhelper: Handle invalidation
...
When CSS, direction or scale factor change, handle the invalidation
inside the iconhelper.
This way the widgets using them don't have to.
2015-12-15 08:41:16 -05:00
Benjamin Otte
ad22612ab2
iconhelper: Require passing a cssnode to the constructor
...
Note that we don't use it yet.
2015-12-15 08:41:16 -05:00
Benjamin Otte
ccfc4d3f12
iconhelper: Remove the context argument
...
Instead, use the widget's context.
2015-12-09 13:30:40 +01:00
Benjamin Otte
e95e2d5048
iconhelper: Get rid of _gtk_icon_helper_set_window()
...
Instead use the window of the owner widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
c9d1a45d30
iconhelper: Require a widget as construction argument
...
Note that the caller needs to ensure the widget lives as long as the
iconhelper as the iconhelper will not ref the widget.
2015-12-09 13:30:40 +01:00
Matthias Clasen
f76fa0411f
entry: Always use cursor names
...
The names are the preferred API for cursors, so use it.
2015-12-05 19:17:52 -05:00
Timm Bäder
ecc5342b0d
GtkEntry: Recompute in text-inserted/text-deleted
...
The text-inserted/text-deleted handlers rely on the cursor positions
being unadjusted after the text change, so we can't do it in
buffer_notify_text.
2015-12-04 20:41:16 +01:00
Timm Bäder
3ba11782db
GtkEntry: nullable annotations
2015-12-03 20:20:58 +01:00
Timm Bäder
da477575cd
GtkEntry: Return proper constants from signal handlers
2015-12-03 20:01:30 +01:00
Timm Bäder
f11f989f1f
GtkEntry: Remove recompute idle
...
Just do it directly
2015-12-03 20:01:30 +01:00
Timm Bäder
cfc23cbf32
GtkEntry: Remove unused fields
2015-12-03 20:01:30 +01:00
Matthias Clasen
058dfb0723
entry: Use regular drag highlight
...
The entry code passes GTK_DEST_DEFAULT_HIGHLIGHT when setting
up the drop target, but that is ineffective because of the
custom drag_motion implementation. Instead, call
gtk_drag_[un]hightlight ourselves.
2015-12-02 23:52:55 -05:00
Benjamin Otte
7a154d9acd
dnd: Add gtk_drag_set_icon_definition()
...
... and use it for entry icons.
As a side effect, icons dragged from entries will now resize to DND
size.
2015-12-02 00:29:30 +01:00
Benjamin Otte
85423ea278
entry: Use gtk_icon_helper_load_surface()
...
This is the first step towards getting rid of pixbuf loading code in the
icon helper.
2015-12-02 00:29:30 +01:00
Timm Bäder
2182fe7d9d
Don't pass widget state flags to GtkStyleContext API
2015-11-22 17:11:35 +01:00
Christian Hergert
0a0213bc1c
entry: ensure valid GdkWindow before set_invisible_cursor()
...
If the window has not yet been created, then we can't set the invisible
cursor yet. This can happen in situations where the widget is in a
revealer with type-to-search functionality.
2015-11-18 14:41:29 -08:00
Matthias Clasen
43f822e70f
Annotate deprecated style properties
...
Use G_PARAM_DEPRECATED with deprecated style properties.
This will make it easier to identify and remove such stale
properties from css, since it will now trigger warnings.
2015-11-16 15:13:33 -05:00
Matthias Clasen
46b7b0ac9f
entry: Ignore the icon-prelight style property
...
The icon prelight effect can be controlled with regular CSS,
so deprecate and ignore this style property.
2015-11-16 07:20:18 -05:00
Matthias Clasen
27d70cbb10
entry: Simplify selection rendering
...
Calling gtk_render_background for each rectangle in the region
leads to suboptimal and sometimes weird results. Getting this
right requires more work in Pango first. Go back to just rendering
a single background, and clip it to the selection region. This
matches what GtkLabel does.
2015-11-10 20:18:39 -05:00
Matthias Clasen
2a03107677
entry: Use a CSS node for selection rendering
...
This adds new possibilities for themes to render the selection
in fancy ways.
2015-11-10 13:36:16 -05:00
Matthias Clasen
0a136004c9
Document text handle styling
...
Since GtkTextHandle is private, document text handle style
classes in the GtkEntry and GtkTextView documentation.
2015-11-09 23:45:29 -05:00
Matthias Clasen
6328cf5ee5
entry: Add a diagram to CSS node docs
2015-11-03 09:53:00 -05:00
Florian Müllner
e364ae3ea8
Use gtk_widget_set_focus_on_click() instead of deprecated setters
...
https://bugzilla.gnome.org/show_bug.cgi?id=757269
2015-11-03 07:44:17 -05:00
Matthias Clasen
d5ff9af94e
entry, textview: Use a dedicated style class for magnifier
...
This will free up "osd" as an application-level style class,
and lets us style magnifiers differently.
2015-11-02 12:40:38 -05:00
Matthias Clasen
bb7d7851ac
entry, spinbutton: Finish css node conversion
...
This commit creates entry and button subnodes for the buttons
in GtkSpinButton. The nodes are ordered like this for horizontal
spinbutton
+ entry
+ image.left
+ image.right
+ progress
+ button.down
+ button.up
and like this for vertical ones:
spinbutton
+ button.down
+ entry
+ button.up
This arrangement requires cooperation from GtkEntry to place
the entry subnodes correctly, and some small changes in the theme.
This commit also fixes progress rendering in vertical spin buttons.
2015-10-28 23:43:32 -04:00
Matthias Clasen
ebcad63e31
wip: spinbutton
2015-10-28 21:55:13 -04: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
Matthias Clasen
d717afd4d4
entry: properly update css subnode state
...
Update the state of the css subnodes for icons when
appropriate, and avoid calling set_state after save_to_node.
2015-10-26 22:09:07 -04:00
Matthias Clasen
c72d094ae0
entry: Use better element name for progress
...
Change the name of the CSS subnode for progress rendering from
progressbar to progress. This will align better with GtkProgressBar.
2015-10-26 21:34:16 -04:00
Matthias Clasen
ed8641ff26
entry: Only set one of the .left, .right style classes
...
We were not removing the old style class when adding a new one.
2015-10-26 15:28:50 -04:00
Matthias Clasen
431089f769
entry: Add css node documentation
...
List the css names and the typical style classes that can be
expected to occur with entries.
2015-10-23 16:22:25 -04:00
Matthias Clasen
6a768ba218
entry: Use a permanent css node for progress
...
Create a css node with name progressbar when we start showing progress
in the entry. The node gets the style class .pulse added when we
do pulse mode.
2015-10-23 16:11:08 -04:00
Matthias Clasen
f5e77d0c67
entry: Use css nodes for icons
...
Create css nodes for icons in entries, with name image, and use
gtk_style_context_save_to_node() for them. We still set the
style classes .left and .right on them.
2015-10-23 15:39:29 -04:00
Matthias Clasen
b2dd9cbc59
entry: Use the element name entry
...
Set the element name on the css node and drop the .entry class.
2015-10-23 14:51:35 -04:00
Matthias Clasen
b1bf153c99
entry: Use qdata with preallocated quarks
2015-09-23 07:01:15 -04:00
Matthias Clasen
15411aa032
entry: Drop the Ctrl-K keybinding
...
This interferes with a well-loved firefox shortcut, and we
are more interested in a gtk3 firefox than in legacy keybindings.
2015-09-14 11:49:15 -04:00
Matthias Clasen
dbd5513276
entry: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
587afb5b1c
entry: Improve cursor hiding logic
...
Previously, we just hid the cursor if a key event was adding text,
but not when you used backspace, or Ctrl-V. Rearrange things so that
we obscure the cursor whenever the buffer contents change while we
are handling key events.
https://bugzilla.gnome.org/show_bug.cgi?id=754535
2015-09-03 14:00:27 -04:00
Matthias Clasen
5aa1f0923c
entry: Use gtk_simulate_touchscreen
...
Instead of repeated manual checks.
2015-07-31 13:46:34 -04:00
Matthias Clasen
5c2759af3c
Use standard cursor names
...
This changes GTK+ to use gdk_cursor_new_from_name() with the
'standard' css names, instead of GdkCursorType.
https://bugzilla.gnome.org/show_bug.cgi?id=652085
2015-07-26 01:45:06 -04:00
Paolo Borelli
803430a779
pango: make merge_attrs return the merged list
...
This simplifies all the callers
2015-07-06 00:31:56 +02:00
Paolo Borelli
9e26fa9a42
entry: add css letter-spacing
2015-07-06 00:04:06 +02:00
Matthias Clasen
8cbed0b04a
entry: Drop an unused variable
2015-06-13 21:10:26 -04:00
Carlos Garnacho
a2d1d5244b
entry: Ensure we unset the magnifier widget on ::destroy
...
Otherwise there's dangling signal handlers which cause warnings
at the time we attempt to disconnect these.
2015-06-12 13:33:13 +02:00