From 79f06879296a4553a9b29f442db6d715456fde17 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 9 Aug 2020 10:59:22 -0400 Subject: [PATCH] gtk-demo: Drop the modelbutton demo Not a public api, so shouldn't be featured in a demo. --- demos/gtk-demo/demo.gresource.xml | 4 - demos/gtk-demo/meson.build | 1 - demos/gtk-demo/modelbutton.c | 66 --------------- demos/gtk-demo/modelbutton.ui | 133 ------------------------------ 4 files changed, 204 deletions(-) delete mode 100644 demos/gtk-demo/modelbutton.c delete mode 100644 demos/gtk-demo/modelbutton.ui diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml index 0ec808bd96..4cfc704db5 100644 --- a/demos/gtk-demo/demo.gresource.xml +++ b/demos/gtk-demo/demo.gresource.xml @@ -229,7 +229,6 @@ listview_words.c list_store.c markup.c - modelbutton.c overlay.c overlay2.c paint.c @@ -310,9 +309,6 @@ scale.ui - - modelbutton.ui - demotaggedentry.c demotaggedentry.h diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index 0b419edb21..8eaf7090da 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -51,7 +51,6 @@ demos = files([ 'listview_weather.c', 'listview_words.c', 'markup.c', - 'modelbutton.c', 'overlay.c', 'overlay2.c', 'paint.c', diff --git a/demos/gtk-demo/modelbutton.c b/demos/gtk-demo/modelbutton.c deleted file mode 100644 index 055189a1f5..0000000000 --- a/demos/gtk-demo/modelbutton.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Model Button - * - * GtkModelButton is a button widget that is designed to be used with - * a GAction as model. The button will adjust its appearance according - * to the kind of action it is connected to. - * - * It is also possible to use GtkModelButton without a GAction. In this - * case, you should set the "role" attribute yourself, and connect to the - * "clicked" signal as you would for any other button. - * - * A common use of GtkModelButton is to implement menu-like content - * in popovers. - */ - -#include - -void -modelbutton_tool_clicked (GtkButton *button) -{ - gboolean active; - - g_object_get (button, "active", &active, NULL); - g_object_set (button, "active", !active, NULL); -} - -GtkWidget * -do_modelbutton (GtkWidget *do_widget) -{ - static GtkWidget *window = NULL; - static GActionEntry win_entries[] = { - { "color", NULL, "s", "'red'", NULL }, - { "chocolate", NULL, NULL, "true", NULL }, - { "vanilla", NULL, NULL, "false", NULL }, - { "sprinkles", NULL, NULL, NULL, NULL } - }; - - if (!window) - { - GtkBuilder *builder; - GActionGroup *actions; - - builder = gtk_builder_new_from_resource ("/modelbutton/modelbutton.ui"); - window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); - gtk_window_set_display (GTK_WINDOW (window), - gtk_widget_get_display (do_widget)); - g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); - - actions = (GActionGroup*)g_simple_action_group_new (); - g_action_map_add_action_entries (G_ACTION_MAP (actions), - win_entries, G_N_ELEMENTS (win_entries), - window); - gtk_widget_insert_action_group (window, "win", actions); - - - g_object_unref (builder); - } - - if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); - else - gtk_window_destroy (GTK_WINDOW (window)); - - - return window; -} - diff --git a/demos/gtk-demo/modelbutton.ui b/demos/gtk-demo/modelbutton.ui deleted file mode 100644 index 12593a29d5..0000000000 --- a/demos/gtk-demo/modelbutton.ui +++ /dev/null @@ -1,133 +0,0 @@ - - - - Model Button - 0 - - - - - - vertical - 80 - 80 - 80 - 80 - - - thing_a - _Color - 1 - - - - - thing_b - _Flavors - 1 - - - - - thing_c - _Tools - 1 - - - - - - - - - - vertical - - - win.color - 'red' - Red - - - - - win.color - 'green' - Green - - - - - win.color - 'blue' - Blue - - - - - - - - - - vertical - - - win.chocolate - Chocolate - - - - - win.vanilla - Vanilla - - - - - - - - win.sprinkles - Add Sprinkles - - - - - - - - - - vertical - - - Hammer - check - - - - - - Screwdriver - check - - - - - - Drill - check - - - - - - -