* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Mathias Hasselmann
GList *children;
- gboolean animation;
gint64 animation_start;
GSource *animation_timeout;
gint expander_size;
gint header_spacing;
- PangoEllipsizeMode ellipsize;
gulong focus_set_id;
GtkWidget *toplevel;
GtkSettings *settings;
gulong settings_connection;
+ PangoEllipsizeMode ellipsize;
+
+ guint animation : 1;
guint collapsed : 1;
};
if (old_settings)
{
g_signal_handler_disconnect (old_settings, priv->settings_connection);
+ priv->settings_connection = 0;
g_object_unref (old_settings);
}
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
if (!priv->collapsed)
state |= GTK_STATE_FLAG_ACTIVE;
y = 0;
}
- /* The expander is the only animatable region */
- gtk_style_context_push_animatable_region (context, GUINT_TO_POINTER (1));
-
gtk_render_expander (context, cr, x, y,
priv->expander_size,
priv->expander_size);
- gtk_style_context_pop_animatable_region (context);
gtk_style_context_restore (context);
return FALSE;
priv->expander_size = DEFAULT_EXPANDER_SIZE;
priv->label_widget = gtk_label_new (NULL);
- gtk_misc_set_alignment (GTK_MISC (priv->label_widget), 0.0, 0.5);
+ gtk_widget_set_halign (priv->label_widget, GTK_ALIGN_START);
+ gtk_widget_set_valign (priv->label_widget, GTK_ALIGN_CENTER);
alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
gtk_container_add (GTK_CONTAINER (alignment), priv->label_widget);
gtk_widget_show_all (alignment);
priv->toplevel = NULL;
}
+ if (priv->settings_connection > 0)
+ {
+ g_signal_handler_disconnect (priv->settings, priv->settings_connection);
+ priv->settings_connection = 0;
+ }
+
+ g_clear_object (&priv->settings);
+
G_OBJECT_CLASS (gtk_tool_item_group_parent_class)->dispose (object);
}
GtkWidget *toplevel_window;
GdkWindow *window;
GdkWindowAttr attributes;
- GdkDisplay *display;
gint attributes_mask;
guint border_width;
GtkStyleContext *context;
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);
- display = gdk_window_get_display (window);
-
- if (gdk_display_supports_composite (display))
- gdk_window_set_composited (window, TRUE);
-
- gdk_window_set_user_data (window, widget);
+ gtk_widget_register_window (widget, window);
gtk_style_context_set_background (context, window);
gint64 timestamp = gtk_tool_item_group_get_animation_timestamp (group);
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
/* Enque this early to reduce number of expose events. */
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (group));
retval = (priv->animation_timeout != NULL);
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
GTK_WIDGET (group));
if (collapsed != priv->collapsed)
{
- GtkStyleContext *context;
-
if (priv->animation)
{
if (priv->animation_timeout)
gtk_tool_item_group_animation_cb,
group, NULL);
g_source_attach (priv->animation_timeout, NULL);
-
- context = gtk_widget_get_style_context (gtk_bin_get_child (GTK_BIN (priv->header)));
-
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
-
- gtk_style_context_notify_state_change (context,
- gtk_widget_get_window (priv->header),
- GUINT_TO_POINTER (1),
- GTK_STATE_FLAG_ACTIVE,
- !collapsed);
-
- gtk_style_context_restore (context);
}
else
gtk_tool_item_group_force_expose (group);
*
* Since: 2.20
*/
-G_CONST_RETURN gchar*
+const gchar*
gtk_tool_item_group_get_label (GtkToolItemGroup *group)
{
GtkToolItemGroupPrivate *priv;