Пример #1
0
static GObject *
eog_thumb_nav_constructor (GType                  type,
                           guint                  n_construct_properties,
                           GObjectConstructParam *construct_params)
{
  GObject            *object;
  EogThumbNavPrivate *priv;

  object = G_OBJECT_CLASS (eog_thumb_nav_parent_class)->constructor
             (type, n_construct_properties, construct_params);

  priv = EOG_THUMB_NAV_GET_PRIVATE (object);

  if (priv->thumbview != NULL)
  {
    gtk_container_add (GTK_CONTAINER (priv->sw), priv->thumbview);
    gtk_widget_show_all (priv->sw);
  }

  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
                                  GTK_POLICY_AUTOMATIC,
                                  GTK_POLICY_NEVER);

  return object;
}
Пример #2
0
static void
eog_thumb_nav_adj_changed (GtkAdjustment *adj, gpointer user_data)
{
	EogThumbNav *nav;
	EogThumbNavPrivate *priv;
	gboolean ltr;

	nav = EOG_THUMB_NAV (user_data);
	priv = EOG_THUMB_NAV_GET_PRIVATE (nav);
	ltr = gtk_widget_get_direction (priv->sw) == GTK_TEXT_DIR_LTR;

	gtk_widget_set_sensitive (ltr ? priv->button_right : priv->button_left,
				  gtk_adjustment_get_value (adj)
				   < gtk_adjustment_get_upper (adj)
				    - gtk_adjustment_get_page_size (adj));
}
Пример #3
0
static void
eog_thumb_nav_vadj_changed (GtkAdjustment *vadj, gpointer user_data)
{
  EogThumbNav        *nav;
  EogThumbNavPrivate *priv;
  gdouble             value, upper, page_size;

  nav  = EOG_THUMB_NAV (user_data);
  priv = EOG_THUMB_NAV_GET_PRIVATE (nav);

  g_object_get (vadj,
                "value", &value,
                "upper", &upper,
                "page_size", &page_size,
                NULL);
  gtk_widget_set_sensitive (priv->button_up, value > 0);

  gtk_widget_set_sensitive (priv->button_down,
                            value < upper - page_size);
}
Пример #4
0
static void
eog_thumb_nav_hadj_changed (GtkAdjustment *hadj, gpointer user_data)
{
  EogThumbNav        *nav;
  EogThumbNavPrivate *priv;
  gboolean            ltr;
  gdouble             value, upper, page_size;

  nav  = EOG_THUMB_NAV (user_data);
  priv = EOG_THUMB_NAV_GET_PRIVATE (nav);
  ltr  = gtk_widget_get_direction (priv->sw) == GTK_TEXT_DIR_LTR;

  g_object_get (hadj,
                "value", &value,
                "upper", &upper,
                "page_size", &page_size,
                NULL);

  gtk_widget_set_sensitive (ltr ? priv->button_right : priv->button_left,
                            value < upper - page_size);
}