Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
thunar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pratik Karki
thunar
Commits
a113ba84
Commit
a113ba84
authored
7 years ago
by
Simon Steinbeiss
Browse files
Options
Downloads
Patches
Plain Diff
Fix mouse gestures not showing an icon
parent
c427e297
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
thunar/thunar-abstract-icon-view.c
+20
-27
20 additions, 27 deletions
thunar/thunar-abstract-icon-view.c
with
20 additions
and
27 deletions
thunar/thunar-abstract-icon-view.c
+
20
−
27
View file @
a113ba84
...
...
@@ -509,7 +509,7 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view,
* to make sure that the folder context menu is opened.
*/
exo_icon_view_unselect_all
(
view
);
/* open the context menu */
thunar_standard_view_context_menu
(
THUNAR_STANDARD_VIEW
(
abstract_icon_view
),
event
->
button
,
event
->
time
);
}
...
...
@@ -621,10 +621,9 @@ thunar_abstract_icon_view_draw (ExoIconView *view,
cairo_t
*
cr
,
ThunarAbstractIconView
*
abstract_icon_view
)
{
GtkIconSet
*
stock_icon_set
;
GtkAction
*
action
=
NULL
;
GdkPixbuf
*
stock
_icon
=
NULL
;
gchar
*
stock_id
;
GdkPixbuf
*
gesture
_icon
=
NULL
;
gchar
*
icon_name
;
GdkColor
bg
;
gint
x
,
y
;
...
...
@@ -643,39 +642,34 @@ thunar_abstract_icon_view_draw (ExoIconView *view,
action
=
thunar_abstract_icon_view_gesture_action
(
abstract_icon_view
);
if
(
G_LIKELY
(
action
!=
NULL
))
{
/* determine the stock abstract_icon for the action */
g_object_get
(
G_OBJECT
(
action
),
"stock-id"
,
&
stock_id
,
NULL
);
/* lookup the abstract_icon set for the stock abstract_icon */
stock_icon_set
=
gtk_style_lookup_icon_set
(
gtk_widget_get_style
(
GTK_WIDGET
(
view
)),
stock_id
);
if
(
G_LIKELY
(
stock_icon_set
!=
NULL
))
{
stock_icon
=
gtk_icon_set_render_icon
(
stock_icon_set
,
gtk_widget_get_style
(
GTK_WIDGET
(
view
)),
gtk_widget_get_direction
(
GTK_WIDGET
(
view
)),
gtk_action_is_sensitive
(
action
)
?
0
:
GTK_STATE_INSENSITIVE
,
GTK_ICON_SIZE_DND
,
GTK_WIDGET
(
view
),
NULL
);
}
/* get the icon-name for the action */
g_object_get
(
G_OBJECT
(
action
),
"icon-name"
,
&
icon_name
,
NULL
);
gesture_icon
=
gtk_icon_theme_load_icon
(
gtk_icon_theme_get_default
(),
icon_name
,
32
,
GTK_ICON_LOOKUP_FORCE_SIZE
,
NULL
);
/* draw the rendered icon */
if
(
G_LIKELY
(
stock
_icon
!=
NULL
))
if
(
G_LIKELY
(
gesture
_icon
!=
NULL
))
{
/* x/y position of the icon */
x
=
abstract_icon_view
->
priv
->
gesture_start_x
-
gdk_pixbuf_get_width
(
stock
_icon
)
/
2
;
y
=
abstract_icon_view
->
priv
->
gesture_start_y
-
gdk_pixbuf_get_height
(
stock
_icon
)
/
2
;
x
=
abstract_icon_view
->
priv
->
gesture_start_x
-
gdk_pixbuf_get_width
(
gesture
_icon
)
/
2
;
y
=
abstract_icon_view
->
priv
->
gesture_start_y
-
gdk_pixbuf_get_height
(
gesture
_icon
)
/
2
;
/* render the
stock abstract_
icon into the abstract_icon view window */
gdk_cairo_set_source_pixbuf
(
cr
,
stock
_icon
,
x
,
y
);
/* render the icon into the abstract_icon view window */
gdk_cairo_set_source_pixbuf
(
cr
,
gesture
_icon
,
x
,
y
);
cairo_rectangle
(
cr
,
x
,
y
,
gdk_pixbuf_get_width
(
stock
_icon
),
gdk_pixbuf_get_height
(
stock
_icon
));
gdk_pixbuf_get_width
(
gesture
_icon
),
gdk_pixbuf_get_height
(
gesture
_icon
));
cairo_fill
(
cr
);
/* release the stock abstract_icon */
g_object_unref
(
G_OBJECT
(
stock
_icon
));
g_object_unref
(
G_OBJECT
(
gesture
_icon
));
}
/* release the stock id */
g_free
(
stock_id
);
g_free
(
icon_name
);
}
return
FALSE
;
...
...
@@ -791,4 +785,3 @@ thunar_abstract_icon_view_zoom_level_changed (ThunarAbstractIconView *abstract_i
THUNAR_STANDARD_VIEW
(
abstract_icon_view
)
->
icon_renderer
,
NULL
,
NULL
,
NULL
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment