summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
Commit message (Collapse)AuthorAgeFilesLines
* label: Remove unneeded NULL guardsTimm Bäder2021-01-171-14/+4
| | | | The pointers passed to GtkWidgetClass::measure cannot be NULL
* label: Refactor get_layout_locationTimm Bäder2021-01-171-26/+25
| | | | | Make this function shorter, the parameters non-nullable and the simple cases more explicit.
* label: Fix a potential memory leakTimm Bäder2021-01-171-1/+4
| | | | | This only happens in error cases so not very interesting. Anyway, try to make scan-build happy.
* label: Remove unused private functionsTimm Bäder2021-01-031-105/+20
|
* label: Remove mnemonics_visible_apply_recursively from private headerTimm Bäder2021-01-031-29/+30
| | | | This is only used in gtklabel.c
* label: Modernize source fileTimm Bäder2021-01-031-1927/+1781
| | | | | | Try to sort toplevel functions to minimize unnecessary function prototypes at the beginning of the file, get rid of all tabs and trailing whitespace.
* label: Refactor get_layout_location()Timm Bäder2020-12-211-28/+9
| | | | | | | | | Rename a few local variables to be clearer about whether they belong to the widget or to the layout. Remove a workaround for an old bug that is no longer valid. We don't underallocate the layout anymore. Aways center vertically, with respect to the yalign.
* label: Refactor snapshot()Timm Bäder2020-12-211-80/+73
| | | | | Use two early-out style if statements to reduce indentation in this entire function.
* Merge branch 'wip/surface-state-rework' into 'master'Matthias Clasen2020-12-081-1/+1
|\ | | | | | | | | Rework surface state and geometry computation See merge request GNOME/gtk!2885
| * gtk/popover: Use gtk_popover_present() instead of going via GtkNativeJonas Ådahl2020-12-071-1/+1
| | | | | | | | This makes it more explicit that managers of popovers make it "present".
* | Use private can_activate() methodEmmanuele Bassi2020-12-051-1/+1
|/ | | | Instead of checking the activate_signal field directly.
* Fix some nullable return annotationsSophie Herold2020-11-211-1/+1
|
* docs: Fix the links for keybinding signalsMatthias Clasen2020-11-171-3/+3
| | | | | GtkBindingSignal does not exist anymore, so link to GtkSignalAction for an explanation of keybinding signals.
* label: Avoid short-circuitingMatthias Clasen2020-11-131-15/+31
| | | | | | | Commit 0db504edde63eb77e made a mistake described here: https://en.wikipedia.org/wiki/Short-circuit_evaluation#Possible_problems Fixes: #3359
* label: Avoid a needless strdupMatthias Clasen2020-11-111-13/+10
| | | | | Don't duplicate the string before we know if it has actually changed.
* label: Optimize GtkLabel settersMatthias Clasen2020-11-111-32/+35
| | | | | | | | The overarching goal here is to not queue a resize unless something has actually changed. In columnview scenarios, we often deal with hundreds of labels. Labels are cattle, not pets.
* a11y: Parse reference lists using varargsEmmanuele Bassi2020-11-101-1/+1
| | | | | | | | | | Using GList is a bit lame, and makes the API more complicated to use than necessary in the common case. The only real use case for a GList is gtk_widget_add_mnemonic_label(), and for that we can use the GValue-based API instead. Fixes: #3343
* label: Plug a potential memory leakTimm Bäder2020-10-221-1/+4
| | | | | | This only happens in error cases so pretty insignificant. Found by scan-build
* gtk: Remove unused header includeBenjamin Otte2020-10-201-1/+0
| | | | | gtkcssnodeprivate.h was mainly used for repositioning CSS nodes in gadgets, and gadgets are gone now.
* label: Set the accessible label propertyMatthias Clasen2020-10-191-0/+4
| | | | This will make label text show up in ATs again.
* Clean up lots of GTK+ -> GTKMatthias Clasen2020-09-121-5/+5
| | | | | | Replace most remaining uses of GTK+ in the docs and user-visible strings by GTK. Also remove some leftover "Was added in 3.x" sentences from the docs.
* *: Fix spelling mistakes found by codespellBjörn Daase2020-08-211-3/+3
|
* label: Try to avoid a pango_layout_get_extents callTimm Bäder2020-08-191-6/+9
| | | | Measuring text is quite expensive, so only do this if really necessary.
* label: Disable unavailable actionsMatthias Clasen2020-08-081-0/+3
| | | | Fixes: #3034
* label: Redraw when focus changesMatthias Clasen2020-08-021-0/+17
| | | | | When focus changes in a selectable label, we need to redraw to make the text caret (dis)appear.
* label: Be more selective when selecting on focus-inMatthias Clasen2020-08-011-2/+7
| | | | | | | | | | | | We don't want to select on focus-in when the focus comes from a child. The case where this does harm is when you activate copy or paste actions from the context menu. We close the menu before triggering the action, and if that causes the text in the label to be selected, unexpected things happen, since the action applies to the current selection. This is the equivalent of cd9f5733b3e354301f2 for GtkLabel.
* a11y: Set an accessible role for GtkLabelMatthias Clasen2020-07-281-0/+5
| | | | | | | | Use the label accessible role for GtkLabel. ARIA has some ominous wording about it going way, but while we have it, GtkLabel is the obvious candidate for carrying it. Update the documentation and add a test.
* Remove ATKEmmanuele Bassi2020-07-261-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To build a better world sometimes means having to tear the old one down. -- Alexander Pierce, "Captain America: The Winter Soldier" ATK served us well for nearly 20 years, but the world has changed, and GTK has changed with it. Now ATK is mostly a hindrance towards improving the accessibility stack: - it maps to a very specific implementation, AT-SPI, which is Linux and Unix specific - it requires implementing the same functionality in three different layers of the stack: AT-SPI, ATK, and GTK - only GTK uses it; every other Linux and Unix toolkit and application talks to AT-SPI directly, including assistive technologies Sadly, we cannot incrementally port GTK to a new accessibility stack; since ATK insulates us entirely from the underlying implementation, we cannot replace it piecemeal. Instead, we're going to remove everything and then incrementally build on a clean slate: - add an "accessible" interface, implemented by GTK objects directly, which describe the accessible role and state changes for every UI element - add an "assistive technology context" to proxy a native accessibility API, and assign it to every widget - implement the AT context depending on the platform For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
* Replace "gdouble" with "double"Benjamin Otte2020-07-251-21/+21
|
* Replace "gfloat" with "float"Benjamin Otte2020-07-251-7/+7
|
* Replace "gchar" with "char"Benjamin Otte2020-07-251-49/+49
|
* Replace "gint" with "int"Benjamin Otte2020-07-251-134/+134
|
* label: Only care about clipboard in unrealize of we need toTimm Bäder2020-06-271-4/+7
|
* Fix minor typosYuri Chornoivan2020-06-181-1/+1
|
* Merge branch 'drop-fallback-c89' into 'master'Matthias Clasen2020-05-311-5/+0
|\ | | | | | | | | Drop fallback-c89.c See merge request GNOME/gtk!1999
| * Drop fallback-c89.cChristoph Reiter2020-05-311-5/+0
| | | | | | | | | | | | | | | | | | We require a C compiler supporting C99 now. The main purpose of these fallbacks was for MSVC. From what I can see this is now all supported by MSVC 2015+ anyway. The only other change this includes is to replace isnanf() with the (type infering) C99 isnan() macro, because MSVC doesn't provide isnanf().
* | Merge branch 'fix-mnemonic-zero' into 'master'Matthias Clasen2020-05-311-1/+1
|\ \ | |/ |/| | | | | | | | | label: Fix mnemonic zero Closes #2805 See merge request GNOME/gtk!1993
| * label: Fix mnemonic zeroMatthias Clasen2020-05-301-1/+1
| | | | | | | | | | | | | | We were confusing '\0' and '0' when parsing the label for mnemonics. Fixes: #2805
* | eventcontrollermotion: Remove mode argumentBenjamin Otte2020-05-301-2/+0
|/ | | | It's not used and nobody has documented how it's meant to work anyway.
* gtk: Handle seatless displaysMatthias Clasen2020-05-151-29/+51
| | | | | | | | | | | If you run weston with the headless backend, you get a Wayland display with no seat, which is just fine by the protocol. gdk_display_get_default_seat() returns NULL in this case. Various widgets assume that we always have a seat with a keyboard and a pointer, since that is what X guarantees. Make things survive without that, so we can run the testsuite under a headless Wayland compositor.
* widget: Add a :focusable propertyMatthias Clasen2020-05-101-2/+2
| | | | | | | | | | Add back a property that determines whether an individual widget will accept focus or not. :can-focus prevents the focus from ever entering the entire widget hierarchy below a widget, and :focusable just determines if grabbing the focus to the widget itself will succeed. See #2686
* Merge branch 'wip/baedert/for-master' into 'master'Matthias Clasen2020-05-061-5/+11
|\ | | | | | | | | Wip/baedert/for master See merge request GNOME/gtk!1828
| * label: Be more defensive against non-existant focus_linkTimm Bäder2020-05-051-0/+6
| |
| * label: Remove a debug leftoverTimm Bäder2020-05-051-2/+0
| |
| * label: Unref style_attrs listTimm Bäder2020-05-051-3/+5
| |
* | label: Use dispose instead of destroyMatthias Clasen2020-05-051-5/+5
| | | | | | | | The destroy vfunc is going away.
* | Use gtk_button_set_child throughoutMatthias Clasen2020-05-041-1/+1
|/ | | | | Replace all uses of gtk_container_add on buttons by gtk_button_set_child.
* Fix label accessibilityMatthias Clasen2020-04-201-4/+9
| | | | | | | Emit accessible change signals after setting the new selection limits. This was broken in commit f6bedd0d5e4c8f7b, and showed up as broken accessibility tests.
* Assorted documentation fixesMatthias Clasen2020-04-201-0/+42
|
* Reconcile documentation with declaration and definitionEmmanuele Bassi2020-04-171-49/+49
| | | | | The arguments name in the documentation must match declaration and definition, or gtk-doc and g-ir-scanner will get very cross at us.