Compare commits
9 Commits
wip/matthi
...
wip/ebassi
Author | SHA1 | Date | |
---|---|---|---|
|
0ceb2cd22a | ||
|
e12cc435af | ||
|
eed5b6bdde | ||
|
1a8c8b7878 | ||
|
8eb31af813 | ||
|
f963d7d7fe | ||
|
c7e03e334d | ||
|
8e06df586f | ||
|
596ba00380 |
@@ -37,6 +37,7 @@
|
||||
#include "gtkcelleditable.h"
|
||||
#include "gtkcelllayout.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcustomlayout.h"
|
||||
#include "gtkdebug.h"
|
||||
#include "gtkdnd.h"
|
||||
#include "gtkdndprivate.h"
|
||||
@@ -164,6 +165,8 @@ struct _GtkEntryPrivate
|
||||
GtkWidget *text;
|
||||
GtkWidget *progress_widget;
|
||||
|
||||
GtkLayoutManager *layout_manager;
|
||||
|
||||
guint show_emoji_icon : 1;
|
||||
guint editing_canceled : 1; /* Only used by GtkCellRendererText */
|
||||
};
|
||||
@@ -264,10 +267,10 @@ static void gtk_entry_dispose (GObject *object);
|
||||
|
||||
/* GtkWidget methods
|
||||
*/
|
||||
static void gtk_entry_size_allocate (GtkWidget *widget,
|
||||
static void gtk_entry_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline);
|
||||
int baseline);
|
||||
static void gtk_entry_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot);
|
||||
static gboolean gtk_entry_query_tooltip (GtkWidget *widget,
|
||||
@@ -339,8 +342,6 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
gobject_class->set_property = gtk_entry_set_property;
|
||||
gobject_class->get_property = gtk_entry_get_property;
|
||||
|
||||
widget_class->measure = gtk_entry_measure;
|
||||
widget_class->size_allocate = gtk_entry_size_allocate;
|
||||
widget_class->snapshot = gtk_entry_snapshot;
|
||||
widget_class->query_tooltip = gtk_entry_query_tooltip;
|
||||
widget_class->direction_changed = gtk_entry_direction_changed;
|
||||
@@ -1275,6 +1276,9 @@ gtk_entry_init (GtkEntry *entry)
|
||||
gtk_editable_init_delegate (GTK_EDITABLE (entry));
|
||||
connect_text_signals (entry);
|
||||
|
||||
priv->layout_manager = gtk_custom_layout_new (NULL, gtk_entry_measure, gtk_entry_allocate);
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (entry), priv->layout_manager);
|
||||
|
||||
priv->editing_canceled = FALSE;
|
||||
}
|
||||
|
||||
@@ -1546,10 +1550,10 @@ gtk_entry_measure (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
gtk_entry_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkEntry *entry = GTK_ENTRY (widget);
|
||||
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
|
||||
@@ -1612,9 +1616,6 @@ gtk_entry_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_size_allocate (priv->progress_widget, &progress_alloc, -1);
|
||||
}
|
||||
|
||||
/* Do this here instead of gtk_entry_size_allocate() so it works
|
||||
* inside spinbuttons, which don't chain up.
|
||||
*/
|
||||
if (gtk_widget_get_realized (widget))
|
||||
{
|
||||
GtkEntryCompletion *completion;
|
||||
|
@@ -112,6 +112,7 @@
|
||||
|
||||
#include "gtkexpander.h"
|
||||
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkbox.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkcontainerprivate.h"
|
||||
@@ -155,6 +156,8 @@ struct _GtkExpanderPrivate
|
||||
GtkWidget *arrow_widget;
|
||||
GtkWidget *child;
|
||||
|
||||
GtkLayoutManager *layout_manager;
|
||||
|
||||
guint expand_timer;
|
||||
|
||||
guint expanded : 1;
|
||||
@@ -173,10 +176,6 @@ static void gtk_expander_get_property (GObject *object,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gtk_expander_destroy (GtkWidget *widget);
|
||||
static void gtk_expander_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline);
|
||||
static gboolean gtk_expander_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction);
|
||||
static gboolean gtk_expander_drag_motion (GtkWidget *widget,
|
||||
@@ -202,15 +201,6 @@ static void gtk_expander_buildable_add_child (GtkBuildable *buildable,
|
||||
const gchar *type);
|
||||
|
||||
|
||||
/* GtkWidget */
|
||||
static void gtk_expander_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline);
|
||||
|
||||
/* Gestures */
|
||||
static void gesture_multipress_released_cb (GtkGestureMultiPress *gesture,
|
||||
gint n_press,
|
||||
@@ -252,11 +242,9 @@ gtk_expander_class_init (GtkExpanderClass *klass)
|
||||
gobject_class->get_property = gtk_expander_get_property;
|
||||
|
||||
widget_class->destroy = gtk_expander_destroy;
|
||||
widget_class->size_allocate = gtk_expander_size_allocate;
|
||||
widget_class->focus = gtk_expander_focus;
|
||||
widget_class->drag_motion = gtk_expander_drag_motion;
|
||||
widget_class->drag_leave = gtk_expander_drag_leave;
|
||||
widget_class->measure = gtk_expander_measure;
|
||||
|
||||
container_class->add = gtk_expander_add;
|
||||
container_class->remove = gtk_expander_remove;
|
||||
@@ -349,6 +337,9 @@ gtk_expander_init (GtkExpander *expander)
|
||||
priv->expand_timer = 0;
|
||||
priv->resize_toplevel = 0;
|
||||
|
||||
priv->layout_manager = gtk_bin_layout_new ();
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (expander), priv->layout_manager);
|
||||
|
||||
priv->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_widget_set_parent (priv->box, GTK_WIDGET (expander));
|
||||
|
||||
@@ -493,21 +484,6 @@ gtk_expander_destroy (GtkWidget *widget)
|
||||
GTK_WIDGET_CLASS (gtk_expander_parent_class)->destroy (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_expander_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkExpanderPrivate *priv = gtk_expander_get_instance_private (GTK_EXPANDER (widget));
|
||||
|
||||
gtk_widget_size_allocate (priv->box,
|
||||
&(GtkAllocation) {
|
||||
0, 0,
|
||||
width, height
|
||||
}, baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gesture_multipress_released_cb (GtkGestureMultiPress *gesture,
|
||||
gint n_press,
|
||||
@@ -829,25 +805,6 @@ gtk_expander_activate (GtkExpander *expander)
|
||||
gtk_expander_set_expanded (expander, !priv->expanded);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_expander_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
GtkExpander *expander = GTK_EXPANDER (widget);
|
||||
GtkExpanderPrivate *priv = gtk_expander_get_instance_private (expander);
|
||||
|
||||
gtk_widget_measure (priv->box,
|
||||
orientation,
|
||||
for_size,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_expander_new:
|
||||
* @label: (nullable): the text of the label
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <cairo-gobject.h>
|
||||
|
||||
#include "gtkintl.h"
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkcelllayout.h"
|
||||
#include "gtkcellrenderertext.h"
|
||||
@@ -340,41 +341,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkFileChooserButton, gtk_file_chooser_button, GTK_TYPE
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER,
|
||||
gtk_file_chooser_button_file_chooser_iface_init))
|
||||
|
||||
|
||||
|
||||
static void
|
||||
gtk_file_chooser_button_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
|
||||
GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
|
||||
|
||||
gtk_widget_measure (priv->child, orientation, for_size,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_file_chooser_button_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
|
||||
GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
|
||||
|
||||
gtk_widget_size_allocate (priv->child,
|
||||
&(GtkAllocation) {
|
||||
0, 0,
|
||||
width, height
|
||||
}, baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
|
||||
{
|
||||
@@ -398,8 +364,6 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
|
||||
widget_class->display_changed = gtk_file_chooser_button_display_changed;
|
||||
widget_class->mnemonic_activate = gtk_file_chooser_button_mnemonic_activate;
|
||||
widget_class->state_flags_changed = gtk_file_chooser_button_state_flags_changed;
|
||||
widget_class->measure = gtk_file_chooser_button_measure;
|
||||
widget_class->size_allocate = gtk_file_chooser_button_size_allocate;
|
||||
|
||||
/**
|
||||
* GtkFileChooserButton::file-set:
|
||||
@@ -471,6 +435,8 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button)
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE);
|
||||
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (button), gtk_bin_layout_new ());
|
||||
|
||||
priv->button = gtk_button_new ();
|
||||
g_signal_connect (priv->button, "clicked", G_CALLBACK (button_clicked_cb), button);
|
||||
priv->image = gtk_image_new ();
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkcontainerprivate.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcustomlayout.h"
|
||||
#include "gtkimage.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtklabel.h"
|
||||
@@ -894,10 +895,10 @@ gtk_header_bar_measure (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_header_bar_size_allocate (GtkWidget *widget,
|
||||
int widget_width,
|
||||
int widget_height,
|
||||
int baseline)
|
||||
gtk_header_bar_allocate (GtkWidget *widget,
|
||||
int widget_width,
|
||||
int widget_height,
|
||||
int baseline)
|
||||
{
|
||||
GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (GTK_HEADER_BAR (widget));
|
||||
GtkWidget *title_widget;
|
||||
@@ -1711,8 +1712,6 @@ gtk_header_bar_class_init (GtkHeaderBarClass *class)
|
||||
object_class->set_property = gtk_header_bar_set_property;
|
||||
|
||||
widget_class->destroy = gtk_header_bar_destroy;
|
||||
widget_class->size_allocate = gtk_header_bar_size_allocate;
|
||||
widget_class->measure = gtk_header_bar_measure;
|
||||
widget_class->realize = gtk_header_bar_realize;
|
||||
widget_class->unrealize = gtk_header_bar_unrealize;
|
||||
widget_class->root = gtk_header_bar_root;
|
||||
@@ -1820,11 +1819,17 @@ static void
|
||||
gtk_header_bar_init (GtkHeaderBar *bar)
|
||||
{
|
||||
GtkHeaderBarPrivate *priv;
|
||||
GtkLayoutManager *manager;
|
||||
|
||||
priv = gtk_header_bar_get_instance_private (bar);
|
||||
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (bar), FALSE);
|
||||
|
||||
manager = gtk_custom_layout_new (NULL,
|
||||
gtk_header_bar_measure,
|
||||
gtk_header_bar_allocate);
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (bar), manager);
|
||||
|
||||
priv->title = NULL;
|
||||
priv->subtitle = NULL;
|
||||
priv->custom_title = NULL;
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "gtkcellrenderertext.h"
|
||||
#include "gtkcombobox.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcustomlayout.h"
|
||||
#include "gtkdnd.h"
|
||||
#include "gtkdragdest.h"
|
||||
#include "gtkdragsource.h"
|
||||
@@ -153,7 +154,7 @@ static void gtk_icon_view_measure (GtkWidget *widget,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline);
|
||||
static void gtk_icon_view_size_allocate (GtkWidget *widget,
|
||||
static void gtk_icon_view_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline);
|
||||
@@ -356,8 +357,6 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
|
||||
|
||||
widget_class->destroy = gtk_icon_view_destroy;
|
||||
widget_class->get_request_mode = gtk_icon_view_get_request_mode;
|
||||
widget_class->measure = gtk_icon_view_measure;
|
||||
widget_class->size_allocate = gtk_icon_view_size_allocate;
|
||||
widget_class->snapshot = gtk_icon_view_snapshot;
|
||||
widget_class->drag_begin = gtk_icon_view_drag_begin;
|
||||
widget_class->drag_end = gtk_icon_view_drag_end;
|
||||
@@ -917,6 +916,7 @@ static void
|
||||
gtk_icon_view_init (GtkIconView *icon_view)
|
||||
{
|
||||
GtkEventController *controller;
|
||||
GtkLayoutManager *layout;
|
||||
GtkGesture *gesture;
|
||||
|
||||
icon_view->priv = gtk_icon_view_get_instance_private (icon_view);
|
||||
@@ -977,6 +977,11 @@ gtk_icon_view_init (GtkIconView *icon_view)
|
||||
g_signal_connect (controller, "key-pressed", G_CALLBACK (gtk_icon_view_key_pressed),
|
||||
icon_view);
|
||||
gtk_widget_add_controller (GTK_WIDGET (icon_view), controller);
|
||||
|
||||
layout = gtk_custom_layout_new (gtk_icon_view_get_request_mode,
|
||||
gtk_icon_view_measure,
|
||||
gtk_icon_view_allocate);
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (icon_view), layout);
|
||||
}
|
||||
|
||||
/* GObject methods */
|
||||
@@ -1620,10 +1625,10 @@ gtk_icon_view_allocate_children (GtkIconView *icon_view)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_icon_view_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
gtk_icon_view_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "gtkmediacontrols.h"
|
||||
|
||||
#include "gtkadjustment.h"
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtklabel.h"
|
||||
@@ -166,39 +167,6 @@ play_button_clicked (GtkWidget *button,
|
||||
!gtk_media_stream_get_playing (controls->stream));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_media_controls_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
GtkMediaControls *controls = GTK_MEDIA_CONTROLS (widget);
|
||||
|
||||
gtk_widget_measure (controls->box,
|
||||
orientation,
|
||||
for_size,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_media_controls_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkMediaControls *controls = GTK_MEDIA_CONTROLS (widget);
|
||||
|
||||
gtk_widget_size_allocate (controls->box,
|
||||
&(GtkAllocation) {
|
||||
0, 0,
|
||||
width, height
|
||||
}, baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_media_controls_dispose (GObject *object)
|
||||
{
|
||||
@@ -257,9 +225,6 @@ gtk_media_controls_class_init (GtkMediaControlsClass *klass)
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
widget_class->measure = gtk_media_controls_measure;
|
||||
widget_class->size_allocate = gtk_media_controls_size_allocate;
|
||||
|
||||
gobject_class->dispose = gtk_media_controls_dispose;
|
||||
gobject_class->get_property = gtk_media_controls_get_property;
|
||||
gobject_class->set_property = gtk_media_controls_set_property;
|
||||
@@ -300,6 +265,7 @@ gtk_media_controls_init (GtkMediaControls *controls)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (controls));
|
||||
gtk_widget_set_has_surface (GTK_WIDGET (controls), FALSE);
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (controls), gtk_bin_layout_new ());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "gtksearchbar.h"
|
||||
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkbutton.h"
|
||||
#include "gtkcenterbox.h"
|
||||
#include "gtkentryprivate.h"
|
||||
@@ -249,37 +250,6 @@ gtk_search_bar_dispose (GObject *object)
|
||||
G_OBJECT_CLASS (gtk_search_bar_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_search_bar_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
GtkSearchBar *bar = GTK_SEARCH_BAR (widget);
|
||||
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
|
||||
|
||||
gtk_widget_measure (priv->revealer, orientation, for_size, minimum, natural, minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_search_bar_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkSearchBar *bar = GTK_SEARCH_BAR (widget);
|
||||
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
|
||||
|
||||
gtk_widget_size_allocate (priv->revealer,
|
||||
&(GtkAllocation) {
|
||||
0, 0,
|
||||
width, height
|
||||
}, baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_search_bar_class_init (GtkSearchBarClass *klass)
|
||||
{
|
||||
@@ -291,9 +261,6 @@ gtk_search_bar_class_init (GtkSearchBarClass *klass)
|
||||
object_class->set_property = gtk_search_bar_set_property;
|
||||
object_class->get_property = gtk_search_bar_get_property;
|
||||
|
||||
widget_class->measure = gtk_search_bar_measure;
|
||||
widget_class->size_allocate = gtk_search_bar_size_allocate;
|
||||
|
||||
container_class->add = gtk_search_bar_add;
|
||||
container_class->remove = gtk_search_bar_remove;
|
||||
|
||||
@@ -331,6 +298,8 @@ gtk_search_bar_init (GtkSearchBar *bar)
|
||||
{
|
||||
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
|
||||
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (bar), gtk_bin_layout_new ());
|
||||
|
||||
priv->revealer = gtk_revealer_new ();
|
||||
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->revealer), FALSE);
|
||||
gtk_widget_set_hexpand (priv->revealer, TRUE);
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include "gtkbox.h"
|
||||
#include "gtkcontainerprivate.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcustomlayout.h"
|
||||
#include "gtkimage.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtklabel.h"
|
||||
@@ -124,6 +125,8 @@ struct _GtkToolbarPrivate
|
||||
|
||||
GTimer *timer;
|
||||
|
||||
GtkLayoutManager *layout_manager;
|
||||
|
||||
gulong settings_connection;
|
||||
|
||||
gint idle_id;
|
||||
@@ -177,7 +180,7 @@ static void gtk_toolbar_get_property (GObject *object,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_toolbar_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot);
|
||||
static void gtk_toolbar_size_allocate (GtkWidget *widget,
|
||||
static void gtk_toolbar_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline);
|
||||
@@ -348,8 +351,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
|
||||
gobject_class->dispose = gtk_toolbar_dispose;
|
||||
|
||||
widget_class->snapshot = gtk_toolbar_snapshot;
|
||||
widget_class->measure = gtk_toolbar_measure;
|
||||
widget_class->size_allocate = gtk_toolbar_size_allocate;
|
||||
widget_class->style_updated = gtk_toolbar_style_updated;
|
||||
widget_class->focus = gtk_toolbar_focus;
|
||||
|
||||
@@ -558,6 +559,9 @@ gtk_toolbar_init (GtkToolbar *toolbar)
|
||||
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_toolbar_pressed_cb), toolbar);
|
||||
gtk_widget_add_controller (GTK_WIDGET (toolbar), GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
priv->layout_manager = gtk_custom_layout_new (NULL, gtk_toolbar_measure, gtk_toolbar_allocate);
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (toolbar), priv->layout_manager);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1160,10 +1164,10 @@ rebuild_menu (GtkToolbar *toolbar)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toolbar_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
gtk_toolbar_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
|
||||
GtkToolbarPrivate *priv = toolbar->priv;
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "gtkviewport.h"
|
||||
|
||||
#include "gtkadjustment.h"
|
||||
#include "gtkcustomlayout.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
@@ -94,7 +95,7 @@ static void gtk_viewport_get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_viewport_destroy (GtkWidget *widget);
|
||||
static void gtk_viewport_size_allocate (GtkWidget *widget,
|
||||
static void gtk_viewport_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline);
|
||||
@@ -230,8 +231,6 @@ gtk_viewport_class_init (GtkViewportClass *class)
|
||||
gobject_class->get_property = gtk_viewport_get_property;
|
||||
|
||||
widget_class->destroy = gtk_viewport_destroy;
|
||||
widget_class->size_allocate = gtk_viewport_size_allocate;
|
||||
widget_class->measure = gtk_viewport_measure;
|
||||
|
||||
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_VIEWPORT);
|
||||
|
||||
@@ -330,14 +329,20 @@ gtk_viewport_get_property (GObject *object,
|
||||
static void
|
||||
gtk_viewport_init (GtkViewport *viewport)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkViewportPrivate *priv = gtk_viewport_get_instance_private (viewport);
|
||||
GtkLayoutManager *manager;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = GTK_WIDGET (viewport);
|
||||
|
||||
gtk_widget_set_has_surface (widget, FALSE);
|
||||
gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
|
||||
|
||||
manager = gtk_custom_layout_new (NULL,
|
||||
gtk_viewport_measure,
|
||||
gtk_viewport_allocate);
|
||||
gtk_widget_set_layout_manager (widget, manager);
|
||||
|
||||
priv->shadow_type = GTK_SHADOW_IN;
|
||||
priv->hadjustment = NULL;
|
||||
priv->vadjustment = NULL;
|
||||
@@ -485,10 +490,10 @@ gtk_viewport_get_shadow_type (GtkViewport *viewport)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
gtk_viewport_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkViewport *viewport = GTK_VIEWPORT (widget);
|
||||
GtkViewportPrivate *priv = gtk_viewport_get_instance_private (viewport);
|
||||
|
Reference in New Issue
Block a user