summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubutton.c
Commit message (Collapse)AuthorAgeFilesLines
* Add GtkMenuButton:can-shrinkEmmanuele Bassi2023-04-241-0/+80
| | | | Map the GtkMenuButton property to the underlying GtkButton widget.
* Make widget property setters behaveMatthias Clasen2023-03-301-2/+6
| | | | | | We want to allow setting a property to its current value, while still having a precondition for widget->parent being NULL otherwise.
* menubutton: Add `active` property and getter/setterChristopher Davis2023-02-121-0/+63
| | | | | | | | | | | | | | | | GtkMenuButton currently does not provide a way to tell if it's open programmatically. The existing methods, `popup()` and `popdown()`, do not expose any state to callers. If someone wanted to know whether or not a menubutton was open, they needed the popover. Given that GtkMenuButton can manage the popovers itself, that's not always an option for app developers. This commit adds the `active` property and associated methods, where `gtk_menu_button_set_active ()` replaces both `gtk_menu_popup ()` and `gtk_menu_popdown ()`. This addition also mirrors changes in other places, Such as `GtkWidget:visible` vs `show()`/`hide()`.
* Various spelling mistakes across a few domains that show up in documentation.Cam Cook2022-12-081-1/+1
|
* gtk: Stop using gtk_widget_show/hideMatthias Clasen2022-11-281-7/+3
| | | | | | | gtk_widget_set_visible and gtk_window_present are better alternatives, and calling gtk_widget_show on newly created widgets is no longer necessary anyway.
* Drop gtkintl.hMatthias Clasen2022-09-241-1/+0
| | | | | Include gtkprivate.h for I_() and glib-i18n.h for gettext macros.
* Remove all nicks and blurbs from param specsSophie Herold2022-05-111-30/+10
| | | | | | | | Those property features don't seem to be in use anywhere. They are redundant since the docs cover the same information and more. They also created unnecessary translation work. Closes #4904
* Update the accessible description of MenuButtonEmmanuele Bassi2022-01-021-0/+2
| | | | | | | We update the labelled-by relation, but we never update the described-by one. Fixes: #4576
* gtk: mark MenuButton::get_label/get_icon_name as nullableBilal Elmoussaoui2022-01-011-2/+2
|
* Apply 4 suggestion(s) to 1 file(s)Emmanuele Bassi2021-09-171-6/+13
|
* Delete unneccessary comment and make other more descriptiveLukáš Tyrychtr2021-09-171-2/+2
|
* Set correct accessible relations for GtkMenuButtonLukáš Tyrychtr2021-09-141-0/+10
| | | | | | | | | Up until now, as the focus was moved to the inner button, it was not possible for assistive technologies to determine the correct labels and descriptions because developers could set them only for the parent widget. Now, the proper relations are added so the labels should be picked up properly. Fixes #4254
* menubutton: Support custom childrenAlexander Mikhaylenko2021-09-031-9/+160
| | | | Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4205
* Add GtkMenuButton:primary Since: annotationMarc-André Lureau2021-07-131-0/+4
| | | | | | Property added in commit a74420bc1a501f6ee951ed152e8f9a941b0c8438. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* Merge branch 'activatable-buttons' into 'master'Matthias Clasen2021-07-101-0/+38
|\ | | | | | | | | | | | | menubutton: Make menu buttons activatable again Closes #4079 See merge request GNOME/gtk!3728
| * menubutton: Make menu buttons activatable againMatthias Clasen2021-07-051-0/+38
| | | | | | | | | | | | | | The activation is simply forwarded to the toggle button within. Fixes: #4079
* | Add missing "Since: 4.X" tagsMarc-André Lureau2021-07-071-0/+2
|/ | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* menubutton: Don't hardcode label<->arrow spacingAlexander Mikhaylenko2021-06-241-1/+1
| | | | This should come from the theme instead, as it does for icon<->arrow.
* menubutton: Add a way to always show arrow with image buttonsAlexander Mikhaylenko2021-06-241-21/+142
| | | | | | | | | | | | Make sure the button still has the .image-button style class with an icon, also add it to the initial state with only an arrow. Add a new .arrow-button style class for the icon+arrow state so it's possible to style it. Remove spacing from the label+arrow variant to match, re-add it from the stylesheet for both. Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3501
* menubutton: Remove a random g_return_if_fail()Alexander Mikhaylenko2021-06-241-1/+0
| | | | There's already one above.
* menubutton: Reset label when setting icon name and vice versaAlexander Mikhaylenko2021-06-241-0/+15
| | | | Match GtkButton.
* menubutton: Enable F10 for primary menusMatthias Clasen2021-05-241-0/+136
| | | | | | Add a ::primary property to GtkMenuButton, which can be set to make the menu activatable with F10, like menubars.
* gtk: Clean up docs syntaxMatthias Clasen2021-05-221-1/+1
| | | | Replace leftover gtk-doc syntax (#Type) with backquotes.
* docs: Reduce redundancyMatthias Clasen2021-05-201-1/+1
| | | | | | | | Remove a boatload of "or %NULL" from nullable parameters and return values. gi-docgen generates suitable text from the annotation that we don't need to duplicate. This adds a few missing nullable annotations too.
* Documentation fixesMatthias Clasen2021-05-201-1/+1
| | | | | Mostly fixing up indentation of continuation lines, and other small cleanups.
* menubutton: Propagate focus-on-clickMatthias Clasen2021-04-111-0/+17
| | | | | | | | Propagate the focus-on-click setting to the button inside, so that setting menubuttons as !focus-on-click works as expected. This helps for menubuttons in header bars, where dragging on the button will otherwise steal focus from the content.
* menubutton: Put images in a tableMatthias Clasen2021-03-111-58/+9
|
* menubutton: Add property annotationsMatthias Clasen2021-03-111-26/+26
| | | | Connect properties, getters, and setters with annotations
* docs: Fix the MenuButton direction property linksEmmanuele Bassi2021-03-111-2/+2
|
* menubutton: Convert docsMatthias Clasen2021-03-111-84/+112
| | | | Change link syntax, add an example image, generally clean things up.
* Allow circular menubuttonscircular-menubuttonMatthias Clasen2021-01-261-0/+3
| | | | Fixes #3523
* menbutton: Redo indicator arrowsMatthias Clasen2021-01-191-15/+27
| | | | | | | | | | | Instead of hardcoding icon names in the widget, use arrow.none, arrow.up, arrow.down, arrow.left, arrow.right styles and set the icon to use with -gtk-icon-source. This lets themes change the icons that are used here, without forcing all uses of pan-up/down/start/end-symbolic to be treated the same. Document this in the menubutton CSS docs.
* menubutton: Correct the css docsMatthias Clasen2020-12-231-2/+8
| | | | We are using menubutton instead of button.popup now.
* 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".
* a11y: Parse reference lists using varargsEmmanuele Bassi2020-11-101-2/+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
* menubutton: initial accessibility setupMatthias Clasen2020-10-211-5/+33
| | | | | Set roles, properties and relations according to the ARIA authoring practices document.
* Remove unneeded gtkstylecontext.h includesTimm Bäder2020-10-141-1/+0
|
* menubutton: Remove obsolete private methodFlorian Müllner2020-09-291-7/+0
| | | | | It was only added for the fallback app menu in headerbars, which has been removed in the meantime.
* Make GtkMenuButton::direction more useful.arnaudb/menubutton-directionArnaud Bonatti2020-09-291-7/+21
| | | | | | | | | | | | | | | This property was only used until now when there was neither an icon nor a label set, for arrow direction and popover placement. Starting with Gtk4, a GtkMenuButton with a label shows an arrow at the right (in LTR) of the label. Allow disabling the arrow or changing its direction using the direction property, to have a way to restore a Gtk3- like look or to improve popover placement. Fixes #2811.
* Clean up lots of GTK+ -> GTKMatthias Clasen2020-09-121-1/+1
| | | | | | 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.
* Remove ATKEmmanuele Bassi2020-07-261-4/+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
* menubutton: Remove align-widget propertyFlorian Müllner2020-07-241-80/+0
| | | | | The property has been unused since commit 8701e34f749. That was four years ago, so it's safe to say that nobody has been missing it terribly.
* Drop gtkcontainer.h includesMatthias Clasen2020-05-111-1/+1
| | | | These includes are unused.
* Replace most remaining uses of container apiMatthias Clasen2020-05-111-2/+2
| | | | These are all on GtkBox or enumerating children.
* Use gtk_button_set_child throughoutMatthias Clasen2020-05-041-20/+6
| | | | | Replace all uses of gtk_container_add on buttons by gtk_button_set_child.
* Assorted documentation fixesMatthias Clasen2020-04-201-0/+18
|
* menubutton: Drop reliefMatthias Clasen2020-04-171-35/+26
| | | | | We are only using this as a boolean, so change it to a boolean property named has-frame.
* button: Drop reliefMatthias Clasen2020-04-171-3/+7
| | | | | We are only using this as a boolean, so change it to a boolean property named has-frame.
* Reinstate expected focus behaviorMatthias Clasen2020-04-091-1/+10
| | | | | | | | After the :can-focus change in the previous commit, widgets need to set suitable focus and grab_focus implementations to implement the desired focus behavior. This commit does that for all widgets.
* menubutton: Drop the Private structMatthias Clasen2020-03-281-174/+119
|