forked from AuroraMiddleware/gtk
filechoosercell: Select item when right click or long press
This commit is contained in:
parent
c0e437d163
commit
22aca8952f
@ -67,11 +67,15 @@ popup_menu (GtkFileChooserCell *self,
|
|||||||
double y)
|
double y)
|
||||||
{
|
{
|
||||||
GtkWidget *widget = GTK_WIDGET (self);
|
GtkWidget *widget = GTK_WIDGET (self);
|
||||||
|
GtkSelectionModel *model;
|
||||||
GtkWidget *impl;
|
GtkWidget *impl;
|
||||||
double xx, yy;
|
double xx, yy;
|
||||||
|
|
||||||
impl = gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_CHOOSER_WIDGET);
|
impl = gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_CHOOSER_WIDGET);
|
||||||
|
|
||||||
|
model = gtk_file_chooser_widget_get_selection_model (GTK_FILE_CHOOSER_WIDGET (impl));
|
||||||
|
gtk_selection_model_select_item (model, self->position, TRUE);
|
||||||
|
|
||||||
gtk_widget_translate_coordinates (widget, GTK_WIDGET (impl),
|
gtk_widget_translate_coordinates (widget, GTK_WIDGET (impl),
|
||||||
x, y, &xx, &yy);
|
x, y, &xx, &yy);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user