summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-09 21:33:45 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-09 21:33:45 +0200
commit133b2f31913b25ff222bd9ba9aa716a990e0d94a (patch)
treeb542d3d0b4dfc57013b280cde9a459debb9e05f2 /plugins
parentf20673387d5a4df6126002601ead256911d4957f (diff)
few drawing fixes in EQ, seekbar and volumebar
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/callbacks.c94
-rw-r--r--plugins/gtkui/callbacks.h20
-rw-r--r--plugins/gtkui/ddbequalizer.c25
-rw-r--r--plugins/gtkui/ddbequalizer.h2
-rw-r--r--plugins/gtkui/ddbequalizer.vala17
-rw-r--r--plugins/gtkui/ddbvolumebar.c40
-rw-r--r--plugins/gtkui/deadbeef.glade7
-rw-r--r--plugins/gtkui/gdkdrawing.c1
-rw-r--r--plugins/gtkui/gtkui.c5
-rw-r--r--plugins/gtkui/gtkui.vapi1
-rw-r--r--plugins/gtkui/interface.c17
11 files changed, 160 insertions, 69 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 90eb7c1a..4811b592 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -410,7 +410,7 @@ on_playlist_save_as_activate (GtkMenuItem *menuitem,
}
-static GdkPixmap *seekbar_backbuf;
+//static GdkPixmap *seekbar_backbuf;
enum
{
@@ -467,9 +467,9 @@ seekbar_draw (GtkWidget *widget) {
if (!widget) {
return;
}
- gdk_draw_rectangle (seekbar_backbuf, widget->style->bg_gc[0], TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
+// gdk_draw_rectangle (seekbar_backbuf, widget->style->bg_gc[0], TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
cairo_t *cr;
- cr = gdk_cairo_create (seekbar_backbuf);
+ cr = gdk_cairo_create (gtk_widget_get_window (widget));
if (!cr) {
return;
}
@@ -530,6 +530,7 @@ seekbar_draw (GtkWidget *widget) {
}
}
+#if 0
void
seekbar_expose (GtkWidget *widget, int x, int y, int w, int h) {
gdk_draw_drawable (widget->window, widget->style->black_gc, seekbar_backbuf, x, y, x, y, w, h);
@@ -548,13 +549,15 @@ on_seekbar_configure_event (GtkWidget *widget,
seekbar_draw (widget);
return FALSE;
}
+#endif
gboolean
on_seekbar_expose_event (GtkWidget *widget,
GdkEventExpose *event,
gpointer user_data)
{
- seekbar_expose (widget, event->area.x, event->area.y, event->area.width, event->area.height);
+ //seekbar_expose (widget, event->area.x, event->area.y, event->area.width, event->area.height);
+ seekbar_draw (widget);
return FALSE;
}
@@ -565,8 +568,9 @@ on_seekbar_motion_notify_event (GtkWidget *widget,
{
if (seekbar_moving) {
seekbar_move_x = event->x;
- seekbar_draw (widget);
- seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ gtk_widget_queue_draw (widget);
+ //seekbar_draw (widget);
+ //seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
}
return FALSE;
}
@@ -581,8 +585,9 @@ on_seekbar_button_press_event (GtkWidget *widget,
}
seekbar_moving = 1;
seekbar_move_x = event->x;
- seekbar_draw (widget);
- seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ gtk_widget_queue_draw (widget);
+ //seekbar_draw (widget);
+ //seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
return FALSE;
}
@@ -593,8 +598,9 @@ on_seekbar_button_release_event (GtkWidget *widget,
gpointer user_data)
{
seekbar_moving = 0;
- seekbar_draw (widget);
- seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ gtk_widget_queue_draw (widget);
+ //seekbar_draw (widget);
+ //seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
DB_playItem_t *trk = deadbeef->streamer_get_playing_track ();
if (trk) {
float time = event->x * deadbeef->pl_get_item_duration (trk) / (widget->allocation.width);
@@ -610,8 +616,9 @@ on_seekbar_button_release_event (GtkWidget *widget,
void
seekbar_redraw (void) {
GtkWidget *widget = lookup_widget (mainwin, "seekbar");
- seekbar_draw (widget);
- seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ gtk_widget_queue_draw (widget);
+ //seekbar_draw (widget);
+ //seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
}
gboolean
@@ -1073,3 +1080,66 @@ on_new_playlist1_activate (GtkMenuItem *menuitem,
}
}
+
+static GtkWidget *capture = NULL;
+
+gboolean
+on_mainwin_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
+ if (event->x >= volumebar->allocation.x && event->x < volumebar->allocation.x + volumebar->allocation.width
+ && event->y >= volumebar->allocation.y && event->y < volumebar->allocation.y + volumebar->allocation.height) {
+ capture = volumebar;
+ return gtk_widget_event (volumebar, (GdkEvent *)event);
+ }
+
+ return FALSE;
+}
+
+
+gboolean
+on_mainwin_button_release_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
+ if (event->x >= volumebar->allocation.x && event->x < volumebar->allocation.x + volumebar->allocation.width
+ && event->y >= volumebar->allocation.y && event->y < volumebar->allocation.y + volumebar->allocation.height) {
+ return gtk_widget_event (volumebar, (GdkEvent *)event);
+ }
+ capture = NULL;
+
+ return FALSE;
+}
+
+
+gboolean
+on_mainwin_scroll_event (GtkWidget *widget,
+ GdkEvent *ev,
+ gpointer user_data)
+{
+ GdkEventScroll *event = (GdkEventScroll *)ev;
+ GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
+ if (event->x >= volumebar->allocation.x && event->x < volumebar->allocation.x + volumebar->allocation.width
+ && event->y >= volumebar->allocation.y && event->y < volumebar->allocation.y + volumebar->allocation.height) {
+ return gtk_widget_event (volumebar, (GdkEvent *)event);
+ }
+ return FALSE;
+}
+
+
+gboolean
+on_mainwin_motion_notify_event (GtkWidget *widget,
+ GdkEventMotion *event,
+ gpointer user_data)
+{
+ GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
+ if (capture == volumebar || (event->x >= volumebar->allocation.x && event->x < volumebar->allocation.x + volumebar->allocation.width
+ && event->y >= volumebar->allocation.y && event->y < volumebar->allocation.y + volumebar->allocation.height)) {
+ return gtk_widget_event (volumebar, (GdkEvent *)event);
+ }
+ return FALSE;
+}
+
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index d397a0da..56da05c9 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -929,3 +929,23 @@ on_wv_strip_apev2_toggled (GtkToggleButton *togglebutton,
void
on_wv_strip_id3v1_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
+
+gboolean
+on_mainwin_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+
+gboolean
+on_mainwin_button_release_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+
+gboolean
+on_mainwin_scroll_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_mainwin_motion_notify_event (GtkWidget *widget,
+ GdkEventMotion *event,
+ gpointer user_data);
diff --git a/plugins/gtkui/ddbequalizer.c b/plugins/gtkui/ddbequalizer.c
index 2d8bc577..30451403 100644
--- a/plugins/gtkui/ddbequalizer.c
+++ b/plugins/gtkui/ddbequalizer.c
@@ -62,7 +62,6 @@ struct _DdbEqualizerPrivate {
gint _values_size_;
double preamp;
gint mouse_y;
- gboolean aa_mode;
gboolean curve_hook;
gboolean preamp_hook;
gint margin_bottom;
@@ -80,7 +79,6 @@ enum {
};
#define DDB_EQUALIZER_bands 18
#define DDB_EQUALIZER_spot_size 3
-void ddb_equalizer_aa_mode_changed (DdbEqualizer* self, GtkCheckMenuItem* item);
static inline double ddb_equalizer_scale (DdbEqualizer* self, double val);
static gboolean ddb_equalizer_real_expose_event (GtkWidget* base, GdkEventExpose* event);
static gboolean ddb_equalizer_in_curve_area (DdbEqualizer* self, double x, double y);
@@ -93,6 +91,7 @@ void ddb_equalizer_set_band (DdbEqualizer* self, gint band, double v);
double ddb_equalizer_get_band (DdbEqualizer* self, gint band);
void ddb_equalizer_set_preamp (DdbEqualizer* self, double v);
double ddb_equalizer_get_preamp (DdbEqualizer* self);
+void ddb_equalizer_color_changed (DdbEqualizer* self);
DdbEqualizer* ddb_equalizer_new (void);
DdbEqualizer* ddb_equalizer_construct (GType object_type);
static GObject * ddb_equalizer_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
@@ -101,14 +100,6 @@ static void ddb_equalizer_finalize (GObject* obj);
const char* freqs[18] = {"55 Hz", "77 Hz", "110 Hz", "156 Hz", "220 Hz", "311 Hz", "440 Hz", "622 Hz", "880 Hz", "1.2 kHz", "1.8 kHz", "2.5 kHz", "3.5 kHz", "5 kHz", "7 kHz", "10 kHz", "14 kHz", "20 kHz"};
-void ddb_equalizer_aa_mode_changed (DdbEqualizer* self, GtkCheckMenuItem* item) {
- g_return_if_fail (self != NULL);
- g_return_if_fail (item != NULL);
- self->priv->aa_mode = gtk_check_menu_item_get_active (item);
- gtk_widget_queue_draw ((GtkWidget*) self);
-}
-
-
static gpointer _g_object_ref0 (gpointer self) {
return self ? g_object_ref (self) : NULL;
}
@@ -557,6 +548,15 @@ double ddb_equalizer_get_preamp (DdbEqualizer* self) {
}
+void ddb_equalizer_color_changed (DdbEqualizer* self) {
+ GdkColor _tmp1_;
+ GdkColor _tmp0_ = {0};
+ g_return_if_fail (self != NULL);
+ gtkui_init_theme_colors ();
+ gtk_widget_modify_bg ((GtkWidget*) self, GTK_STATE_NORMAL, (_tmp1_ = (gtkui_get_bar_background_color (&_tmp0_), _tmp0_), &_tmp1_));
+}
+
+
DdbEqualizer* ddb_equalizer_construct (GType object_type) {
DdbEqualizer * self;
self = g_object_newv (object_type, 0, NULL);
@@ -577,12 +577,10 @@ static GObject * ddb_equalizer_constructor (GType type, guint n_construct_proper
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = DDB_EQUALIZER (obj);
{
- GdkColor _tmp1_;
- GdkColor _tmp0_ = {0};
gtk_widget_add_events ((GtkWidget*) self, (gint) (((GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK) | GDK_LEAVE_NOTIFY_MASK) | GDK_POINTER_MOTION_MASK));
self->priv->margin_bottom = (gint) (((pango_units_to_double (pango_font_description_get_size (gtk_widget_get_style ((GtkWidget*) self)->font_desc)) * gdk_screen_get_resolution (gdk_screen_get_default ())) / 72) + 4);
self->priv->margin_left = self->priv->margin_bottom * 4;
- gtk_widget_modify_bg ((GtkWidget*) self, GTK_STATE_NORMAL, (_tmp1_ = (gtkui_get_bar_background_color (&_tmp0_), _tmp0_), &_tmp1_));
+ ddb_equalizer_color_changed (self);
}
return obj;
}
@@ -608,7 +606,6 @@ static void ddb_equalizer_instance_init (DdbEqualizer * self) {
self->priv->values_length1 = DDB_EQUALIZER_bands;
self->priv->_values_size_ = self->priv->values_length1;
self->priv->preamp = 0.5;
- self->priv->aa_mode = FALSE;
self->priv->curve_hook = FALSE;
self->priv->preamp_hook = FALSE;
self->priv->margin_bottom = -1;
diff --git a/plugins/gtkui/ddbequalizer.h b/plugins/gtkui/ddbequalizer.h
index 5f17780f..74507c39 100644
--- a/plugins/gtkui/ddbequalizer.h
+++ b/plugins/gtkui/ddbequalizer.h
@@ -34,11 +34,11 @@ struct _DdbEqualizerClass {
GType ddb_equalizer_get_type (void);
-void ddb_equalizer_aa_mode_changed (DdbEqualizer* self, GtkCheckMenuItem* item);
void ddb_equalizer_set_band (DdbEqualizer* self, gint band, double v);
double ddb_equalizer_get_band (DdbEqualizer* self, gint band);
void ddb_equalizer_set_preamp (DdbEqualizer* self, double v);
double ddb_equalizer_get_preamp (DdbEqualizer* self);
+void ddb_equalizer_color_changed (DdbEqualizer* self);
DdbEqualizer* ddb_equalizer_new (void);
DdbEqualizer* ddb_equalizer_construct (GType object_type);
diff --git a/plugins/gtkui/ddbequalizer.vala b/plugins/gtkui/ddbequalizer.vala
index 9f18279a..317dcca0 100644
--- a/plugins/gtkui/ddbequalizer.vala
+++ b/plugins/gtkui/ddbequalizer.vala
@@ -33,8 +33,6 @@ namespace Ddb {
private int mouse_y;
- private bool aa_mode = false;
-
private bool curve_hook = false;
private bool preamp_hook = false;
@@ -57,14 +55,7 @@ namespace Ddb {
margin_bottom = (int)(Pango.units_to_double (get_style ().font_desc.get_size ()) * Gdk.Screen.get_default ().get_resolution () / 72 + 4);
margin_left = margin_bottom * 4;
- modify_bg (Gtk.StateType.NORMAL, Gtkui.get_bar_background_color ());
- }
-
- public void
- aa_mode_changed (Gtk.CheckMenuItem item)
- {
- aa_mode = item.active;
- queue_draw ();
+ color_changed ();
}
public override bool
@@ -354,5 +345,11 @@ namespace Ddb {
get_preamp () {
return ((1 - preamp) * 40.0) - 20.0;
}
+
+ public void
+ color_changed () {
+ Gtkui.init_theme_colors ();
+ modify_bg (Gtk.StateType.NORMAL, Gtkui.get_bar_background_color ());
+ }
}
}
diff --git a/plugins/gtkui/ddbvolumebar.c b/plugins/gtkui/ddbvolumebar.c
index 2dd59ec3..3495f69a 100644
--- a/plugins/gtkui/ddbvolumebar.c
+++ b/plugins/gtkui/ddbvolumebar.c
@@ -23,6 +23,8 @@
#include "interface.h"
#include "support.h"
+#define min(x,y) ((x)<(y)?(x):(y))
+
G_DEFINE_TYPE (DdbVolumeBar, ddb_volumebar, GTK_TYPE_WIDGET);
static void
@@ -47,9 +49,11 @@ ddb_volumebar_send_configure (DdbVolumeBar *darea)
static void
ddb_volumebar_realize (GtkWidget *widget) {
DdbVolumeBar *darea = DDB_VOLUMEBAR (widget);
- GdkWindowAttr attributes;
- gint attributes_mask;
+ GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW);
+ GTK_WIDGET_CLASS (ddb_volumebar_parent_class)->realize (widget);
+
+#if 0
if (GTK_WIDGET_NO_WINDOW (widget))
{
GTK_WIDGET_CLASS (ddb_volumebar_parent_class)->realize (widget);
@@ -57,6 +61,8 @@ ddb_volumebar_realize (GtkWidget *widget) {
else
{
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gint attributes_mask;
+ GdkWindowAttr attributes;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
@@ -80,6 +86,7 @@ ddb_volumebar_realize (GtkWidget *widget) {
}
ddb_volumebar_send_configure (DDB_VOLUMEBAR (widget));
+#endif
}
static void
@@ -122,10 +129,6 @@ gboolean
on_volumebar_scroll_event (GtkWidget *widget,
GdkEventScroll *event);
-gboolean
-on_volumebar_configure_event (GtkWidget *widget,
- GdkEventConfigure *event);
-
static void
ddb_volumebar_class_init(DdbVolumeBarClass *class)
{
@@ -135,7 +138,6 @@ ddb_volumebar_class_init(DdbVolumeBarClass *class)
widget_class->expose_event = on_volumebar_expose_event;
widget_class->button_press_event = on_volumebar_button_press_event;
widget_class->button_release_event = on_volumebar_button_release_event;
- widget_class->configure_event = on_volumebar_configure_event;
widget_class->motion_notify_event = on_volumebar_motion_notify_event;
widget_class->scroll_event = on_volumebar_scroll_event;
}
@@ -175,7 +177,6 @@ volumebar_draw (GtkWidget *widget) {
}
#else
GdkDrawable *volumebar_backbuf = GDK_DRAWABLE (widget->window);
- gdk_draw_rectangle (volumebar_backbuf, widget->style->bg_gc[GTK_STATE_NORMAL], TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
float range = -deadbeef->volume_get_min_db ();
int n = widget->allocation.width / 4;
float vol = (range + deadbeef->volume_get_db ()) / range * n;
@@ -196,10 +197,10 @@ volumebar_draw (GtkWidget *widget) {
_y += (h - _h);
int _w = 3;
if (i <= vol) {
- gdk_draw_rectangle (volumebar_backbuf, front_gc, TRUE, _x, _y, _w, _h);
+ gdk_draw_rectangle (volumebar_backbuf, front_gc, TRUE, _x + widget->allocation.x, _y + widget->allocation.y, _w, _h);
}
else {
- gdk_draw_rectangle (volumebar_backbuf, back_gc, TRUE, _x, _y, _w, _h);
+ gdk_draw_rectangle (volumebar_backbuf, back_gc, TRUE, _x + widget->allocation.x, _y + widget->allocation.y, _w, _h);
}
}
g_object_unref (back_gc);
@@ -221,7 +222,7 @@ on_volumebar_motion_notify_event (GtkWidget *widget,
{
if (event->state & GDK_BUTTON1_MASK) {
float range = -deadbeef->volume_get_min_db ();
- float volume = event->x / widget->allocation.width * range - range;
+ float volume = (event->x - widget->allocation.x) / widget->allocation.width * range - range;
if (volume > 0) {
volume = 0;
}
@@ -229,7 +230,7 @@ on_volumebar_motion_notify_event (GtkWidget *widget,
volume = -range;
}
deadbeef->volume_set_db (volume);
- volumebar_draw (widget);
+ gtk_widget_queue_draw (widget);
}
return FALSE;
}
@@ -239,7 +240,7 @@ on_volumebar_button_press_event (GtkWidget *widget,
GdkEventButton *event)
{
float range = -deadbeef->volume_get_min_db ();
- float volume = event->x / widget->allocation.width * range - range;
+ float volume = (event->x - widget->allocation.x)/ widget->allocation.width * range - range;
if (volume < -range) {
volume = -range;
}
@@ -247,7 +248,8 @@ on_volumebar_button_press_event (GtkWidget *widget,
volume = 0;
}
deadbeef->volume_set_db (volume);
- volumebar_draw (widget);
+ printf ("queue_draw\n");
+ gtk_widget_queue_draw (widget);
return FALSE;
}
@@ -262,7 +264,7 @@ on_volumebar_button_release_event (GtkWidget *widget,
void
volumebar_notify_changed (void) {
GtkWidget *widget = lookup_widget (mainwin, "volumebar");
- volumebar_draw (widget);
+ gtk_widget_queue_draw (widget);
}
gboolean
@@ -285,14 +287,8 @@ on_volumebar_scroll_event (GtkWidget *widget,
}
deadbeef->volume_set_db (vol);
GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
- volumebar_draw (volumebar);
+ gtk_widget_queue_draw (widget);
return FALSE;
}
-gboolean
-on_volumebar_configure_event (GtkWidget *widget,
- GdkEventConfigure *event)
-{
- return FALSE;
-}
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 202ee691..844f07bb 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -5,7 +5,7 @@
<widget class="GtkWindow" id="mainwin">
<property name="visible">True</property>
- <property name="events">GDK_KEY_PRESS_MASK</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK</property>
<property name="title" translatable="yes">DeaDBeeF</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
@@ -27,6 +27,10 @@
<signal name="configure_event" handler="on_mainwin_configure_event" last_modification_time="Sun, 23 Aug 2009 15:26:53 GMT"/>
<signal name="window_state_event" handler="on_mainwin_window_state_event" last_modification_time="Wed, 09 Dec 2009 19:39:55 GMT"/>
<signal name="realize" handler="on_mainwin_realize" last_modification_time="Wed, 10 Mar 2010 18:20:51 GMT"/>
+ <signal name="button_press_event" handler="on_mainwin_button_press_event" last_modification_time="Fri, 09 Apr 2010 19:24:24 GMT"/>
+ <signal name="button_release_event" handler="on_mainwin_button_release_event" last_modification_time="Fri, 09 Apr 2010 19:24:31 GMT"/>
+ <signal name="scroll_event" handler="on_mainwin_scroll_event" last_modification_time="Fri, 09 Apr 2010 19:24:39 GMT"/>
+ <signal name="motion_notify_event" handler="on_mainwin_motion_notify_event" last_modification_time="Fri, 09 Apr 2010 19:24:49 GMT"/>
<child>
<widget class="GtkVBox" id="vbox1">
@@ -806,7 +810,6 @@
<property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<signal name="button_press_event" handler="on_seekbar_button_press_event" last_modification_time="Tue, 11 Aug 2009 17:47:59 GMT"/>
<signal name="button_release_event" handler="on_seekbar_button_release_event" last_modification_time="Tue, 11 Aug 2009 17:48:02 GMT"/>
- <signal name="configure_event" handler="on_seekbar_configure_event" last_modification_time="Tue, 11 Aug 2009 17:48:06 GMT"/>
<signal name="expose_event" handler="on_seekbar_expose_event" last_modification_time="Tue, 11 Aug 2009 17:48:11 GMT"/>
<signal name="motion_notify_event" handler="on_seekbar_motion_notify_event" last_modification_time="Tue, 11 Aug 2009 17:48:18 GMT"/>
</widget>
diff --git a/plugins/gtkui/gdkdrawing.c b/plugins/gtkui/gdkdrawing.c
index 2e60c090..6e31ff5d 100644
--- a/plugins/gtkui/gdkdrawing.c
+++ b/plugins/gtkui/gdkdrawing.c
@@ -192,6 +192,7 @@ gtkui_override_tabstrip_colors (void) {
void
gtkui_init_theme_colors (void) {
+ printf ("init theme colors\n");
override_listview_colors= deadbeef->conf_get_int ("gtkui.override_listview_colors", 0);
override_bar_colors = deadbeef->conf_get_int ("gtkui.override_bar_colors", 0);
override_tabstrip_colors = deadbeef->conf_get_int ("gtkui.override_tabstrip_colors", 0);
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 60c996cf..008f8679 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -194,16 +194,13 @@ update_songinfo (gpointer ctx) {
gtk_statusbar_push (sb, sb_context_id, sb_text);
}
- void seekbar_draw (GtkWidget *widget);
- void seekbar_expose (GtkWidget *widget, int x, int y, int w, int h);
if (mainwin) {
GtkWidget *widget = lookup_widget (mainwin, "seekbar");
// translate volume to seekbar pixels
songpos /= duration;
songpos *= widget->allocation.width;
if (fabs (songpos - last_songpos) > 0.01) {
- seekbar_draw (widget);
- seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ gtk_widget_queue_draw (widget);
last_songpos = songpos;
}
}
diff --git a/plugins/gtkui/gtkui.vapi b/plugins/gtkui/gtkui.vapi
index 93ef9587..353d9f9d 100644
--- a/plugins/gtkui/gtkui.vapi
+++ b/plugins/gtkui/gtkui.vapi
@@ -3,5 +3,6 @@ namespace Gtkui {
[CCode (cheader_filename = "drawing.h")]
public static unowned Gdk.Color get_bar_foreground_color ();
public static unowned Gdk.Color get_bar_background_color ();
+ public static unowned void init_theme_colors ();
}
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 9dc8ebeb..e378ceaf 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -125,7 +125,7 @@ create_mainwin (void)
accel_group = gtk_accel_group_new ();
mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_widget_set_events (mainwin, GDK_KEY_PRESS_MASK);
+ gtk_widget_set_events (mainwin, GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK);
gtk_window_set_title (GTK_WINDOW (mainwin), "DeaDBeeF");
gtk_window_set_default_size (GTK_WINDOW (mainwin), 500, 300);
@@ -570,6 +570,18 @@ create_mainwin (void)
g_signal_connect ((gpointer) mainwin, "realize",
G_CALLBACK (on_mainwin_realize),
NULL);
+ g_signal_connect ((gpointer) mainwin, "button_press_event",
+ G_CALLBACK (on_mainwin_button_press_event),
+ NULL);
+ g_signal_connect ((gpointer) mainwin, "button_release_event",
+ G_CALLBACK (on_mainwin_button_release_event),
+ NULL);
+ g_signal_connect ((gpointer) mainwin, "scroll_event",
+ G_CALLBACK (on_mainwin_scroll_event),
+ NULL);
+ g_signal_connect ((gpointer) mainwin, "motion_notify_event",
+ G_CALLBACK (on_mainwin_motion_notify_event),
+ NULL);
g_signal_connect ((gpointer) open, "activate",
G_CALLBACK (on_open_activate),
NULL);
@@ -699,9 +711,6 @@ create_mainwin (void)
g_signal_connect ((gpointer) seekbar, "button_release_event",
G_CALLBACK (on_seekbar_button_release_event),
NULL);
- g_signal_connect ((gpointer) seekbar, "configure_event",
- G_CALLBACK (on_seekbar_configure_event),
- NULL);
g_signal_connect ((gpointer) seekbar, "expose_event",
G_CALLBACK (on_seekbar_expose_event),
NULL);