changeset 2574:8da9705862e5

introduce ui_skinned_window_button_press and ui_skinned_window_button_release
author Tomasz Mon <desowin@gmail.com>
date Sun, 18 May 2008 16:59:05 +0200
parents c0b08527b121
children 1e67df1a1edc 8fba3fbf1a0f
files src/skins/ui_skinned_window.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/ui_skinned_window.c	Sun May 18 16:27:48 2008 +0200
+++ b/src/skins/ui_skinned_window.c	Sun May 18 16:59:05 2008 +0200
@@ -100,6 +100,23 @@
     return val;
 }
 
+static gboolean ui_skinned_window_button_press(GtkWidget *widget, GdkEventButton *event) {
+    if (event->button == 1 && event->type == GDK_BUTTON_PRESS &&
+        (aud_cfg->easy_move || aud_cfg->equalizer_shaded || (event->y / aud_cfg->scale_factor) < 14)) {
+         dock_move_press(get_dock_window_list(), GTK_WINDOW(widget),
+                         event, SKINNED_WINDOW(widget)->type == WINDOW_MAIN ? TRUE : FALSE);
+    }
+
+    return TRUE;
+}
+
+static gboolean ui_skinned_window_button_release(GtkWidget *widget, GdkEventButton *event) {
+    if (dock_is_moving(GTK_WINDOW(widget)))
+       dock_move_release(GTK_WINDOW(widget));
+
+    return TRUE;
+}
+
 static gboolean ui_skinned_window_expose(GtkWidget *widget, GdkEventExpose *event) {
     SkinnedWindow *window = SKINNED_WINDOW(widget);
 
@@ -178,6 +195,8 @@
     widget_class->expose_event = ui_skinned_window_expose;
     widget_class->focus_in_event = ui_skinned_window_focus_in;
     widget_class->focus_out_event = ui_skinned_window_focus_out;
+    widget_class->button_press_event = ui_skinned_window_button_press;
+    widget_class->button_release_event = ui_skinned_window_button_release;
     widget_class->map = ui_skinned_window_map;
 }