Пример #1
0
static void
reload_font ()
{
  GList *para_list;

  pango_context_set_font_description (context, font_description);

  para_list = paragraphs;
  while (para_list)
    {
      Paragraph *para = para_list->data;

      pango_layout_context_changed (para->layout);
      para_list = para_list->next;
    }

  if (layout)
    gtk_widget_queue_resize (layout);
}
Пример #2
0
void
render_all(zathura_t* zathura)
{
  if (zathura == NULL || zathura->document == NULL) {
    return;
  }

  /* unmark all pages */
  unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document);
  for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) {
    zathura_page_t* page = zathura_document_get_page(zathura->document, page_id);
    unsigned int page_height = 0, page_width = 0;
    page_calc_height_width(page, &page_height, &page_width, true);

    GtkWidget* widget = zathura_page_get_widget(zathura, page);
    gtk_widget_set_size_request(widget, page_width, page_height);
    gtk_widget_queue_resize(widget);
  }
}
Пример #3
0
static void
lyric_show_viewport_update_current_widget(LyricShowViewport *lsv)
{
    if((!lsv->priv->is_pressed) && lsv->priv->current_widget)
    {
        GtkAllocation alc0,alc1;
        const gchar *color_string = "blue";

#if GTK_CHECK_VERSION(3,2,0)
        GdkRGBA color = {0};
        gdk_rgba_parse(&color,color_string);
#else
        GdkColor color = {0};
        gdk_color_parse(color_string,&color);
#endif

        if(lsv->priv->pre_widget &&
            GTK_IS_WIDGET(lsv->priv->pre_widget) &&
            lsv->priv->current_widget !=lsv->priv->pre_widget)
        {
#if GTK_CHECK_VERSION(3,2,0)
            gtk_widget_override_color(lsv->priv->pre_widget,GTK_STATE_FLAG_ACTIVE,NULL);
            gtk_widget_set_state_flags(lsv->priv->pre_widget,GTK_STATE_FLAG_ACTIVE,FALSE);
#else
            gtk_widget_modify_fg(lsv->priv->pre_widget,GTK_STATE_ACTIVE,NULL);
            gtk_widget_set_state(lsv->priv->pre_widget,GTK_STATE_NORMAL);
#endif
        }

#if GTK_CHECK_VERSION(3,2,0)
        gtk_widget_override_color(lsv->priv->current_widget,GTK_STATE_FLAG_ACTIVE,&color);
        gtk_widget_set_state_flags(lsv->priv->current_widget,GTK_STATE_FLAG_ACTIVE,FALSE);
#else
        gtk_widget_modify_fg(lsv->priv->current_widget,GTK_STATE_ACTIVE,&color);
        gtk_widget_set_state(lsv->priv->current_widget,GTK_STATE_ACTIVE);
#endif

        gtk_widget_get_allocation(lsv->priv->current_widget,&alc0);
        gtk_widget_get_allocation(lsv->priv->lyricbox,&alc1);
        lsv->priv->pos = (alc0.y - alc1.y)+alc0.height/2.0;
        gtk_widget_queue_resize(GTK_WIDGET(lsv));
    }
}
Пример #4
0
/**
 * gtk_tool_item_toolbar_reconfigured:
 * @tool_item: a #GtkToolItem
 *
 * Emits the signal #GtkToolItem::toolbar_reconfigured on @tool_item.
 * #GtkToolbar and other #GtkToolShell implementations use this function
 * to notify children, when some aspect of their configuration changes.
 *
 * Since: 2.14
 **/
