Commit Graph

613 Commits

Author SHA1 Message Date
Timm Bäder
80fe1dfe02 label: Remove dead ternary operator 2017-04-28 11:27:09 +02:00
Timm Bäder
db4b1d28f5 label: Remove angle property 2017-04-25 20:30:37 +02:00
Timm Bäder
cb80b32ee8 label: Move if statement where it makes sense
In the else branch of the if statement before this one, we're assigning
*smallest = *widest anyway, so this if statement is never true. Move it
to the if block before instead, where it can apply.
2017-04-25 20:30:37 +02:00
Timm Bäder
4e0f10955a label: Remove useless if statements
We never pass nullable pointers into get_size_for_allocation.
2017-04-25 20:30:37 +02:00
Timm Bäder
2fc92db25c label: Remove useless if statement
The if before this one already makes sure priv->wrap is TRUE.
2017-04-25 20:30:37 +02:00
Timm Bäder
29f7bde023 label: Don't use gtk_widget_set_simple_clip
The clip returned by gtk_css_gadget_allocate already includes the
box-shadow size and we manually care about the text-shadow size.
2017-04-25 20:30:37 +02:00
Timm Bäder
0b48bb23b2 label: Fix focus implementation
Don't return TRUE if we didn't actually focus anything.
2017-03-31 09:50:39 +02:00
Timm Bäder
c371a86f54 label: Properly calculate half the height
Since we compare it to a double anyway, might as well divide by 2.0.
2017-03-20 17:20:12 +01:00
Emmanuele Bassi
51010da740 Use gtk_show_uri_on_window() in GtkLabel
Avoid the deprecated gtk_show_uri(), and allow activating link in
sandboxed applications.

https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:37:55 +01:00
Benjamin Otte
6055028c96 snapshot: Rename append APIs
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
2017-01-13 04:46:09 +01:00
Alexander Larsson
7bee22bcb6 Avoid some more type checks for internal calls 2017-01-11 15:27:51 +01:00
Matthias Clasen
5fa1b14a96 Revert "Use CSS for styling links in labels"
This reverts commit 60a8769e7f0c952fdc8090b1ecd96cca00123ad9.

This needs more work to work properly.
2017-01-05 20:57:42 -05:00
Matthias Clasen
4170f79eea Use CSS for styling links in labels
This was implemented only halfway, and was hardcoding the
underline. We don't need to do that anymore.
2017-01-05 20:57:42 -05:00
Matthias Clasen
f3779b42c5 Make it possible to set style classes for label links
This makes it possible to style links in labels differently
in certain situations.
2017-01-05 16:55:45 -05:00
Matthias Clasen
7e6820415d Avoid a possible crash in ::activate-url handlers
If the signal handler ends up changing the label text,
the link is no longer around to update the css node.
Check for this possibility to avoid a crash here.
2016-12-29 11:09:20 -05:00
Benjamin Otte
0dbdf0c428 gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.
2016-12-20 18:01:12 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Emmanuele Bassi
4cbe079767 Use Graphene init macros for compound literals
The Graphene init macros can now be used for compound literals, which
means we need to update our mixed uses.
2016-11-21 16:21:38 +00:00
Benjamin Otte
349f55f2fe snapshot: Convert GtkLabel and GtkAccelLabel
Also adds gtk_snapshot_render_insertion_cursor().
2016-11-15 17:48:45 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Benjamin Otte
a0e63b8a07 rendernode: Require passing a renderer to get_draw_context()
This is in preparation of making render nodes independent of the
renderer, so that they can be rendered multiple times with different
renderers.
2016-11-01 16:32:26 +01:00
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
Matthias Clasen
be0de54237 Convert GtkLabel to indirect rendering
Warning! This breaks GtkAccelLabel. It will be fixed in the next
commit.
2016-10-18 11:49:15 +01:00
Emmanuele Bassi
3fb413beea label: Avoid shadowing variables 2016-10-18 11:29:34 +01:00
Timm Bäder
a9367b705e Stop checking GtkSettings:gtk-enable-mnemonics 2016-10-18 00:29:18 +02:00
Timm Bäder
203cf0d120 label: Stop using GdkColor 2016-10-18 00:29:17 +02:00
Benjamin Otte
360301a774 label: Use gdk_window_new_input() 2016-10-18 00:22:35 +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
116cb9fc0c label: Remove now unneeded deprecation markers 2016-10-16 18:17:21 +02:00
Timm Bäder
9d43644153 label,image: Remove GtkMisc usage 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
953b82a584 label: take padding into account when measuring
When doing height-for-width measurements, we need to take
padding into account. This was causing various allocation
errors.

https://bugzilla.gnome.org/show_bug.cgi?id=770849
2016-09-04 15:41:11 -04:00
Matthias Clasen
61e8c69460 label: Fix indentation
Trivial, but annoying.
2016-09-04 15:41:11 -04:00
Arnaud Bonatti
533de822ba Use 'focused' everywhere.
https://bugzilla.gnome.org/show_bug.cgi?id=770624
2016-09-01 07:14:30 +02: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
57ef631216 label: Remove some useless casts
These were casts of a const GdkEvent* to GdkEvent* even though the
function they are passed to takes a const GdkEvent*.
2016-08-10 16:37:17 +02:00
Timm Bäder
41c8446631 label: Destroy the popup menu on unmap 2016-08-04 13:07:23 +02: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
Matthias Clasen
3f3a226090 Update GtkLabel::angle docs
We can have wrapped or ellipsized labels at an angle nowadays.
Still no selections though.
2016-06-07 23:40:32 -04:00
Timm Bäder
301652de1f Remove useless casts from gdk_event_triggers_context_menu calls 2016-05-12 20:39:51 +02:00
Timm Bäder
df38db70a0 label: Also initialize text
So gtk_label_get_text returns the default value of "". Broke the
GtkModelButton default value test.
2016-05-05 11:31:41 +02:00
Timm Bäder
944f9d4f28 label: don't use set_text in gtk_label_new
It would just set up lots of things with the default values, but a
common case is that a few gtk_label_set_* calls follow.
2016-05-03 19:26:43 -04:00
Timm Bäder
4ae6f10ae9 label: minimum/natural size parameters are not nullable
Stop comparing them to NULL.
2016-05-03 16:25:57 -04:00
Timm Bäder
e75894da13 label: Don't set out parameters twice
We set them later again when we calculate the vertical size, so just
move the general assignment to -1 into the horizontal branch.
2016-05-03 16:25:57 -04:00
Matthias Clasen
29396a1e5e label: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Timm Bäder
1951642c0e GtkLabel: Use g_clear_object
https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-04-25 20:37:56 -04:00
Timm Bäder
be5a105f2e GtkLabel: Don't manually iterate over link list
There are various functions to access links based on their index for
a11y. We can spare quite a few lines of code by just using
g_list_nth_data instead of iterating over the list ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-04-25 20:37:56 -04:00
Timm Bäder
0213815d2f Move .keycap docs from GtkFrame to GtkLabel
That's where .keycap is used nowadays.
2016-02-25 20:45:33 +01:00
Timm Bäder
c5369356e8 Various documentation fixes
Always have Since: annotations at the very bottom, use the correct
ClassName::signal-name/ClassName:property-name syntax, fix a few typos
in type names, wrong function names, non-existing type names, etc.
2016-02-08 22:56:52 +01:00
Matthias Clasen
a99c69fd6b label: fix a case of misleading indentation
gcc 6 complains aobut things like this.
2016-01-28 20:50:50 -05:00