Commit Graph

856 Commits

Author SHA1 Message Date
Timm Bäder
9992a616ef widget: Use ::measure vfunc to measure size
Add a new ::measure vfunc similar to GtkCssGadget's that widget
implementations have to override instead of the old get_preferred_width,
get_preferred_height, get_preferred_width_for_height,
get_preferred_height_for_width and
get_preferred_height_and_baseline_for_width.
2016-10-22 19:05:47 +02:00
Benjamin Otte
c61e669e56 entry: Use gdk_window_new_input() 2016-10-18 00:22:35 +02:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00
Timm Bäder
f360a69f4c entry: Remove invisible-char style property 2016-10-16 18:17:21 +02:00
Timm Bäder
86dbe591d2 entry: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
1add02879e entry: Remove inner-border (style) property 2016-10-16 18:17:21 +02:00
Timm Bäder
ad155fb26c Remove GtkStock API from GtkImage 2016-10-16 18:17:21 +02:00
Benjamin Otte
fcbd480c76 API: Remove GDK_WA_CURSOR
The cursor was set using gdk_window_set_cursor() even in
gdk_window_new().

So instead of having yet another flag, just make the users of that flag
call gdk_window_set_cursor() directly after the window was created.
2016-10-16 18:17:21 +02:00
Matthias Clasen
ddd1ac0934 entry: Fix a corner case of overwrite mode
We currently beep when a character is appended at the end in
overwrite mode. That is obviously not right. Patch based on
a patch by Ian MacDonald.

https://bugzilla.gnome.org/show_bug.cgi?id=772389
2016-10-05 12:22:21 -04:00
Christian Hergert
b684b23c74 entry: handle NULL cursor when updating cursors
If we got a NULL cursor from gdk_cursor_new_from_name(), we need
to handle that when unreffing.
2016-09-27 14:12:43 -07:00
Christian Hergert
7ecd337877 entry: handle NULL cursor when releasing reference
If we happen to have gotten NULL back for a cursor, then we
need to check before unreffing it.
2016-09-27 14:09:02 -07:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Timm Bäder
a985e62b25 Use gtk_popover_popdown/popup where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=769706
2016-08-16 11:49:26 -04:00
William Hua
8701e34f74 port to new gtk_menu_popup_at_* () functions
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
Timm Bäder
4dbe7c99c2 entry: Fix undershoot position wrt entry icons
Draw them inside of the icons, which is where the text scrolls.
2016-05-31 09:41:08 +02:00
Timm Bäder
301652de1f Remove useless casts from gdk_event_triggers_context_menu calls 2016-05-12 20:39:51 +02:00
Matthias Clasen
b5fb9ae3b7 gtk: Port to new monitor api
Use the GdkDisplay monitor api instead of the GdkScreen one.
2016-04-27 23:18:16 -04:00
Matt Watson
511f138328 entry: port to progress tracker 2016-04-08 16:09:30 -07:00
Matthias Clasen
2fee5fbda7 entry: Fix drag highlight problems
We don't want drag highlights around icons or progress, so don't
propagate the :drop(active) state to them.
2016-03-11 08:02:10 -05:00
Matthias Clasen
6b2cde94b4 entry: Make progress node invisible when appropriate
We were failing to do that, leading to progress not disappearing
anymore after it was initially shown, in the gtk3-widget-factory
entry progress example.
2016-03-04 08:04:45 -05:00
Benjamin Otte
cf71d98b05 entry: Make the get_text_area() vfunc relative to top left of entry
This fixes GdTaggedEntry. I hope.
2016-02-23 04:22:19 +01:00
Matthias Clasen
966dd56e45 entry: Fix baseline allocation
Position the text on the baseline again.
2016-02-20 18:55:17 -05:00
Benjamin Otte
d2fb069426 entry: Make get_text_area_size() vfunc work again
GdTaggedEntry needs that. Though there's probably a bunch of work left
inside GdTaggedEntry to make it look cute again (like storing the area
it reserves for itself to allocate tags in).
2016-02-20 03:25:39 +01:00
Chun-wei Fan
0e9f24b5a4 gtk/gtkentry.c: Fix build on pre-C99
This file now uses nearbyint(), so include fallback-c89.c so that
compilers that don't provide the function will not get upset.
2016-02-15 17:22:00 +08:00
Benjamin Otte
c95087c70a entry: queue an allocate when pulsing
We need to reposition the progress gadget and that's done during
allocation.
2016-02-04 12:25:13 +01:00
Benjamin Otte
429bec54e5 entry: Turn progress node into a gadget 2016-02-03 22:53:22 +01:00
Benjamin Otte
3316d69abb entry: Simplify drawing code 2016-02-03 22:53:22 +01:00
Benjamin Otte
bfb727d37e entry: Draw progress in the right place 2016-02-02 15:26:01 +01:00
Timm Bäder
6e2c551896 entry: Fix icon areas
Do the same thing we already do in gtk_entry_get_text_area.
2016-01-31 20:05:52 +01:00
Krzesimir Nowak
09677f7331 entry: Fix a typo 2016-01-27 14:29:40 +01:00
Benjamin Otte
c4f7fbecfa entry: Fix a case of disagreeing coordinate systems
gesture_get_current_point() returned x/y in layout coordiantes, but
callers assumed it in textarea coordinates.
2016-01-27 14:04:21 +01:00
Matthias Clasen
a9222146d3 entry: give a visual clue that content is scrolled
This has been requested long ago, and we now have the
machinery to implement it easily.
2016-01-26 23:36:18 -05:00
Benjamin Otte
a222aa66d5 entry: Compute selection range correctly
gtk_editable_get_selection_bounds() returns UTF-8 character offsets,
but gdk_pango_layout_get_clip_region() wants byte ranges, so convert
from one to the other.
With English, this is especially visible for passwords, which use ●
as the invisible character.

