* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
gtk_style_context_set_background (context, icon_view->priv->bin_window);
+ gtk_style_context_set_background (context, window);
gtk_style_context_restore (context);
gdk_window_show (icon_view->priv->bin_window);
dest_pos != GTK_ICON_VIEW_NO_DROP)
{
GtkStyleContext *context;
- GtkStateFlags state;
GdkRectangle rect = { 0 };
context = gtk_widget_get_style_context (widget);
- state = gtk_widget_get_state_flags (widget);
switch (dest_pos)
{
break;
}
- gtk_style_context_set_state (context, state);
gtk_render_focus (context, cr,
rect.x, rect.y,
rect.width, rect.height);
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
- if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
+ if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_BUTTON_PRESS)
{
GdkModifierType extend_mod_mask;
GdkModifierType modify_mod_mask;
icon_view->priv->draw_focus = FALSE;
}
- if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
+ if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_2BUTTON_PRESS)
{
item = _gtk_icon_view_get_item_at_coords (icon_view,
event->x, event->y,
if (dirty)
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
- return event->button == 1;
+ return event->button == GDK_BUTTON_PRIMARY;
}
static gboolean
_gtk_icon_view_set_cell_data (icon_view, item);
style_context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
gtk_style_context_save (style_context);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_VIEW);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
+ state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
+
if (item->selected)
{
- if (gtk_widget_has_focus (widget) &&
+ if ((state & GTK_STATE_FLAG_FOCUSED) &&
item == icon_view->priv->cursor_item)
{
- state |= GTK_STATE_FLAG_FOCUSED;
flags |= GTK_CELL_RENDERER_FOCUSED;
}
* for you. @column should be set to the column in @icon_view's model
* containing the tooltip texts, or -1 to disable this feature.
*
- * When enabled, #GtkWidget::has-tooltip will be set to %TRUE and
+ * When enabled, #GtkWidget:has-tooltip will be set to %TRUE and
* @icon_view will connect a #GtkWidget::query-tooltip signal handler.
*
* Note that the signal handler sets the text with gtk_tooltip_set_markup(),
g_object_unref (icon_view->priv->model);
- g_list_foreach (icon_view->priv->items, (GFunc)gtk_icon_view_item_free, NULL);
- g_list_free (icon_view->priv->items);
+ g_list_free_full (icon_view->priv->items, (GDestroyNotify) gtk_icon_view_item_free);
icon_view->priv->items = NULL;
icon_view->priv->anchor_item = NULL;
icon_view->priv->cursor_item = NULL;
*
* To free the return value, use:
* |[
- * g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
- * g_list_free (list);
+ * g_list_free_full (list, (GDestroyNotify) gtk_tree_patch_free);
* ]|
*
* Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.