mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: remove motion from time ruler
This is done on the tracks view instead
This commit is contained in:
@ -27,12 +27,8 @@
|
|||||||
struct _SysprofTimeRuler
|
struct _SysprofTimeRuler
|
||||||
{
|
{
|
||||||
GtkWidget parent_instance;
|
GtkWidget parent_instance;
|
||||||
|
|
||||||
SysprofSession *session;
|
SysprofSession *session;
|
||||||
GSignalGroup *session_signals;
|
GSignalGroup *session_signals;
|
||||||
|
|
||||||
double motion_x;
|
|
||||||
double motion_y;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -120,11 +116,6 @@ sysprof_time_ruler_snapshot (GtkWidget *widget,
|
|||||||
&GRAPHENE_RECT_INIT (x, 0, 1, height));
|
&GRAPHENE_RECT_INIT (x, 0, 1, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->motion_x >= 0 && self->motion_y >= 0)
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
|
||||||
&color,
|
|
||||||
&GRAPHENE_RECT_INIT (self->motion_x, 0, 1, height));
|
|
||||||
|
|
||||||
g_object_unref (layout);
|
g_object_unref (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,49 +143,6 @@ sysprof_time_ruler_measure (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
sysprof_time_ruler_motion_enter_cb (SysprofTimeRuler *self,
|
|
||||||
double x,
|
|
||||||
double y,
|
|
||||||
GtkEventControllerMotion *motion)
|
|
||||||
{
|
|
||||||
g_assert (SYSPROF_IS_TIME_RULER (self));
|
|
||||||
g_assert (GTK_IS_EVENT_CONTROLLER_MOTION (motion));
|
|
||||||
|
|
||||||
self->motion_x = x;
|
|
||||||
self->motion_y = y;
|
|
||||||
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
sysprof_time_ruler_motion_cb (SysprofTimeRuler *self,
|
|
||||||
double x,
|
|
||||||
double y,
|
|
||||||
GtkEventControllerMotion *motion)
|
|
||||||
{
|
|
||||||
g_assert (SYSPROF_IS_TIME_RULER (self));
|
|
||||||
g_assert (GTK_IS_EVENT_CONTROLLER_MOTION (motion));
|
|
||||||
|
|
||||||
self->motion_x = x;
|
|
||||||
self->motion_y = y;
|
|
||||||
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
sysprof_time_ruler_motion_leave_cb (SysprofTimeRuler *self,
|
|
||||||
GtkEventControllerMotion *motion)
|
|
||||||
{
|
|
||||||
g_assert (SYSPROF_IS_TIME_RULER (self));
|
|
||||||
g_assert (GTK_IS_EVENT_CONTROLLER_MOTION (motion));
|
|
||||||
|
|
||||||
self->motion_x = -1;
|
|
||||||
self->motion_y = -1;
|
|
||||||
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sysprof_time_ruler_dispose (GObject *object)
|
sysprof_time_ruler_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
@ -281,11 +229,6 @@ sysprof_time_ruler_class_init (SysprofTimeRulerClass *klass)
|
|||||||
static void
|
static void
|
||||||
sysprof_time_ruler_init (SysprofTimeRuler *self)
|
sysprof_time_ruler_init (SysprofTimeRuler *self)
|
||||||
{
|
{
|
||||||
GtkEventController *motion;
|
|
||||||
|
|
||||||
self->motion_x = -1;
|
|
||||||
self->motion_y = -1;
|
|
||||||
|
|
||||||
self->session_signals = g_signal_group_new (SYSPROF_TYPE_SESSION);
|
self->session_signals = g_signal_group_new (SYSPROF_TYPE_SESSION);
|
||||||
g_signal_group_connect_object (self->session_signals,
|
g_signal_group_connect_object (self->session_signals,
|
||||||
"notify::selected-time",
|
"notify::selected-time",
|
||||||
@ -302,24 +245,6 @@ sysprof_time_ruler_init (SysprofTimeRuler *self)
|
|||||||
G_CALLBACK (gtk_widget_queue_draw),
|
G_CALLBACK (gtk_widget_queue_draw),
|
||||||
self,
|
self,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
motion = gtk_event_controller_motion_new ();
|
|
||||||
g_signal_connect_object (motion,
|
|
||||||
"enter",
|
|
||||||
G_CALLBACK (sysprof_time_ruler_motion_enter_cb),
|
|
||||||
self,
|
|
||||||
G_CONNECT_SWAPPED);
|
|
||||||
g_signal_connect_object (motion,
|
|
||||||
"leave",
|
|
||||||
G_CALLBACK (sysprof_time_ruler_motion_leave_cb),
|
|
||||||
self,
|
|
||||||
G_CONNECT_SWAPPED);
|
|
||||||
g_signal_connect_object (motion,
|
|
||||||
"motion",
|
|
||||||
G_CALLBACK (sysprof_time_ruler_motion_cb),
|
|
||||||
self,
|
|
||||||
G_CONNECT_SWAPPED);
|
|
||||||
gtk_widget_add_controller (GTK_WIDGET (self), motion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
|
|||||||
Reference in New Issue
Block a user