}
/** @brief Called when a button is released over a queuelike */
-gboolean ql_button_release(GtkWidget attribute((unused)) *widget,
+gboolean ql_button_release(GtkWidget*widget,
GdkEventButton *event,
gpointer user_data) {
struct queuelike *ql = user_data;
if(event->type == GDK_BUTTON_PRESS
&& event->button == 3) {
- /* Right button click. */
+ /* Right button click. */
+ if(gtk_tree_selection_count_selected_rows(ql->selection) == 0) {
+ /* Nothing is selected, select whatever is under the pointer */
+ GtkTreePath *path;
+ if(gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
+ event->x, event->y,
+ &path,
+ NULL,
+ NULL, NULL))
+ gtk_tree_selection_select_path(ql->selection, path);
+ }
ql_create_menu(ql);
ql_configure_menu(ql);
gtk_widget_show_all(ql->menu);
return FALSE;
}
+static int ql_tab_selectall_sensitive(void *extra) {
+ return ql_selectall_sensitive(extra);
+}
+
+static void ql_tab_selectall_activate(void *extra) {
+ ql_selectall_activate(NULL, extra);
+}
+
+static int ql_tab_selectnone_sensitive(void *extra) {
+ return ql_selectnone_sensitive(extra);
+}
+
+static void ql_tab_selectnone_activate(void *extra) {
+ ql_selectnone_activate(NULL, extra);
+}
+
+static int ql_tab_properties_sensitive(void *extra) {
+ return ql_properties_sensitive(extra);
+}
+
+static void ql_tab_properties_activate(void *extra) {
+ ql_properties_activate(NULL, extra);
+}
+
+struct tabtype *ql_tabtype(struct queuelike *ql) {
+ static const struct tabtype ql_tabtype = {
+ ql_tab_properties_sensitive,
+ ql_tab_selectall_sensitive,
+ ql_tab_selectnone_sensitive,
+ ql_tab_properties_activate,
+ ql_tab_selectall_activate,
+ ql_tab_selectnone_activate,
+ 0,
+ 0
+ };
+
+ struct tabtype *t = xmalloc(sizeof *t);
+ *t = ql_tabtype;
+ t->extra = ql;
+ return t;
+}
+
/*
Local Variables:
c-basic-offset:2