void
gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item)
{
    /* The slightely inaccurate name "gtk_tool_item_toolbar_reconfigured" was
     * choosen over "gtk_tool_item_tool_shell_reconfigured", since the function
     * emits the "toolbar-reconfigured" signal, not "tool-shell-reconfigured".
     * Its not possible to rename the signal, and emitting another name than
     * indicated by the function name would be quite confusing. That's the
     * price of providing stable APIs.
     */
    g_return_if_fail (GTK_IS_TOOL_ITEM (tool_item));

    g_signal_emit (tool_item, toolitem_signals[TOOLBAR_RECONFIGURED], 0);

    if (tool_item->priv->drag_window)
        gdk_window_raise (tool_item->priv->drag_window);

    gtk_widget_queue_resize (GTK_WIDGET (tool_item));
}
Пример #5
0
static void
gtk_mirror_bin_remove (GtkContainer *container,
                        GtkWidget    *widget)
{
  GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
  gboolean was_visible;

  was_visible = gtk_widget_get_visible (widget);

  if (bin->child == widget)
    {
      gtk_widget_unparent (widget);

      bin->child = NULL;

      if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
        gtk_widget_queue_resize (GTK_WIDGET (container));
    }
}
Пример #6
0
/**
 * gtk_level_bar_set_inverted:
 * @self: a #GtkLevelBar
 * @inverted: %TRUE to invert the level bar
 *
 * Sets the value of the #GtkLevelBar:inverted property.
 *
 * Since: 3.8
 */
void
gtk_level_bar_set_inverted (GtkLevelBar *self,
                            gboolean     inverted)
{
  GtkLevelBarPrivate *priv;

  g_return_if_fail (GTK_IS_LEVEL_BAR (self));

  priv = self->priv;

  if (priv->inverted != inverted)
    {
      priv->inverted = inverted;

      gtk_widget_queue_resize (GTK_WIDGET (self));

      g_object_notify (G_OBJECT (self), "inverted");
    }
}
Пример #7
0
void gmpc_widgets_qtable_add_header (GmpcWidgetsQtable* self, GtkWidget* widget) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	if (widget != NULL) {
		QtableEntry* _tmp0_ = NULL;
		QtableEntry* a;
		QtableEntry* _tmp1_;
		_tmp0_ = qtable_entry_new ();
		a = _tmp0_;
		a->type = QTABLE_ENTRY_TYPE_HEADER;
		a->widget = widget;
		_tmp1_ = _qtable_entry_ref0 (a);
		self->priv->children = g_list_append (self->priv->children, _tmp1_);
		gtk_widget_set_parent (widget, (GtkWidget*) self);
		self->priv->num_items++;
		gtk_widget_queue_resize ((GtkWidget*) self);
		_qtable_entry_unref0 (a);
	}
}
Пример #8
0
void
games_grid_frame_set_alignment (GamesGridFrame * frame, gfloat xalign,
				gfloat yalign)
{
  if (xalign < 0.0)
    xalign = 0.0;
  else if (xalign > 1.0)
    xalign = 1.0;

  if (yalign < 0.0)
    yalign = 0.0;
  else if (yalign > 1.0)
    yalign = 1.0;

  frame->priv->xalign = xalign;
  frame->priv->yalign = yalign;

  gtk_widget_queue_resize (GTK_WIDGET (frame));
}
Пример #9
0
/* Change the geometry of an icon grid. */
void panel_icon_grid_set_geometry(PanelIconGrid * ig,
    GtkOrientation orientation, gint child_width, gint child_height, gint spacing, gint border, gint target_dimension)
{
    g_return_if_fail(PANEL_IS_ICON_GRID(ig));

    gtk_container_set_border_width(GTK_CONTAINER(ig), border);

    if (ig->orientation == orientation && ig->child_width == child_width &&
            ig->child_height == child_height && ig->spacing == spacing &&
            ig->target_dimension == target_dimension)
        return;

    ig->orientation = orientation;
    ig->child_width = child_width;
    ig->child_height = child_height;
    ig->spacing = spacing;
    ig->target_dimension = target_dimension;
    gtk_widget_queue_resize(GTK_WIDGET(ig));
}
/**
 * eel_gtk_container_child_remove:
 *
 * @container: A GtkContainer widget.
 * @child: A non NULL child of @container.
 *
 * Remove @child from @container.  The @container is resized if needed.
 * This is usually called from the "GtkContainer::remove" method of the
 * @container.  The child cannot be NULL.
 */
