Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libgedit-amtk for openSUSE:Factory checked in at 2026-10-20 12:57:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libgedit-amtk (Old) and /work/SRC/openSUSE:Factory/.libgedit-amtk.new.3698736 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgedit-amtk" Tue Oct 20 12:57:17 2026 rev:8 rq:1386366 version:5.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libgedit-amtk/libgedit-amtk.changes 2026-05-21 18:26:15.611901915 +0200 +++ /work/SRC/openSUSE:Factory/.libgedit-amtk.new.3698736/libgedit-amtk.changes 2026-10-20 12:57:29.354646560 +0200 @@ -1,0 +2,19 @@ +Mon Oct 19 07:31:21 UTC 2026 - Dominique Leuenberger <[email protected]> + +- Update to version 5.11.0: + * Factory: add create_model_button*() functions for creating + GtkModelButton's. + * Test-headerbar: + + Demo for creating a GtkPopoverMenu with GtkModelButton's, and comment out + the GMenuModel creation (GtkPopoverMenu is more flexible). + + Demo of iconic buttons with tooltips, linked horizontally and placed in + the GtkPopoverMenu. + * Don't annotate get_type() functions with G_GNUC_CONST. + * Updated translations. + +------------------------------------------------------------------- +Thu Oct 8 14:57:19 UTC 2026 - Dominique Leuenberger <[email protected]> + +- Update version dependencies according to meson.build. + +------------------------------------------------------------------- Old: ---- libgedit-amtk-5.10.0.tar.xz New: ---- libgedit-amtk-5.11.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libgedit-amtk.spec ++++++ --- /var/tmp/diff_new_pack.DvKEYP/_old 2026-10-20 12:57:30.485693922 +0200 +++ /var/tmp/diff_new_pack.DvKEYP/_new 2026-10-20 12:57:30.489694089 +0200 @@ -19,7 +19,7 @@ %define api_ver 5 Name: libgedit-amtk -Version: 5.10.0 +Version: 5.11.0 Release: 0 Summary: An Actions, Menus and Toolbars Kit License: LGPL-3.0-or-later @@ -30,7 +30,7 @@ BuildRequires: pkgconfig BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gobject-introspection-1.0) -BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: pkgconfig(gtk+-3.0) >= 3.22 %description “Actions, Menus and Toolbars Kit” or just AMTK is a basic ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.DvKEYP/_old 2026-10-20 12:57:30.554696811 +0200 +++ /var/tmp/diff_new_pack.DvKEYP/_new 2026-10-20 12:57:30.561697104 +0200 @@ -1,6 +1,7 @@ -mtime: 1778776174 -commit: 17c2793b0631f42ac175d45b24376d3a894882803dfc023ab5e9f15e8bda7f9d +mtime: 1792395114 +commit: 77344975b6acf97b7084fde960b1e4e90bd72f86642397d7d465ab9d8585e073 url: https://src.opensuse.org/GNOME/libgedit-amtk -revision: 17c2793b0631f42ac175d45b24376d3a894882803dfc023ab5e9f15e8bda7f9d +revision: 77344975b6acf97b7084fde960b1e4e90bd72f86642397d7d465ab9d8585e073 +trackingbranch: factory projectscmsync: https://src.opensuse.org/GNOME/_ObsPrj ++++++ _service ++++++ --- /var/tmp/diff_new_pack.DvKEYP/_old 2026-10-20 12:57:30.607699031 +0200 +++ /var/tmp/diff_new_pack.DvKEYP/_new 2026-10-20 12:57:30.615699366 +0200 @@ -3,7 +3,7 @@ <service name="obs_scm" mode="manual"> <param name="scm">git</param> <param name="url">https://gitlab.gnome.org/World/gedit/libgedit-amtk.git</param> - <param name="revision">5.10.0</param> + <param name="revision">5.11.0</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">(.*)\+0</param> <param name="versionrewrite-replacement">\1</param> ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-10-19 09:31:54.000000000 +0200 @@ -0,0 +1,5 @@ +*.obscpio +*.osc +_build.* +.pbuild +osc-collab.* ++++++ libgedit-amtk-5.10.0.tar.xz -> libgedit-amtk-5.11.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/NEWS new/libgedit-amtk-5.11.0/NEWS --- old/libgedit-amtk-5.10.0/NEWS 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/NEWS 2026-10-15 05:34:51.000000000 +0200 @@ -1,3 +1,14 @@ +News in 5.11.0, 2026-10-15 +-------------------------- +* Factory: add create_model_button*() functions for creating GtkModelButton's. +* test-headerbar: + - Demo for creating a GtkPopoverMenu with GtkModelButton's, and comment out + the GMenuModel creation (GtkPopoverMenu is more flexible). + - Demo of iconic buttons with tooltips, linked horizontally and placed in the + GtkPopoverMenu. +* Don't annotate get_type() functions with G_GNUC_CONST. +* Translation updates. + News in 5.10.0, 2026-03-27 -------------------------- * Change the definition of Amtk to "The Good Morning Toolkit". diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/amtk/actions-menus-toolbars/amtk-application-window.c new/libgedit-amtk-5.11.0/amtk/actions-menus-toolbars/amtk-application-window.c --- old/libgedit-amtk-5.10.0/amtk/actions-menus-toolbars/amtk-application-window.c 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/amtk/actions-menus-toolbars/amtk-application-window.c 2026-10-15 05:34:51.000000000 +0200 @@ -28,7 +28,7 @@ /* API design: * - * AmtkApplicationWindow was first implemented in Tepl, and + * AmtkApplicationWindow was first implemented in libgedit-tepl, and * TeplApplicationWindow needs to access the GtkApplicationWindow for the * GActionMap. Currently AmtkApplicationWindow could be renamed to AmtkWindow * and be an extension of GtkWindow instead of GtkApplicationWindow, it would @@ -37,9 +37,9 @@ * as is, because (1) the A in Amtk is all about GActions, so normally the app * already uses GtkApplicationWindow, (2) it is easy to port an application to * use GtkApplicationWindow, most of the time it's just changing the parent - * class when subclassing GtkWindow, (3) it is more future-proof for Amtk to - * have access to the GtkApplicationWindow, in case we want to add some features - * that require the GActionMap or whatever. -- swilmet + * class when subclassing GtkWindow, (3) it is more future-proof for + * libgedit-amtk to have access to the GtkApplicationWindow, in case we want to + * add some features that require the GActionMap or whatever. -- swilmet */ struct _AmtkApplicationWindowPrivate diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/amtk/actions-menus-toolbars/amtk-factory.c new/libgedit-amtk-5.11.0/amtk/actions-menus-toolbars/amtk-factory.c --- old/libgedit-amtk-5.10.0/amtk/actions-menus-toolbars/amtk-factory.c 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/amtk/actions-menus-toolbars/amtk-factory.c 2026-10-15 05:34:51.000000000 +0200 @@ -1,4 +1,4 @@ -/* SPDX-FileCopyrightText: 2017-2024 - Sébastien Wilmet <[email protected]> +/* SPDX-FileCopyrightText: 2017-2026 - Sébastien Wilmet <[email protected]> * SPDX-License-Identifier: LGPL-3.0-or-later */ @@ -44,8 +44,9 @@ * discouraged to modify an #AmtkActionInfo after being added to an * #AmtkActionInfoStore. An #AmtkActionInfoStore is meant to be something * static, created on application startup. Updating automatically menu and - * toolbar items is out of scope for the Amtk library. If for example action - * accelerators can be modified at run-time, the menu needs to be re-generated. + * toolbar items is out of scope for the libgedit-amtk library. If for example + * action accelerators can be modified at run-time, the menu needs to be + * re-generated. * * # Menus * @@ -166,7 +167,7 @@ * # Modern UI with a GtkHeaderBar * * To have an example code, see `tests/interactive-tests/test-headerbar.c` in - * the git repository of Amtk. + * the git repository of libgedit-amtk. */ struct _AmtkFactoryPrivate @@ -840,6 +841,100 @@ } /** + * amtk_factory_create_model_button: + * @factory: an #AmtkFactory. + * @action_name: an action name. + * + * Calls amtk_factory_create_model_button_full() with the + * #AmtkFactory:default-flags. + * + * Returns: (transfer floating): a new #GtkModelButton for @action_name. + * Since: 5.11 + */ +GtkWidget * +amtk_factory_create_model_button (AmtkFactory *factory, + const gchar *action_name) +{ + g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); + g_return_val_if_fail (action_name != NULL, NULL); + + return amtk_factory_create_model_button_full (factory, + action_name, + factory->priv->default_flags); +} + +/** + * amtk_factory_create_model_button_full: + * @factory: an #AmtkFactory. + * @action_name: an action name. + * @flags: #AmtkFactoryFlags. + * + * This function ignores the #AmtkFactory:default-flags property and takes the + * @flags argument instead. + * + * Creates a new #GtkModelButton for @action_name. + * + * Returns: (transfer floating): a new #GtkModelButton for @action_name. + * Since: 5.11 + */ +GtkWidget * +amtk_factory_create_model_button_full (AmtkFactory *factory, + const gchar *action_name, + AmtkFactoryFlags flags) +{ + GtkWidget *model_button; + AmtkActionInfo *action_info; + const gchar *label; + const gchar *icon_name; + const gchar *tooltip; + + g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); + g_return_val_if_fail (action_name != NULL, NULL); + + model_button = gtk_model_button_new (); + + action_info = common_create_widget (factory, action_name, flags, &model_button); + if (action_info == NULL) + { + return NULL; + } + + label = amtk_action_info_get_label (action_info); + + if ((flags & AMTK_FACTORY_IGNORE_LABEL) == 0 && + label != NULL) + { + g_object_set (model_button, + "text", label, + NULL); + } + + icon_name = amtk_action_info_get_icon_name (action_info); + + if ((flags & AMTK_FACTORY_IGNORE_ICON) == 0 && + icon_name != NULL) + { + GIcon *icon; + + icon = g_themed_icon_new_with_default_fallbacks (icon_name); + g_object_set (model_button, + "icon", icon, + NULL); + g_object_unref (icon); + } + + tooltip = amtk_action_info_get_tooltip (action_info); + + if ((flags & AMTK_FACTORY_IGNORE_TOOLTIP) == 0 && + tooltip != NULL) + { + gtk_widget_set_tooltip_text (model_button, tooltip); + } + + return model_button; +} + +/** * amtk_factory_create_tool_button: * @factory: an #AmtkFactory. * @action_name: an action name. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/amtk/actions-menus-toolbars/amtk-factory.h new/libgedit-amtk-5.11.0/amtk/actions-menus-toolbars/amtk-factory.h --- old/libgedit-amtk-5.10.0/amtk/actions-menus-toolbars/amtk-factory.h 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/amtk/actions-menus-toolbars/amtk-factory.h 2026-10-15 05:34:51.000000000 +0200 @@ -130,6 +130,15 @@ AmtkFactoryFlags flags); G_MODULE_EXPORT +GtkWidget * amtk_factory_create_model_button (AmtkFactory *factory, + const gchar *action_name); + +G_MODULE_EXPORT +GtkWidget * amtk_factory_create_model_button_full (AmtkFactory *factory, + const gchar *action_name, + AmtkFactoryFlags flags); + +G_MODULE_EXPORT GtkToolItem * amtk_factory_create_tool_button (AmtkFactory *factory, const gchar *action_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/amtk/amtk-init.c new/libgedit-amtk-5.11.0/amtk/amtk-init.c --- old/libgedit-amtk-5.10.0/amtk/amtk-init.c 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/amtk/amtk-init.c 2026-10-15 05:34:51.000000000 +0200 @@ -27,10 +27,10 @@ /** * amtk_init: * - * Initializes the Amtk library (e.g. for the internationalization). + * Initializes the libgedit-amtk library (e.g. for the internationalization). * * This function can be called several times, but is meant to be called at the - * beginning of main(), before any other Amtk function call. + * beginning of main(), before any other libgedit-amtk function call. * * Since: 3.0 */ @@ -56,8 +56,8 @@ /** * amtk_finalize: * - * Free the resources allocated by Amtk. For example it unrefs the singleton - * objects. + * Free the resources allocated by libgedit-amtk. For example it unrefs the + * singleton objects. * * It is not mandatory to call this function, it's just to be friendlier to * memory debugging tools. This function is meant to be called at the end of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/amtk/amtk-tree-view-scrolled-window-sizing.h new/libgedit-amtk-5.11.0/amtk/amtk-tree-view-scrolled-window-sizing.h --- old/libgedit-amtk-5.10.0/amtk/amtk-tree-view-scrolled-window-sizing.h 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/amtk/amtk-tree-view-scrolled-window-sizing.h 2026-10-15 05:34:51.000000000 +0200 @@ -36,7 +36,7 @@ }; G_MODULE_EXPORT -GType amtk_tree_view_scrolled_window_sizing_get_type (void) G_GNUC_CONST; +GType amtk_tree_view_scrolled_window_sizing_get_type (void); G_MODULE_EXPORT AmtkTreeViewScrolledWindowSizing * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/docs/more-information.md new/libgedit-amtk-5.11.0/docs/more-information.md --- old/libgedit-amtk-5.10.0/docs/more-information.md 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/docs/more-information.md 2026-10-15 05:34:51.000000000 +0200 @@ -25,7 +25,7 @@ ------------- See the `gtk_doc` Meson option. A convenient way to read the API documentation -is with the [Devhelp](https://github.com/gdev-technology/devhelp) application. +is with the [Devhelp](https://gitlab.gnome.org/swilmet/devhelp) application. See also other files in this directory for additional notes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/docs/reference/libgedit-amtk-docs.xml new/libgedit-amtk-5.11.0/docs/reference/libgedit-amtk-docs.xml --- old/libgedit-amtk-5.10.0/docs/reference/libgedit-amtk-docs.xml 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/docs/reference/libgedit-amtk-docs.xml 2026-10-15 05:34:51.000000000 +0200 @@ -83,5 +83,9 @@ <title>Index of new symbols in 5.10</title> <xi:include href="xml/api-index-5.10.xml"><xi:fallback /></xi:include> </index> + <index id="api-index-5-11" role="5.11"> + <title>Index of new symbols in 5.11</title> + <xi:include href="xml/api-index-5.11.xml"><xi:fallback /></xi:include> + </index> </part> </book> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/docs/reference/libgedit-amtk-sections.txt new/libgedit-amtk-5.11.0/docs/reference/libgedit-amtk-sections.txt --- old/libgedit-amtk-5.10.0/docs/reference/libgedit-amtk-sections.txt 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/docs/reference/libgedit-amtk-sections.txt 2026-10-15 05:34:51.000000000 +0200 @@ -119,6 +119,8 @@ amtk_factory_create_simple_menu_full amtk_factory_create_gmenu_item amtk_factory_create_gmenu_item_full +amtk_factory_create_model_button +amtk_factory_create_model_button_full amtk_factory_create_tool_button amtk_factory_create_tool_button_full amtk_factory_create_menu_tool_button diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/meson.build new/libgedit-amtk-5.11.0/meson.build --- old/libgedit-amtk-5.10.0/meson.build 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/meson.build 2026-10-15 05:34:51.000000000 +0200 @@ -6,7 +6,7 @@ project( 'libgedit-amtk', 'c', meson_version: '>= 0.64', - version: '5.10.0', + version: '5.11.0', default_options: ['warning_level=2'] ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/po/LINGUAS new/libgedit-amtk-5.11.0/po/LINGUAS --- old/libgedit-amtk-5.10.0/po/LINGUAS 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/po/LINGUAS 2026-10-15 05:34:51.000000000 +0200 @@ -23,6 +23,7 @@ lt ms nl +nn pl pt pt_BR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/po/nn.po new/libgedit-amtk-5.11.0/po/nn.po --- old/libgedit-amtk-5.10.0/po/nn.po 1970-01-01 01:00:00.000000000 +0100 +++ new/libgedit-amtk-5.11.0/po/nn.po 2026-10-15 05:34:51.000000000 +0200 @@ -0,0 +1,34 @@ +# Norwegian Nynorsk translation for libgedit-amtk. +# This file is distributed under the same license as the libgedit-amtk package. +# Roy-Magne Mo <[email protected]>, 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: libgedit-amtk main\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-amtk/-/" +"issues\n" +"POT-Creation-Date: 2026-04-28 16:53+0000\n" +"PO-Revision-Date: 2026-10-09 20:30+0200\n" +"Last-Translator: Roy-Magne Mo <[email protected]>\n" +"Language-Team: Norwegian Nynorsk <[email protected]>\n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Translators: %s is a filename. +#: amtk/actions-menus-toolbars/amtk-application-window.c:359 +#, c-format +msgid "Open “%s”" +msgstr "Opne «%s»" + +#: amtk/actions-menus-toolbars/amtk-application-window.c:635 +msgid "Open _Recent" +msgstr "Opne nyleg _brukte" + +#. Translators: %s is the application name. +#: amtk/actions-menus-toolbars/amtk-application-window.c:638 +#, c-format +msgid "Open a file recently used with %s" +msgstr "Opne ei fil som nyleg er brukt i %s" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgedit-amtk-5.10.0/tests/interactive-tests/test-headerbar.c new/libgedit-amtk-5.11.0/tests/interactive-tests/test-headerbar.c --- old/libgedit-amtk-5.10.0/tests/interactive-tests/test-headerbar.c 2026-03-27 15:17:35.000000000 +0100 +++ new/libgedit-amtk-5.11.0/tests/interactive-tests/test-headerbar.c 2026-10-15 05:34:51.000000000 +0200 @@ -1,4 +1,4 @@ -/* SPDX-FileCopyrightText: 2018 - Sébastien Wilmet <[email protected]> +/* SPDX-FileCopyrightText: 2018-2026 - Sébastien Wilmet <[email protected]> * SPDX-License-Identifier: LGPL-3.0-or-later */ @@ -19,9 +19,14 @@ const AmtkActionInfoEntry entries[] = { /* action, icon, label, accel, tooltip */ + { "win.revert", "view-refresh-symbolic", "_Reload", NULL, + "Reload the document" }, + { "win.print", "printer-symbolic", "_Print…", "<Control>p", + "Open the print dialog window" }, + { "win.fullscreen", "view-fullscreen-symbolic", "_Fullscreen", "F11", + "Fullscreen mode" }, { "win.show-side-panel", NULL, "_Side Panel", "F9", "Toggle side panel visibility" }, - { "win.print", NULL, "_Print", "<Control>p" }, { "win.shortcuts-window", NULL, "_Keyboard Shortcuts" }, { NULL } }; @@ -47,6 +52,14 @@ } static void +revert_activate_cb (GSimpleAction *action, + GVariant *parameter, + gpointer user_data) +{ + g_print ("Reload\n"); +} + +static void print_activate_cb (GSimpleAction *action, GVariant *parameter, gpointer user_data) @@ -55,6 +68,14 @@ } static void +fullscreen_activate_cb (GSimpleAction *action, + GVariant *parameter, + gpointer user_data) +{ + g_print ("Fullscreen\n"); +} + +static void shortcuts_window_activate_cb (GSimpleAction *action, GVariant *parameter, gpointer user_data) @@ -70,8 +91,9 @@ factory = amtk_factory_new (NULL); amtk_factory_set_default_flags (factory, AMTK_FACTORY_IGNORE_GACTION); - gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.show-side-panel")); gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.print")); + gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.show-side-panel")); + gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.fullscreen")); g_object_unref (factory); /* Create section and window */ @@ -92,7 +114,9 @@ const GActionEntry entries[] = { + { "revert", revert_activate_cb }, { "print", print_activate_cb }, + { "fullscreen", fullscreen_activate_cb }, { "shortcuts-window", shortcuts_window_activate_cb }, { NULL } }; @@ -106,6 +130,10 @@ g_object_unref (side_panel_action); } +#if 0 +/* To use with gtk_menu_button_set_menu_model() but it's a less flexible + * solution. + */ static GMenuModel * create_window_menu (void) { @@ -124,25 +152,102 @@ return G_MENU_MODEL (menu); } +#endif + +static GtkWidget * +create_iconic_model_button (AmtkFactory *factory, + const gchar *action_name) +{ + GtkWidget *model_button; + + model_button = amtk_factory_create_model_button (factory, action_name); + gtk_widget_set_hexpand (model_button, TRUE); + g_object_set (model_button, + "iconic", TRUE, + "centered", TRUE, + NULL); + + return model_button; +} + +static GtkWidget * +create_horizontal_submenu_with_iconic_buttons (void) +{ + AmtkFactory *factory; + GtkContainer *hbox; + GtkStyleContext *style_context; + + factory = amtk_factory_new_with_default_application (); + + /* It currently needs to be a GtkBox, not a GtkGrid, because GtkGrid and + * GTK_STYLE_CLASS_LINKED doesn't work as expected in a RTL locale. + * Probably a GtkGrid bug. + */ + hbox = GTK_CONTAINER (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); + style_context = gtk_widget_get_style_context (GTK_WIDGET (hbox)); + gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_LINKED); + gtk_widget_set_margin_bottom (GTK_WIDGET (hbox), 10); + + gtk_container_add (hbox, create_iconic_model_button (factory, "win.revert")); + gtk_container_add (hbox, create_iconic_model_button (factory, "win.print")); + gtk_container_add (hbox, create_iconic_model_button (factory, "win.fullscreen")); + + g_object_unref (factory); + return GTK_WIDGET (hbox); +} + +static GtkWidget * +create_popover_menu (void) +{ + AmtkFactory *factory; + GtkWidget *menu; + GtkContainer *vgrid; + + factory = amtk_factory_new_with_default_application (); + amtk_factory_set_default_flags (factory, AMTK_FACTORY_IGNORE_TOOLTIP); + + menu = gtk_popover_menu_new (); + + vgrid = GTK_CONTAINER (gtk_grid_new ()); + gtk_orientable_set_orientation (GTK_ORIENTABLE (vgrid), GTK_ORIENTATION_VERTICAL); + g_object_set (vgrid, + "margin", 10, + NULL); + + gtk_container_add (vgrid, create_horizontal_submenu_with_iconic_buttons ()); + gtk_container_add (vgrid, amtk_factory_create_model_button (factory, "win.show-side-panel")); + gtk_container_add (vgrid, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_container_add (vgrid, amtk_factory_create_model_button (factory, "win.shortcuts-window")); + + gtk_widget_show_all (GTK_WIDGET (vgrid)); + gtk_container_add (GTK_CONTAINER (menu), GTK_WIDGET (vgrid)); + + g_object_unref (factory); + return menu; +} static GtkWidget * create_header_bar (void) { GtkHeaderBar *header_bar; - GMenuModel *window_menu; GtkMenuButton *menu_button; header_bar = GTK_HEADER_BAR (gtk_header_bar_new ()); - gtk_header_bar_set_title (header_bar, "Amtk test headerbar"); + gtk_header_bar_set_title (header_bar, "libgedit-amtk headerbar test"); gtk_header_bar_set_show_close_button (header_bar, TRUE); /* Menu */ menu_button = GTK_MENU_BUTTON (gtk_menu_button_new ()); gtk_menu_button_set_direction (menu_button, GTK_ARROW_NONE); - window_menu = create_window_menu (); - gtk_menu_button_set_menu_model (menu_button, window_menu); - g_object_unref (window_menu); +#if 0 + { + GMenuModel *window_menu = create_window_menu (); + gtk_menu_button_set_menu_model (menu_button, window_menu); + g_object_unref (window_menu); + } +#endif + gtk_menu_button_set_popover (menu_button, create_popover_menu ()); gtk_header_bar_pack_end (header_bar, GTK_WIDGET (menu_button)); ++++++ libgedit-amtk.obsinfo ++++++ --- /var/tmp/diff_new_pack.DvKEYP/_old 2026-10-20 12:57:31.070718419 +0200 +++ /var/tmp/diff_new_pack.DvKEYP/_new 2026-10-20 12:57:31.082718922 +0200 @@ -1,5 +1,5 @@ name: libgedit-amtk -version: 5.10.0 -mtime: 1774621055 -commit: 8420fb89b340e33576a50f3ee2d69df417b16e5a +version: 5.11.0 +mtime: 1792035291 +commit: fcd22592dbe2589df622c31cf8fe823470ad28b5