https://bugzilla.gnome.org/show_bug.cgi?id=761128
2016-01-27 02:11:06 +01:00
Benjamin Otte
fefc370f6c entry: Chain up in realize()
... instead of copy/pasting what gtk_widget_real_realize() does.
2016-01-26 15:53:56 +01:00
Benjamin Otte
ad7bbbf9d8 entry: Use cleverer method to get the entry node 2016-01-25 15:49:17 +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
02fab14b3b entry: Move code
This movement is necessary for future gadgetization of GtkSpinButton.
2016-01-25 15:49:17 +01:00
Benjamin Otte
b52b4068af entry: Redo textarea handling
(1) Keep priv->text_allocation for the area used by the text
(2) Compute all text coordinates with the help of priv->text_allocation

As a side effect the get_text_area_size and get_frame_size vfuncs are
now unused. If we wanted them back, they should get a single use durig
size_allocate() and then their results should be stored for further
processing.
2016-01-25 15:49:17 +01:00
Benjamin Otte
c709072567 entry: Use gtk_render_layout()
It's funny that nobody has yet noticed that we don't draw the text using
the theme.

We had no text-shadow in entries!!!!!
2016-01-25 15:49:17 +01:00
Benjamin Otte
a363fd5fd3 entry: Draw selection the same way as GtkLabel 2016-01-25 15:49:17 +01:00
Benjamin Otte
ca690162af entry: Fold function into only caller 2016-01-25 15:49:17 +01:00
Benjamin Otte
0ae8b30210 entry: Don't allow different text over progress
This complicates refactorings, so remove that feature. It's not used
anywhere and doesn't play well with nodes the way it's implemented.
If we want it back, we can add it back later.
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
Matthias Clasen
b08fe985cc entry: Expand the css node docs
Mention the context menu.
2016-01-18 10:52:26 -05:00
Timm Bäder
d73f6b8c50 entry: Deprecate shadow-type
Things like that should be handled using css. Also, the property value
is unused inside GtkEntry.
2016-01-18 12:53:53 +01:00
Timm Bäder
a5fabee202 entry: Don't draw icons twice 2016-01-14 16:02:12 +01:00
Timm Bäder
49d251a330 entry: Remove unused code 2016-01-14 16:02:12 +01:00
Matthias Clasen
ea4cff1ea4 Use convenience API that was introduced recently
Use gtk_css_gadget_set_state in all the places where we previously
were getting a node from a gadget, just to call gtk_css_node_set_state.
2016-01-13 00:19:31 -05:00
Timm Bäder
19fa893067 entry: typo 2016-01-12 21:54:45 +01:00