void
eel_gtk_container_child_remove (GtkContainer *container,
                                GtkWidget *child)
{
    gboolean child_was_visible;

    g_return_if_fail (GTK_IS_CONTAINER (container));
    g_return_if_fail (GTK_IS_WIDGET (child));
    g_return_if_fail (gtk_widget_get_parent (child) == GTK_WIDGET (container));

    child_was_visible = gtk_widget_get_visible (child);

    gtk_widget_unparent (child);

    if (child_was_visible)
    {
        gtk_widget_queue_resize (GTK_WIDGET (container));
    }
}
Пример #11
0
static void
avatar_image_real_set_pixbuf (GiggleAvatarImage *image,
			      GdkPixbuf         *pixbuf)
{
	GiggleAvatarImagePriv *priv = GET_PRIV (image);

	if (pixbuf == priv->pixbuf)
		return;

	if (priv->pixbuf) {
		g_object_unref (priv->pixbuf);
		priv->pixbuf = NULL;
	}

	if (pixbuf)
		priv->pixbuf = g_object_ref (pixbuf);

	gtk_widget_queue_resize (GTK_WIDGET (image));
}
Пример #12
0
static void
cv_tabs_rename (chan *ch, char *name)
{
    PangoAttrList *attr;
    GtkWidget *tab = ch->impl;

    attr = gtk_label_get_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (tab))));
    if (attr)
        pango_attr_list_ref (attr);

    gtk_button_set_label (GTK_BUTTON (tab), name);
    gtk_widget_queue_resize (gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(tab))));

    if (attr)
    {
        gtk_label_set_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (tab))), attr);
        pango_attr_list_unref (attr);
    }
}
Пример #13
0
/**
 * gtk_expander_set_label_widget:
 * @expander: a #GtkExpander
 * @label_widget: (allow-none): the new label widget
 *
 * Set the label widget for the expander. This is the widget
 * that will appear embedded alongside the expander arrow.
 *
 * Since: 2.4
 **/
