when_filled_callback *whenfilled; /**< @brief called when filled or 0 */
void *wfu; /**< @brief passed to @c whenfilled */
+ int ymin; /**< @brief least Y value */
+ int ymax; /**< @brief greatest Y value */
};
/** @brief One item in the popup menu */
/* Variables */
static GtkWidget *chooselayout;
+static GtkAdjustment *vadjust;
static GtkWidget *searchentry; /**< @brief search terms */
static struct choosenode *root;
static GtkWidget *track_menu; /**< @brief track popup menu */
/* This is an actual search result */
++nsearchvisible;
progress_window_progress(spw, nsearchvisible, nsearchresults);
+ if(nsearchvisible == nsearchresults)
+ /* This is the last track to become visible, we'll make sure it's in
+ * range so that at least one is. */
+ gtk_adjustment_clamp_page(vadjust, cn->ymax, cn->ymin);
}
}
gtk_widget_size_request(cn->container, &req);
d.width = x + req.width;
d.height = y + req.height;
+ cn->ymin = y;
+ cn->ymax = d.height;
if(cn->flags & CN_EXPANDED) {
/* We'll offset children by the size of the arrow whatever it might be. */
assert(cn->arrow);
0, 1, n, n + 1);
}
/* The layout is scrollable */
- scrolled = scroll_widget(GTK_WIDGET(chooselayout), "choose");
+ scrolled = scroll_widget(chooselayout, "choose");
+ vadjust = gtk_layout_get_vadjustment(GTK_LAYOUT(chooselayout));
/* The scrollable layout and the search hbox go together in a vbox */
NW(vbox);