mirror of
https://gitlab.gnome.org/GNOME/glade.git
synced 2025-11-27 00:06:20 -05:00
Restore cursor change.
This commit is contained in:
parent
a685a5f09c
commit
048b97a21a
@ -1,3 +1,8 @@
|
|||||||
|
2003-11-05 Paolo Borelli <pborelli@katamail.com>
|
||||||
|
|
||||||
|
* src/glade-placeholder.c: restore the cursor change when you can add
|
||||||
|
a widget.
|
||||||
|
|
||||||
2003-11-05 Paolo Borelli <pborelli@katamail.com>
|
2003-11-05 Paolo Borelli <pborelli@katamail.com>
|
||||||
|
|
||||||
* src/glade-placeholder.[ch]: move typedefs to glade-types.h to fix
|
* src/glade-placeholder.[ch]: move typedefs to glade-types.h to fix
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include "glade-project.h"
|
#include "glade-project.h"
|
||||||
#include "glade-command.h"
|
#include "glade-command.h"
|
||||||
#include "glade-popup.h"
|
#include "glade-popup.h"
|
||||||
|
#include "glade-cursor.h"
|
||||||
#include "glade-utils.h"
|
#include "glade-utils.h"
|
||||||
|
|
||||||
|
|
||||||
@ -39,6 +40,8 @@ static void glade_placeholder_size_allocate (GtkWidget *widget,
|
|||||||
static void glade_placeholder_send_configure (GladePlaceholder *placeholder);
|
static void glade_placeholder_send_configure (GladePlaceholder *placeholder);
|
||||||
static gboolean glade_placeholder_expose (GtkWidget *widget,
|
static gboolean glade_placeholder_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *event);
|
GdkEventExpose *event);
|
||||||
|
static gboolean glade_placeholder_motion_notify_event (GtkWidget *widget,
|
||||||
|
GdkEventMotion *event);
|
||||||
static gboolean glade_placeholder_button_press (GtkWidget *widget,
|
static gboolean glade_placeholder_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *event);
|
GdkEventButton *event);
|
||||||
|
|
||||||
@ -101,6 +104,7 @@ glade_placeholder_class_init (GladePlaceholderClass *klass)
|
|||||||
widget_class->realize = glade_placeholder_realize;
|
widget_class->realize = glade_placeholder_realize;
|
||||||
widget_class->size_allocate = glade_placeholder_size_allocate;
|
widget_class->size_allocate = glade_placeholder_size_allocate;
|
||||||
widget_class->expose_event = glade_placeholder_expose;
|
widget_class->expose_event = glade_placeholder_expose;
|
||||||
|
widget_class->motion_notify_event = glade_placeholder_motion_notify_event;
|
||||||
widget_class->button_press_event = glade_placeholder_button_press;
|
widget_class->button_press_event = glade_placeholder_button_press;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +157,10 @@ glade_placeholder_realize (GtkWidget *widget)
|
|||||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||||
attributes.visual = gtk_widget_get_visual (widget);
|
attributes.visual = gtk_widget_get_visual (widget);
|
||||||
attributes.colormap = gtk_widget_get_colormap (widget);
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||||
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
|
attributes.event_mask = gtk_widget_get_events (widget) |
|
||||||
|
GDK_EXPOSURE_MASK |
|
||||||
|
GDK_BUTTON_PRESS_MASK |
|
||||||
|
GDK_POINTER_MOTION_MASK;
|
||||||
|
|
||||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||||
|
|
||||||
@ -235,14 +242,32 @@ glade_placeholder_expose (GtkWidget *widget, GdkEventExpose *event)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
glade_placeholder_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
|
||||||
|
{
|
||||||
|
GladeProjectWindow *gpw;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GLADE_IS_PLACEHOLDER (widget), FALSE);
|
||||||
|
|
||||||
|
gpw = glade_project_window_get ();
|
||||||
|
|
||||||
|
if (gpw->add_class == NULL)
|
||||||
|
glade_cursor_set (event->window, GLADE_CURSOR_SELECTOR);
|
||||||
|
else
|
||||||
|
glade_cursor_set (event->window, GLADE_CURSOR_ADD_WIDGET);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
glade_placeholder_button_press (GtkWidget *widget, GdkEventButton *event)
|
glade_placeholder_button_press (GtkWidget *widget, GdkEventButton *event)
|
||||||
{
|
{
|
||||||
GladeProjectWindow *gpw = glade_project_window_get ();
|
GladeProjectWindow *gpw;
|
||||||
GladePlaceholder *placeholder;
|
GladePlaceholder *placeholder;
|
||||||
|
|
||||||
g_return_val_if_fail (GLADE_IS_PLACEHOLDER (widget), FALSE);
|
g_return_val_if_fail (GLADE_IS_PLACEHOLDER (widget), FALSE);
|
||||||
|
|
||||||
|
gpw = glade_project_window_get ();
|
||||||
placeholder = GLADE_PLACEHOLDER (widget);
|
placeholder = GLADE_PLACEHOLDER (widget);
|
||||||
|
|
||||||
if (event->button == 1 && event->type == GDK_BUTTON_PRESS) {
|
if (event->button == 1 && event->type == GDK_BUTTON_PRESS) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user