void
gtk_expander_set_label_widget (GtkExpander *expander,
			       GtkWidget   *label_widget)
{
  GtkExpanderPrivate *priv;
  GtkWidget          *widget;

  g_return_if_fail (GTK_IS_EXPANDER (expander));
  g_return_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget));
  g_return_if_fail (label_widget == NULL || label_widget->parent == NULL);

  priv = expander->priv;

  if (priv->label_widget == label_widget)
    return;

  if (priv->label_widget)
    {
      gtk_widget_set_state (priv->label_widget, GTK_STATE_NORMAL);
      gtk_widget_unparent (priv->label_widget);
    }

  priv->label_widget = label_widget;
  widget = GTK_WIDGET (expander);

  if (label_widget)
    {
      priv->label_widget = label_widget;

      gtk_widget_set_parent (label_widget, widget);

      if (priv->prelight)
	gtk_widget_set_state (label_widget, GTK_STATE_PRELIGHT);
    }

  if (gtk_widget_get_visible (widget))
    gtk_widget_queue_resize (widget);

  g_object_freeze_notify (G_OBJECT (expander));
  g_object_notify (G_OBJECT (expander), "label-widget");
  g_object_notify (G_OBJECT (expander), "label");
  g_object_thaw_notify (G_OBJECT (expander));
}
Пример #14
0
void
gd_tagged_entry_tag_set_style (GdTaggedEntryTag *tag,
                               const gchar *style)
{
    g_return_if_fail (GD_IS_TAGGED_ENTRY_TAG (tag));

    if (g_strcmp0 (tag->style, style) != 0)
    {
        GtkWidget *entry;

        g_free (tag->style);
        tag->style = g_strdup (style);
        g_clear_object (&tag->layout);

        entry = GTK_WIDGET (tag->entry);
        if (entry)
            gtk_widget_queue_resize (entry);
    }
}
Пример #15
0
void
gd_tagged_entry_tag_set_has_close_button (GdTaggedEntryTag *tag,
        gboolean has_close_button)
{
    g_return_if_fail (GD_IS_TAGGED_ENTRY_TAG (tag));

    has_close_button = has_close_button != FALSE;
    if (tag->has_close_button != has_close_button)
    {
        GtkWidget *entry;

        tag->has_close_button = has_close_button;
        g_clear_object (&tag->layout);

        entry = GTK_WIDGET (tag->entry);
        if (entry)
            gtk_widget_queue_resize (entry);
    }
}
Пример #16
0
void columns_force_same_height(Columns *cols, GtkWidget *cw1, GtkWidget *cw2)
{
  ColumnsChild *child1, *child2;

  g_return_if_fail(cols != NULL);
  g_return_if_fail(IS_COLUMNS(cols));
  g_return_if_fail(cw1 != NULL);
  g_return_if_fail(cw2 != NULL);

  child1 = columns_find_child(cols, cw1);
  g_return_if_fail(child1 != NULL);
  child2 = columns_find_child(cols, cw2);
  g_return_if_fail(child2 != NULL);

  child1->same_height_as = child2;
  child2->same_height_as = child1;
  if (gtk_widget_get_visible(cw1) || gtk_widget_get_visible(cw2))
    gtk_widget_queue_resize(GTK_WIDGET(cols));
}
Пример #17
0
void
panel_multiscreen_reinit (void)
{
	GdkDisplay *display;
	GList      *toplevels, *l;
	int         new_screens;
	int         i;

	if (monitors)
		g_free (monitors);

	if (geometries) {
		int j;

		for (j = 0; j < screens; j++)
			g_free (geometries[j]);
		g_free (geometries);
	}

	display = gdk_display_get_default ();
	/* Don't use the screens variable since in the future, we might
	 * want to call this function when a screen appears/disappears. */
	new_screens = gdk_display_get_n_screens (display);

	for (i = 0; i < new_screens; i++) {
		GdkScreen *screen;

		screen = gdk_display_get_screen (display, i);
		g_signal_handlers_disconnect_by_func (screen,
						      panel_multiscreen_queue_reinit,
						      NULL);
	}

	initialized = FALSE;
	panel_multiscreen_init ();

	toplevels = gtk_window_list_toplevels ();

	for (l = toplevels; l; l = l->next)
		gtk_widget_queue_resize (l->data);

	g_list_free (toplevels);
}
Пример #18
0
void
gtk_pizza_set_size (GtkPizza   *pizza,
                    GtkWidget  *widget,
                    gint        x,
                    gint        y,
                    gint        width,
                    gint        height)
{
    GtkPizzaChild *child;
    GList *children;

    g_return_if_fail (pizza != NULL);
    g_return_if_fail (GTK_IS_PIZZA (pizza));
    g_return_if_fail (widget != NULL);

    children = pizza->children;
    while (children)
    {
        child = children->data;
        children = children->next;

        if (child->widget == widget)
        {
            if ((child->x == x) &&
                (child->y == y) &&
                (child->width == width) &&
                (child->height == height)) return;

            child->x = x;
            child->y = y;
            child->width = width;
            child->height = height;

            gtk_widget_set_usize (widget, width, height);

            if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza))
                gtk_widget_queue_resize (widget);

            return;
        }
    }
}
Пример #19
0
void
gtk_icon_helper_invalidate_for_change (GtkIconHelper     *self,
                                       GtkCssStyleChange *change)
{
  if (change == NULL ||
      ((gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SYMBOLIC_ICON) &&
        self->texture_is_symbolic) ||
       (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_ICON) &&
        !self->texture_is_symbolic)))
    {
      /* Avoid the queue_resize in gtk_icon_helper_invalidate */
      g_clear_object (&self->paintable);
      self->texture_is_symbolic = FALSE;

      if (change == NULL ||
          (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_ICON_SIZE) &&
          !GTK_IS_CSS_TRANSIENT_NODE (self->node)))
        gtk_widget_queue_resize (self->owner);
    }
}
Пример #20
0
/**
 * Hides the rulers and resets the flag ddisp->rulers_are_showing.  This
 * is needed to detect whether a hide() has been issued.  There is a 
 * delay between the time that gtk_widget_hide() is called and the time
 * when GTK_WIDGET_IS_VISIBLE(w) will indicate false.
 * @param ddisp The display to hide the rulers on.
 */
void display_rulers_hide (DDisplay *ddisp)
{
  if (ddisp)
  {
    GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (ddisp->origin));

    gtk_widget_hide (ddisp->origin);
    gtk_widget_hide (ddisp->hrule);
    gtk_widget_hide (ddisp->vrule);
    
#if GTK_CHECK_VERSION(2,20,0)
    if (gtk_widget_get_visible (parent))
#else
    if (GTK_WIDGET_VISIBLE (parent))
#endif
      gtk_widget_queue_resize (parent);

    ddisp->rulers_are_showing = FALSE;
  }
}
Пример #21
0
static void gmpc_widgets_qtable_real_add (GtkContainer* base, GtkWidget* widget) {
	GmpcWidgetsQtable * self;
	self = (GmpcWidgetsQtable*) base;
	g_return_if_fail (widget != NULL);
	if (widget != NULL) {
		QtableEntry* _tmp0_ = NULL;
		QtableEntry* a;
		QtableEntry* _tmp1_;
		_tmp0_ = qtable_entry_new ();
		a = _tmp0_;
		a->type = QTABLE_ENTRY_TYPE_ITEM;
		a->widget = widget;
		_tmp1_ = _qtable_entry_ref0 (a);
		self->priv->children = g_list_append (self->priv->children, _tmp1_);
		gtk_widget_set_parent (widget, (GtkWidget*) self);
		self->priv->num_items++;
		gtk_widget_queue_resize ((GtkWidget*) self);
		_qtable_entry_unref0 (a);
	}
}
Пример #22
0
static void
gth_empty_list_set_property (GObject      *object,
			     guint         property_id,
			     const GValue *value,
			     GParamSpec   *pspec)
{
	GthEmptyList *self;

        self = GTH_EMPTY_LIST (object);

	switch (property_id) {
	case PROP_TEXT:
		g_free (self->priv->text);
		self->priv->text = g_value_dup_string (value);
		gtk_widget_queue_resize (GTK_WIDGET (self));
		break;
	default:
		break;
	}
}
Пример #23
0
static void
widget_overlay_remove (GtkContainer *container, GtkWidget *widget)
{
	WidgetOverlay *ovl = WIDGET_OVERLAY (container);
	gboolean was_visible;

	was_visible = gtk_widget_get_visible (widget);
	GList *list;
	for (list = ovl->priv->children; list; list = list->next) {
		ChildData *cd = (ChildData*) list->data;
		if (cd->child == widget) {
			gtk_widget_unparent (widget);
			ovl->priv->children = g_list_remove (ovl->priv->children, cd);
			g_free (cd);
			if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
				gtk_widget_queue_resize (GTK_WIDGET (container));
			break;
		}
	}
}
Пример #24
0
void panels_add(Panels *panels, GtkWidget *child)
{
    g_return_if_fail(panels != NULL);
    g_return_if_fail(IS_PANELS(panels));
    g_return_if_fail(child != NULL);
    g_return_if_fail(child->parent == NULL);

    panels->children = g_list_append(panels->children, child);

    gtk_widget_set_parent(child, GTK_WIDGET(panels));

    if (GTK_WIDGET_REALIZED(panels))
        gtk_widget_realize(child);

    if (GTK_WIDGET_VISIBLE(panels)) {
        if (GTK_WIDGET_MAPPED(panels))
            gtk_widget_map(child);
        gtk_widget_queue_resize(child);
    }
}
Пример #25
0
/* GConf callback for changes in maximum_size */
static void
maximum_size_changed (GConfClient  *client, guint cnxn_id,
                      GConfEntry   *entry, TasklistData *tasklist)
{
	gint value;
	GtkSpinButton *button;

	if (!tasklist->maximum_size_spin)
		return;

	button = GTK_SPIN_BUTTON (tasklist->maximum_size_spin);
	if (!entry->value || entry->value->type != GCONF_VALUE_INT)
		return;
	
	value = gconf_value_get_int (entry->value);

	gtk_spin_button_set_value (button, value);
	tasklist->maximum_size = value;
        gtk_widget_queue_resize (GTK_WIDGET (tasklist->applet));
}
Пример #26
0
static void
sexy_icon_entry_realize(GtkWidget *widget)
{
	SexyIconEntry *entry = SEXY_ICON_ENTRY(widget);
	GdkWindowAttr attributes;
	gint attributes_mask;
	int i;

	GTK_WIDGET_CLASS(parent_class)->realize(widget);

	attributes.x = 0;
	attributes.y = 0;
	attributes.width = 1;
	attributes.height = 1;
	attributes.window_type = GDK_WINDOW_CHILD;
	attributes.wclass = GDK_INPUT_OUTPUT;
	attributes.visual = gtk_widget_get_visual(widget);
	attributes.colormap = gtk_widget_get_colormap(widget);
	attributes.event_mask = gtk_widget_get_events(widget);
	attributes.event_mask |=
		(GDK_EXPOSURE_MASK
		 | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
		 | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);

	attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;

	for (i = 0; i < MAX_ICONS; i++)
	{
		SexyIconInfo *icon_info;

		icon_info = &entry->priv->icons[i];
		icon_info->window = gdk_window_new(widget->window, &attributes,
										   attributes_mask);
		gdk_window_set_user_data(icon_info->window, widget);

		gdk_window_set_background(icon_info->window,
			&widget->style->base[GTK_WIDGET_STATE(widget)]);
	}

	gtk_widget_queue_resize(widget);
}
Пример #27
0
static void columns_remove(GtkContainer *container, GtkWidget *widget)
{
    Columns *cols;
    ColumnsChild *child;
    GtkWidget *childw;
    GList *children;
    gboolean was_visible;

    g_return_if_fail(container != NULL);
    g_return_if_fail(IS_COLUMNS(container));
    g_return_if_fail(widget != NULL);

    cols = COLUMNS(container);

    for (children = cols->children;
         children && (child = children->data);
         children = children->next) {
        if (child->widget != widget)
            continue;

        was_visible = GTK_WIDGET_VISIBLE(widget);
        gtk_widget_unparent(widget);
        cols->children = g_list_remove_link(cols->children, children);
        g_list_free(children);
        g_free(child);
        if (was_visible)
            gtk_widget_queue_resize(GTK_WIDGET(container));
        break;
    }

    for (children = cols->taborder;
         children && (childw = children->data);
         children = children->next) {
        if (childw != widget)
            continue;

        cols->taborder = g_list_remove_link(cols->taborder, children);
        g_list_free(children);
        break;
    }
}
Пример #28
0
/*
 * Sets the properties of the widget. This is used for both applying the
 * properties changed in the property editor, and also for loading.
 */
