Commit 948e077f authored by Matthias Clasen's avatar Matthias Clasen

tool button: Add element names for tool item subclasses

Add the obvious names to the CSS nodes of GtkRadioToolButton,
GtkToggleToolButton and GtkSeparatorToolItem.
parent ec60bd88
...@@ -35,10 +35,13 @@ ...@@ -35,10 +35,13 @@
* that is, a button that is part of a group of toggle buttons where only * that is, a button that is part of a group of toggle buttons where only
* one button can be active at a time. * one button can be active at a time.
* *
* Use gtk_radio_tool_button_new() to create a new * Use gtk_radio_tool_button_new() to create a new GtkRadioToolButton. Use
* #GtkRadioToolButton. Use gtk_radio_tool_button_new_from_widget() to * gtk_radio_tool_button_new_from_widget() to create a new GtkRadioToolButton
* create a new #GtkRadioToolButton that is part of the same group as an * that is part of the same group as an existing GtkRadioToolButton.
* existing #GtkRadioToolButton. *
* # CSS nodes
*
* GtkRadioToolButton has a single CSS node with name toolbutton.
*/ */
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
* a “spring” that forces other items to the ends of the toolbar. * a “spring” that forces other items to the ends of the toolbar.
* *
* Use gtk_separator_tool_item_new() to create a new #GtkSeparatorToolItem. * Use gtk_separator_tool_item_new() to create a new #GtkSeparatorToolItem.
*
* # CSS nodes
*
* GtkSeparatorToolItem has a single CSS node with name separator.
*/ */
#define MENU_ID "gtk-separator-tool-item-menu-id" #define MENU_ID "gtk-separator-tool-item-menu-id"
...@@ -145,20 +149,17 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class) ...@@ -145,20 +149,17 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
P_("Whether the separator is drawn, or just blank"), P_("Whether the separator is drawn, or just blank"),
TRUE, TRUE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
gtk_widget_class_set_css_name (widget_class, "separator");
} }
static void static void
gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item) gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
{ {
GtkStyleContext *context;
separator_item->priv = gtk_separator_tool_item_get_instance_private (separator_item); separator_item->priv = gtk_separator_tool_item_get_instance_private (separator_item);
separator_item->priv->draw = TRUE; separator_item->priv->draw = TRUE;
gtk_widget_set_has_window (GTK_WIDGET (separator_item), FALSE); gtk_widget_set_has_window (GTK_WIDGET (separator_item), FALSE);
context = gtk_widget_get_style_context (GTK_WIDGET (separator_item));
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
} }
static void static void
...@@ -173,7 +174,7 @@ gtk_separator_tool_item_create_menu_proxy (GtkToolItem *item) ...@@ -173,7 +174,7 @@ gtk_separator_tool_item_create_menu_proxy (GtkToolItem *item)
{ {
GtkWidget *menu_item = NULL; GtkWidget *menu_item = NULL;
menu_item = gtk_separator_menu_item_new(); menu_item = gtk_separator_menu_item_new ();
gtk_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item); gtk_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item);
......
...@@ -39,8 +39,11 @@ ...@@ -39,8 +39,11 @@
* A #GtkToggleToolButton is a #GtkToolItem that contains a toggle * A #GtkToggleToolButton is a #GtkToolItem that contains a toggle
* button. * button.
* *
* Use gtk_toggle_tool_button_new() to create a new * Use gtk_toggle_tool_button_new() to create a new GtkToggleToolButton.
* #GtkToggleToolButton. *
* # CSS nodes
*
* GtkToggleToolButton has a single CSS node with name togglebutton.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment