forked from AuroraMiddleware/gtk
Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master Closes #2980, #2974, #2949, and #2766 See merge request GNOME/gtk!2333
This commit is contained in:
commit
0b2833f69c
@ -293,6 +293,7 @@ do_paintable_mediastream (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear MediaStream");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 300, 200);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
nuclear = gtk_nuclear_media_stream_new ();
|
||||
gtk_media_stream_set_loop (GTK_MEDIA_STREAM (nuclear), TRUE);
|
||||
|
@ -257,6 +257,7 @@ GtkListBoxUpdateHeaderFunc
|
||||
|
||||
gtk_list_box_new
|
||||
gtk_list_box_prepend
|
||||
gtk_list_box_append
|
||||
gtk_list_box_insert
|
||||
gtk_list_box_remove
|
||||
gtk_list_box_select_row
|
||||
|
@ -95,7 +95,10 @@
|
||||
* set the title property explicitly when constructing a GtkAboutDialog,
|
||||
* as shown in the following example:
|
||||
* |[<!-- language="C" -->
|
||||
* GdkTexture *example_logo = gdk_texture_new_from_file ("./logo.png", NULL);
|
||||
* GFile *logo_file = g_file_new_for_path ("./logo.png");
|
||||
* GdkTexture *example_logo = gdk_texture_new_from_file (logo_file, NULL);
|
||||
* g_object_unref (logo_file);
|
||||
*
|
||||
* gtk_show_about_dialog (NULL,
|
||||
* "program-name", "ExampleCode",
|
||||
* "logo", example_logo,
|
||||
|
@ -629,7 +629,7 @@ gtk_button_buildable_iface_init (GtkBuildableIface *iface)
|
||||
* gtk_button_new:
|
||||
*
|
||||
* Creates a new #GtkButton widget. To add a child widget to the button,
|
||||
* use gtk_container_add().
|
||||
* use gtk_button_set_child().
|
||||
*
|
||||
* Returns: The newly created #GtkButton widget.
|
||||
*/
|
||||
@ -1035,7 +1035,7 @@ gtk_button_set_child (GtkButton *button,
|
||||
gtk_widget_set_parent (priv->child, GTK_WIDGET (button));
|
||||
|
||||
gtk_button_set_child_type (button, WIDGET_CHILD);
|
||||
g_object_notify (G_OBJECT (button), "child");
|
||||
g_object_notify_by_pspec (G_OBJECT (button), props[PROP_CHILD]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -730,7 +730,7 @@ gtk_dialog_new_empty (const char *title,
|
||||
*
|
||||
* Here’s a simple example:
|
||||
* |[<!-- language="C" -->
|
||||
* GtkWidget *main_app_window; // Window the dialog should show up on
|
||||
* GtkWindow *main_app_window; // Window the dialog should show up on
|
||||
* GtkWidget *dialog;
|
||||
* GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT;
|
||||
* dialog = gtk_dialog_new_with_buttons ("My dialog",
|
||||
|
@ -85,10 +85,12 @@ static guint signals[LAST_SIGNAL] = { 0, };
|
||||
* ## Simple GtkDrawingArea usage
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* void
|
||||
* draw_function (GtkDrawingArea *area, cairo_t *cr,
|
||||
* int width, int height,
|
||||
* gpointer data)
|
||||
* static void
|
||||
* draw_function (GtkDrawingArea *area,
|
||||
* cairo_t *cr,
|
||||
* int width,
|
||||
* int height,
|
||||
* gpointer data)
|
||||
* {
|
||||
* GdkRGBA color;
|
||||
* GtkStyleContext *context;
|
||||
@ -107,7 +109,8 @@ static guint signals[LAST_SIGNAL] = { 0, };
|
||||
* cairo_fill (cr);
|
||||
* }
|
||||
*
|
||||
* void main (int argc, char **argv)
|
||||
* int
|
||||
* main (int argc, char **argv)
|
||||
* {
|
||||
* gtk_init ();
|
||||
*
|
||||
@ -117,7 +120,7 @@ static guint signals[LAST_SIGNAL] = { 0, };
|
||||
* gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (area),
|
||||
* draw_function,
|
||||
* NULL, NULL);
|
||||
*
|
||||
* return 0;
|
||||
* }
|
||||
* ]|
|
||||
*
|
||||
|
@ -40,7 +40,7 @@
|
||||
* ## Forcing entry to uppercase.
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* #include <ctype.h>;
|
||||
* #include <ctype.h>
|
||||
*
|
||||
* void
|
||||
* insert_text_handler (GtkEditable *editable,
|
||||
|
@ -482,17 +482,26 @@ gtk_file_chooser_get_files (GtkFileChooser *chooser)
|
||||
* file and is saving it for the first time, do not call this function.
|
||||
* Instead, use something similar to this:
|
||||
* |[<!-- language="C" -->
|
||||
* if (document_is_new)
|
||||
* {
|
||||
* // the user just created a new document
|
||||
* gtk_file_chooser_set_current_folder (chooser, default_file_for_saving);
|
||||
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* // the user edited an existing document
|
||||
* gtk_file_chooser_set_file (chooser, existing_file);
|
||||
* }
|
||||
* static void
|
||||
* prepare_file_chooser (GtkFileChooser *chooser,
|
||||
* GFile *existing_file)
|
||||
* {
|
||||
* gboolean document_is_new = (existing_file == NULL);
|
||||
*
|
||||
* if (document_is_new)
|
||||
* {
|
||||
* GFile *default_file_for_saving = g_file_new_for_path ("./out.txt");
|
||||
* // the user just created a new document
|
||||
* gtk_file_chooser_set_current_folder (chooser, default_file_for_saving, NULL);
|
||||
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
|
||||
* g_object_unref (default_file_for_saving);
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* // the user edited an existing document
|
||||
* gtk_file_chooser_set_file (chooser, existing_file, NULL);
|
||||
* }
|
||||
* }
|
||||
* ]|
|
||||
*
|
||||
* Returns: Not useful.
|
||||
|
@ -84,7 +84,7 @@
|
||||
*
|
||||
* button = gtk_file_chooser_button_new (_("Select a file"),
|
||||
* GTK_FILE_CHOOSER_ACTION_OPEN);
|
||||
* gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button), cwd);
|
||||
* gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button), cwd, NULL);
|
||||
* g_object_unref (cwd);
|
||||
* }
|
||||
* ]|
|
||||
|
@ -68,7 +68,7 @@
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* static void
|
||||
* on_response (GtkNativeDialog *dialog,
|
||||
* on_response (GtkNativeDialog *native,
|
||||
* int response)
|
||||
* {
|
||||
* if (response == GTK_RESPONSE_ACCEPT)
|
||||
@ -102,12 +102,12 @@
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* static void
|
||||
* on_response (GtkNativeDialog *dialog,
|
||||
* on_response (GtkNativeDialog *native,
|
||||
* int response)
|
||||
* {
|
||||
* if (response == GTK_RESPONSE_ACCEPT)
|
||||
* {
|
||||
* GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
|
||||
* GtkFileChooser *chooser = GTK_FILE_CHOOSER (native);
|
||||
* GFile *file = gtk_file_chooser_get_file (chooser);
|
||||
*
|
||||
* save_to_file (file);
|
||||
@ -131,11 +131,9 @@
|
||||
* chooser = GTK_FILE_CHOOSER (native);
|
||||
*
|
||||
* if (user_edited_a_new_document)
|
||||
* gtk_file_chooser_set_current_name (chooser,
|
||||
* _("Untitled document"));
|
||||
* gtk_file_chooser_set_current_name (chooser, _("Untitled document"));
|
||||
* else
|
||||
* gtk_file_chooser_set_filename (chooser,
|
||||
* existing_filename);
|
||||
* gtk_file_chooser_set_file (chooser, existing_file, NULL);
|
||||
*
|
||||
* g_signal_connect (native, "response", G_CALLBACK (on_response), NULL);
|
||||
* gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
|
||||
|
@ -48,7 +48,7 @@
|
||||
* The children of a GtkFlowBox can be dynamically sorted and filtered.
|
||||
*
|
||||
* Although a GtkFlowBox must have only #GtkFlowBoxChild children,
|
||||
* you can add any kind of widget to it via gtk_container_add(), and
|
||||
* you can add any kind of widget to it via gtk_flow_box_insert(), and
|
||||
* a GtkFlowBoxChild widget will automatically be inserted between
|
||||
* the box and the widget.
|
||||
*
|
||||
@ -4042,8 +4042,7 @@ gtk_flow_box_insert_css_node (GtkFlowBox *box,
|
||||
* Inserts the @widget into @box at @position.
|
||||
*
|
||||
* If a sort function is set, the widget will actually be inserted
|
||||
* at the calculated position and this function has the same effect
|
||||
* as gtk_container_add().
|
||||
* at the calculated position.
|
||||
*
|
||||
* If @position is -1, or larger than the total number of children
|
||||
* in the @box, then the @widget will be appended to the end.
|
||||
@ -4239,7 +4238,7 @@ gtk_flow_box_check_model_compat (GtkFlowBox *box)
|
||||
* If @model is %NULL, @box is left empty.
|
||||
*
|
||||
* It is undefined to add or remove widgets directly (for example, with
|
||||
* gtk_flow_box_insert() or gtk_container_add()) while @box is bound to a
|
||||
* gtk_flow_box_insert()) while @box is bound to a
|
||||
* model.
|
||||
*
|
||||
* Note that using a model is incompatible with the filtering and sorting
|
||||
|
@ -55,7 +55,8 @@
|
||||
* button in it).
|
||||
*
|
||||
* Although a #GtkListBox must have only #GtkListBoxRow children you can
|
||||
* add any kind of widget to it via gtk_container_add(), and a #GtkListBoxRow
|
||||
* add any kind of widget to it via gtk_list_box_prepend(),
|
||||
* gtk_list_box_append() and gtk_list_box_insert() and a #GtkListBoxRow
|
||||
* widget will automatically be inserted between the list and the widget.
|
||||
*
|
||||
* #GtkListBoxRows can be marked as activatable or selectable. If a row
|
||||
@ -2574,8 +2575,7 @@ gtk_list_box_size_allocate (GtkWidget *widget,
|
||||
* @child: the #GtkWidget to add
|
||||
*
|
||||
* Prepend a widget to the list. If a sort function is set, the widget will
|
||||
* actually be inserted at the calculated position and this function has the
|
||||
* same effect of gtk_container_add().
|
||||
* actually be inserted at the calculated position.
|
||||
*/
|
||||
void
|
||||
gtk_list_box_prepend (GtkListBox *box,
|
||||
@ -2584,6 +2584,21 @@ gtk_list_box_prepend (GtkListBox *box,
|
||||
gtk_list_box_insert (box, child, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_list_box_append:
|
||||
* @box: a #GtkListBox
|
||||
* @child: the #GtkWidget to add
|
||||
*
|
||||
* Append a widget to the list. If a sort function is set, the widget will
|
||||
* actually be inserted at the calculated position.
|
||||
*/
|
||||
void
|
||||
gtk_list_box_append (GtkListBox *box,
|
||||
GtkWidget *child)
|
||||
{
|
||||
gtk_list_box_insert (box, child, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_list_box_insert:
|
||||
* @box: a #GtkListBox
|
||||
@ -2591,8 +2606,7 @@ gtk_list_box_prepend (GtkListBox *box,
|
||||
* @position: the position to insert @child in
|
||||
*
|
||||
* Insert the @child into the @box at @position. If a sort function is
|
||||
* set, the widget will actually be inserted at the calculated position and
|
||||
* this function has the same effect of gtk_container_add().
|
||||
* set, the widget will actually be inserted at the calculated position.
|
||||
*
|
||||
* If @position is -1, or larger than the total number of items in the
|
||||
* @box, then the @child will be appended to the end.
|
||||
@ -3562,7 +3576,7 @@ gtk_list_box_check_model_compat (GtkListBox *box)
|
||||
* If @model is %NULL, @box is left empty.
|
||||
*
|
||||
* It is undefined to add or remove widgets directly (for example, with
|
||||
* gtk_list_box_insert() or gtk_container_add()) while @box is bound to a
|
||||
* gtk_list_box_insert()) while @box is bound to a
|
||||
* model.
|
||||
*
|
||||
* Note that using a model is incompatible with the filtering and sorting
|
||||
|
@ -168,6 +168,9 @@ GDK_AVAILABLE_IN_ALL
|
||||
void gtk_list_box_prepend (GtkListBox *box,
|
||||
GtkWidget *child);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_list_box_append (GtkListBox *box,
|
||||
GtkWidget *child);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_list_box_insert (GtkListBox *box,
|
||||
GtkWidget *child,
|
||||
int position);
|
||||
|
@ -420,7 +420,7 @@ gtk_overlay_new (void)
|
||||
* Adds @widget to @overlay.
|
||||
*
|
||||
* The widget will be stacked on top of the main widget
|
||||
* added with gtk_container_add().
|
||||
* added with gtk_overlay_set_child().
|
||||
*
|
||||
* The position at which @widget is placed is determined
|
||||
* from its #GtkWidget:halign and #GtkWidget:valign properties.
|
||||
|
@ -870,8 +870,7 @@ gtk_popover_init (GtkPopover *popover)
|
||||
gtk_widget_set_layout_manager (priv->contents_widget, gtk_bin_layout_new ());
|
||||
gtk_widget_set_parent (priv->contents_widget, GTK_WIDGET (popover));
|
||||
|
||||
gtk_css_node_add_class (gtk_widget_get_css_node (GTK_WIDGET (popover)),
|
||||
g_quark_from_static_string (GTK_STYLE_CLASS_BACKGROUND));
|
||||
gtk_widget_add_css_class (widget, "background");
|
||||
|
||||
add_actions (popover);
|
||||
}
|
||||
|
@ -68,12 +68,12 @@
|
||||
* Widgets with native scrolling support, i.e. those whose classes implement the
|
||||
* #GtkScrollable interface, are added directly. For other types of widget, the
|
||||
* class #GtkViewport acts as an adaptor, giving scrollability to other widgets.
|
||||
* GtkScrolledWindow’s implementation of gtk_container_add() intelligently
|
||||
* gtk_scrolled_window_set_child() intelligently
|
||||
* accounts for whether or not the added child is a #GtkScrollable. If it isn’t,
|
||||
* #GtkScrolledWindow wraps the child in a #GtkViewport and adds that for you.
|
||||
* Therefore, you can just add any child widget and not worry about the details.
|
||||
*
|
||||
* If gtk_container_add() has added a #GtkViewport for you, you can remove
|
||||
* If gtk_scrolled_window_set_child() has added a #GtkViewport for you, you can remove
|
||||
* both your added child widget from the #GtkViewport, and the #GtkViewport
|
||||
* from the GtkScrolledWindow, like this:
|
||||
*
|
||||
|
@ -1270,7 +1270,7 @@ stack_child_visibility_notify_cb (GObject *obj,
|
||||
* gtk_stack_add_titled:
|
||||
* @stack: a #GtkStack
|
||||
* @child: the widget to add
|
||||
* @name: the name for @child
|
||||
* @name: (nullable): the name for @child
|
||||
* @title: a human-readable title for @child
|
||||
*
|
||||
* Adds a child to @stack.
|
||||
@ -1282,9 +1282,9 @@ stack_child_visibility_notify_cb (GObject *obj,
|
||||
*/
|
||||
GtkStackPage *
|
||||
gtk_stack_add_titled (GtkStack *stack,
|
||||
GtkWidget *child,
|
||||
const char *name,
|
||||
const char *title)
|
||||
GtkWidget *child,
|
||||
const char *name,
|
||||
const char *title)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_STACK (stack), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
||||
@ -1296,7 +1296,7 @@ gtk_stack_add_titled (GtkStack *stack,
|
||||
* gtk_stack_add_named:
|
||||
* @stack: a #GtkStack
|
||||
* @child: the widget to add
|
||||
* @name: the name for @child
|
||||
* @name: (nullable): the name for @child or %NULL
|
||||
*
|
||||
* Adds a child to @stack.
|
||||
* The child is identified by the @name.
|
||||
@ -1305,8 +1305,8 @@ gtk_stack_add_titled (GtkStack *stack,
|
||||
*/
|
||||
GtkStackPage *
|
||||
gtk_stack_add_named (GtkStack *stack,
|
||||
GtkWidget *child,
|
||||
const char *name)
|
||||
GtkWidget *child,
|
||||
const char *name)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_STACK (stack), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
||||
@ -1348,14 +1348,17 @@ gtk_stack_add_page (GtkStack *stack,
|
||||
|
||||
g_return_if_fail (child_info->widget != NULL);
|
||||
|
||||
for (l = priv->children; l != NULL; l = l->next)
|
||||
if (child_info->name)
|
||||
{
|
||||
GtkStackPage *info = l->data;
|
||||
if (info->name &&
|
||||
g_strcmp0 (info->name, child_info->name) == 0)
|
||||
for (l = priv->children; l != NULL; l = l->next)
|
||||
{
|
||||
g_warning ("While adding page: duplicate child name in GtkStack: %s", child_info->name);
|
||||
break;
|
||||
GtkStackPage *info = l->data;
|
||||
if (info->name &&
|
||||
g_strcmp0 (info->name, child_info->name) == 0)
|
||||
{
|
||||
g_warning ("While adding page: duplicate child name in GtkStack: %s", child_info->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3107,6 +3107,7 @@ gtk_text_view_set_editable (GtkTextView *text_view,
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (text_view),
|
||||
GTK_ACCESSIBLE_PROPERTY_READ_ONLY, !setting,
|
||||
-1);
|
||||
gtk_text_view_update_emoji_action (text_view);
|
||||
|
||||
g_object_notify (G_OBJECT (text_view), "editable");
|
||||
}
|
||||
@ -8531,7 +8532,8 @@ static void
|
||||
gtk_text_view_update_emoji_action (GtkTextView *text_view)
|
||||
{
|
||||
gtk_widget_action_set_enabled (GTK_WIDGET (text_view), "misc.insert-emoji",
|
||||
(gtk_text_view_get_input_hints (text_view) & GTK_INPUT_HINT_NO_EMOJI) == 0);
|
||||
(gtk_text_view_get_input_hints (text_view) & GTK_INPUT_HINT_NO_EMOJI) == 0 &&
|
||||
text_view->priv->editable);
|
||||
}
|
||||
|
||||
static GMenuModel *
|
||||
|
@ -115,36 +115,86 @@ enum {
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
|
||||
static GParamSpec *toggle_button_props[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
static gboolean gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling);
|
||||
static void gtk_toggle_button_clicked (GtkButton *button);
|
||||
static void gtk_toggle_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_toggle_button_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
|
||||
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkToggleButton, gtk_toggle_button, GTK_TYPE_BUTTON,
|
||||
G_ADD_PRIVATE (GtkToggleButton))
|
||||
|
||||
static void
|
||||
gtk_toggle_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkToggleButton *tb = GTK_TOGGLE_BUTTON (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ACTIVE:
|
||||
gtk_toggle_button_set_active (tb, g_value_get_boolean (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkToggleButton *tb = GTK_TOGGLE_BUTTON (object);
|
||||
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (tb);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ACTIVE:
|
||||
g_value_set_boolean (value, priv->active);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling)
|
||||
{
|
||||
/*
|
||||
* We override the standard implementation in
|
||||
* gtk_widget_real_mnemonic_activate() in order to focus the widget even
|
||||
* if there is no mnemonic conflict.
|
||||
*/
|
||||
if (gtk_widget_get_can_focus (widget))
|
||||
gtk_widget_grab_focus (widget);
|
||||
|
||||
if (!group_cycling)
|
||||
gtk_widget_activate (widget);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_clicked (GtkButton *button)
|
||||
{
|
||||
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
|
||||
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button);
|
||||
|
||||
gtk_toggle_button_set_active (toggle_button, !priv->active);
|
||||
|
||||
GTK_BUTTON_CLASS (gtk_toggle_button_parent_class)->clicked (button);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_class_init (GtkToggleButtonClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkButtonClass *button_class;
|
||||
|
||||
gobject_class = G_OBJECT_CLASS (class);
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
button_class = (GtkButtonClass*) class;
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
GtkButtonClass *button_class = GTK_BUTTON_CLASS (class);
|
||||
|
||||
gobject_class->set_property = gtk_toggle_button_set_property;
|
||||
gobject_class->get_property = gtk_toggle_button_get_property;
|
||||
@ -173,12 +223,12 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
|
||||
*/
|
||||
toggle_button_signals[TOGGLED] =
|
||||
g_signal_new (I_("toggled"),
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GtkToggleButtonClass, toggled),
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GtkToggleButtonClass, toggled),
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
gtk_widget_class_set_css_name (widget_class, I_("button"));
|
||||
}
|
||||
@ -201,7 +251,7 @@ gtk_toggle_button_init (GtkToggleButton *toggle_button)
|
||||
*
|
||||
* Returns: a new toggle button.
|
||||
*/
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gtk_toggle_button_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_TOGGLE_BUTTON, NULL);
|
||||
@ -215,7 +265,7 @@ gtk_toggle_button_new (void)
|
||||
*
|
||||
* Returns: a new toggle button.
|
||||
*/
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gtk_toggle_button_new_with_label (const char *label)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_TOGGLE_BUTTON, "label", label, NULL);
|
||||
@ -232,54 +282,13 @@ gtk_toggle_button_new_with_label (const char *label)
|
||||
*
|
||||
* Returns: a new #GtkToggleButton
|
||||
*/
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gtk_toggle_button_new_with_mnemonic (const char *label)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_TOGGLE_BUTTON,
|
||||
"label", label,
|
||||
"use-underline", TRUE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkToggleButton *tb;
|
||||
|
||||
tb = GTK_TOGGLE_BUTTON (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ACTIVE:
|
||||
gtk_toggle_button_set_active (tb, g_value_get_boolean (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkToggleButton *tb = GTK_TOGGLE_BUTTON (object);
|
||||
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (tb);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ACTIVE:
|
||||
g_value_set_boolean (value, priv->active);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
return g_object_new (GTK_TYPE_TOGGLE_BUTTON,
|
||||
"label", label,
|
||||
"use-underline", TRUE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -295,7 +304,7 @@ gtk_toggle_button_get_property (GObject *object,
|
||||
*/
|
||||
void
|
||||
gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
|
||||
gboolean is_active)
|
||||
gboolean is_active)
|
||||
{
|
||||
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button);
|
||||
|
||||
@ -356,34 +365,3 @@ gtk_toggle_button_toggled (GtkToggleButton *toggle_button)
|
||||
|
||||
g_signal_emit (toggle_button, toggle_button_signals[TOGGLED], 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling)
|
||||
{
|
||||
/*
|
||||
* We override the standard implementation in
|
||||
* gtk_widget_real_mnemonic_activate() in order to focus the widget even
|
||||
* if there is no mnemonic conflict.
|
||||
*/
|
||||
if (gtk_widget_get_can_focus (widget))
|
||||
gtk_widget_grab_focus (widget);
|
||||
|
||||
if (!group_cycling)
|
||||
gtk_widget_activate (widget);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_clicked (GtkButton *button)
|
||||
{
|
||||
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
|
||||
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button);
|
||||
|
||||
gtk_toggle_button_set_active (toggle_button, !priv->active);
|
||||
|
||||
if (GTK_BUTTON_CLASS (gtk_toggle_button_parent_class)->clicked)
|
||||
GTK_BUTTON_CLASS (gtk_toggle_button_parent_class)->clicked (button);
|
||||
}
|
||||
|
||||
|
@ -49,14 +49,6 @@
|
||||
* capabilities. Use GtkViewport to scroll child widgets such as
|
||||
* #GtkGrid, #GtkBox, and so on.
|
||||
*
|
||||
* If a widget has native scrolling abilities, such as #GtkTextView,
|
||||
* #GtkTreeView or #GtkIconView, it can be added to a #GtkScrolledWindow
|
||||
* with gtk_container_add(). If a widget does not, you must first add the
|
||||
* widget to a #GtkViewport, then add the viewport to the scrolled window.
|
||||
* gtk_container_add() does this automatically if a child that does not
|
||||
* implement #GtkScrollable is added to a #GtkScrolledWindow, so you can
|
||||
* ignore the presence of the viewport.
|
||||
*
|
||||
* The GtkViewport will start scrolling content only if allocated less
|
||||
* than the child widget’s minimum size in a given orientation.
|
||||
*
|
||||
|
@ -132,8 +132,8 @@
|
||||
*
|
||||
* |[<!-- language="plain" -->
|
||||
* window.background
|
||||
* ├── <titlebar child>.titlebar [.default-decoration]
|
||||
* ╰── <child>
|
||||
* ├── <child>
|
||||
* ╰── <titlebar child>.titlebar [.default-decoration]
|
||||
* ]|
|
||||
*
|
||||
* GtkWindow has a main CSS node with name window and style class .background.
|
||||
@ -2824,7 +2824,7 @@ gtk_window_set_titlebar (GtkWindow *window,
|
||||
|
||||
gtk_window_enable_csd (window);
|
||||
priv->title_box = titlebar;
|
||||
gtk_widget_insert_after (priv->title_box, widget, NULL);
|
||||
gtk_widget_insert_before (priv->title_box, widget, NULL);
|
||||
|
||||
gtk_widget_add_css_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
|
||||
|
||||
@ -4308,7 +4308,7 @@ gtk_window_realize (GtkWidget *widget)
|
||||
gtk_widget_add_css_class (priv->titlebar, GTK_STYLE_CLASS_TITLEBAR);
|
||||
gtk_widget_add_css_class (priv->titlebar, "default-decoration");
|
||||
|
||||
gtk_widget_insert_after (priv->titlebar, widget, NULL);
|
||||
gtk_widget_insert_before (priv->titlebar, widget, NULL);
|
||||
priv->title_box = priv->titlebar;
|
||||
}
|
||||
|
||||
@ -7084,7 +7084,7 @@ gtk_window_set_child (GtkWindow *window,
|
||||
if (child)
|
||||
{
|
||||
priv->child = child;
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (window));
|
||||
gtk_widget_insert_before (child, GTK_WIDGET (window), priv->title_box);
|
||||
}
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_CHILD]);
|
||||
|
@ -390,7 +390,8 @@ gtk_inspector_a11y_set_object (GtkInspectorA11y *sl,
|
||||
GtkWidget *stack;
|
||||
GtkStackPage *page;
|
||||
GtkATContext *context;
|
||||
if (sl->object)
|
||||
|
||||
if (sl->object && GTK_IS_ACCESSIBLE (sl->object))
|
||||
{
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
|
||||
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
|
||||
@ -426,7 +427,7 @@ dispose (GObject *o)
|
||||
{
|
||||
GtkInspectorA11y *sl = GTK_INSPECTOR_A11Y (o);
|
||||
|
||||
if (sl->object)
|
||||
if (sl->object && GTK_IS_ACCESSIBLE (sl->object))
|
||||
{
|
||||
GtkATContext *context;
|
||||
|
||||
|
@ -919,9 +919,15 @@ update_go_buttons (GtkInspectorWindow *iw)
|
||||
switch (kind)
|
||||
{
|
||||
case CHILD_KIND_WIDGET:
|
||||
update_go_button (iw->go_down_button, gtk_widget_get_first_child (GTK_WIDGET (object)) != NULL, "First child");
|
||||
update_go_button (iw->go_previous_button, gtk_widget_get_prev_sibling (GTK_WIDGET (object)) != NULL, "Previous sibling");
|
||||
update_go_button (iw->go_next_button, gtk_widget_get_next_sibling (GTK_WIDGET (object)) != NULL, "Next sibling");
|
||||
update_go_button (iw->go_down_button,
|
||||
GTK_IS_WIDGET (object) &>k_widget_get_first_child (GTK_WIDGET (object)) != NULL,
|
||||
"First child");
|
||||
update_go_button (iw->go_previous_button,
|
||||
GTK_IS_WIDGET (object) && gtk_widget_get_prev_sibling (GTK_WIDGET (object)) != NULL,
|
||||
"Previous sibling");
|
||||
update_go_button (iw->go_next_button,
|
||||
GTK_IS_WIDGET (object) && gtk_widget_get_next_sibling (GTK_WIDGET (object)) != NULL,
|
||||
"Next sibling");
|
||||
gtk_widget_hide (iw->list_position_label);
|
||||
break;
|
||||
case CHILD_KIND_LISTITEM:
|
||||
|
@ -1738,6 +1738,10 @@ popover.background {
|
||||
box-shadow: 0 1px 2px transparentize(black, 0.7);
|
||||
}
|
||||
|
||||
&:backdrop {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
> contents {
|
||||
padding: 8px;
|
||||
border-radius: $popover_radius;
|
||||
|
@ -1,4 +1,8 @@
|
||||
window.background.csd:dir(ltr)
|
||||
stack:dir(ltr)
|
||||
box.horizontal:dir(ltr)
|
||||
box.horizontal:dir(ltr)
|
||||
box.horizontal:dir(ltr)
|
||||
headerbar.titlebar:dir(ltr)
|
||||
windowhandle:dir(ltr)
|
||||
box:dir(ltr)
|
||||
@ -15,7 +19,3 @@ window.background.csd:dir(ltr)
|
||||
button.text-button.toggle:dir(ltr)
|
||||
label:dir(ltr)
|
||||
box.end.horizontal:dir(ltr)
|
||||
stack:dir(ltr)
|
||||
box.horizontal:dir(ltr)
|
||||
box.horizontal:dir(ltr)
|
||||
box.horizontal:dir(ltr)
|
||||
|
Loading…
Reference in New Issue
Block a user