static void
gb_vbutton_box_set_properties (GtkWidget * widget, GbWidgetSetArgData * data)
{
  gint size, i, spacing;
  gchar *layout;
  gboolean queue_resize = FALSE;

  if (data->action != GB_LOADING)
    {
      size = gb_widget_input_int (data, Size);
      if (data->apply)
	gb_box_set_size (widget, size);
    }

  layout = gb_widget_input_choice (data, Layout);
  if (data->apply)
    {
      for (i = 0; i < sizeof (GbLayoutValues) / sizeof (GbLayoutValues[0]); i
	   ++)
	{
	  if (!strcmp (layout, GbLayoutChoices[i])
	      || !strcmp (layout, GbLayoutSymbols[i]))
	    {
	      gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GbLayoutValues
					 [i]);
	      queue_resize = TRUE;
	      break;
	    }
	}
    }

  spacing = gb_widget_input_int (data, Spacing);
  if (data->apply)
    {
      gtk_box_set_spacing (GTK_BOX (widget), spacing);
      queue_resize = TRUE;
    }

  if (queue_resize)
    gtk_widget_queue_resize (widget);
}
Пример #29
0
void columns_force_left_align(Columns *cols, GtkWidget *widget)
{
    ColumnsChild *child;
    GList *children;

    g_return_if_fail(cols != NULL);
    g_return_if_fail(IS_COLUMNS(cols));
    g_return_if_fail(widget != NULL);

    for (children = cols->children;
         children && (child = children->data);
         children = children->next) {
        if (child->widget != widget)
            continue;

	child->force_left = TRUE;
        if (GTK_WIDGET_VISIBLE(widget))
            gtk_widget_queue_resize(GTK_WIDGET(cols));
        break;
    }
}
Пример #30
0
static void
gb_slider_child_set_position (GbSlider         *self,
                              GtkWidget        *widget,
                              GbSliderPosition  position)
{
  GbSliderChild *child;

  g_assert (GB_IS_SLIDER (self));
  g_assert (GTK_IS_WIDGET (widget));
  g_assert (position >= GB_SLIDER_NONE);
  g_assert (position <= GB_SLIDER_LEFT);

  child = gb_slider_get_child (self, widget);

  if (position != child->position)
    {
      child->position = position;
      gtk_container_child_notify (GTK_CONTAINER (self), widget, "position");
      gtk_widget_queue_resize (GTK_WIDGET (self));
    }
}