Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,124
Issues
1,124
List
Boards
Labels
Service Desk
Milestones
Merge Requests
152
Merge Requests
152
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gtk
Commits
01eda653
Commit
01eda653
authored
Dec 19, 1997
by
Elliot Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more gtkhandlebox painting stuff..
parent
61124945
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
14 deletions
+29
-14
gtk/gtkhandlebox.c
gtk/gtkhandlebox.c
+29
-14
No files found.
gtk/gtkhandlebox.c
View file @
01eda653
...
...
@@ -192,14 +192,23 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
static
void
gtk_handle_box_paint
(
GtkWidget
*
widget
,
GdkRectangle
*
area
)
{
gint
startx
,
endx
,
x
;
gint
line_y2
;
g_print
(
"painting %dx%d+%d+%d
\n
"
,
area
->
x
,
area
->
y
,
area
->
width
,
area
->
height
);
gtk_draw_diamond
(
widget
->
style
,
widget
->
window
,
GTK_STATE_NORMAL
,
GTK_SHADOW_ETCHED_IN
,
1
,
1
,
DRAG_HANDLE_SIZE
,
DRAG_HANDLE_SIZE
);
startx
=
1
;
endx
=
DRAG_HANDLE_SIZE
;
if
(
area
->
x
>
startx
)
startx
=
area
->
x
;
if
((
area
->
x
+
area
->
width
)
<
endx
)
endx
=
area
->
x
+
area
->
width
;
line_y2
=
area
->
y
+
area
->
height
;
for
(
x
=
startx
;
x
<
DRAG_HANDLE_SIZE
;
x
+=
3
)
gtk_draw_vline
(
widget
->
style
,
widget
->
window
,
GTK_WIDGET_STATE
(
widget
),
area
->
y
,
line_y2
,
x
);
}
static
void
...
...
@@ -252,10 +261,13 @@ gtk_handle_box_expose (GtkWidget *widget,
return
FALSE
;
}
static
gint
dragoff_x
,
dragoff_y
;
static
gint
gtk_handle_box_button_changed
(
GtkWidget
*
widget
,
GdkEventButton
*
event
)
{
GtkHandleBox
*
hb
;
gint
rootx
,
rooty
;
g_return_val_if_fail
(
widget
!=
NULL
,
FALSE
);
g_return_val_if_fail
(
GTK_IS_HANDLE_BOX
(
widget
),
FALSE
);
g_return_val_if_fail
(
event
!=
NULL
,
FALSE
);
...
...
@@ -263,18 +275,21 @@ static gint gtk_handle_box_button_changed(GtkWidget *widget,
hb
=
GTK_HANDLE_BOX
(
widget
);
if
(
event
->
button
==
1
)
{
if
(
event
->
type
==
GDK_BUTTON_PRESS
)
if
(
event
->
type
==
GDK_BUTTON_PRESS
&&
event
->
x
<
DRAG_HANDLE_SIZE
)
{
hb
->
is_being_dragged
=
TRUE
;
dragoff_x
=
event
->
x
;
dragoff_y
=
event
->
y
;
if
(
!
hb
->
real_parent
)
{
hb
->
real_parent
=
widget
->
parent
;
gdk_window_set_override_redirect
(
widget
->
window
,
TRUE
);
rootx
=
event
->
x_root
-
event
->
x
;
rooty
=
event
->
y_root
-
event
->
y
;
gdk_window_reparent
(
widget
->
window
,
GDK_ROOT_PARENT
(),
event
->
x_root
-
event
->
x
,
event
->
y_root
-
event
->
y
);
g_print
(
"Reparenting with event %f (%f) x %f (%f)
\n
"
,
event
->
x_root
,
event
->
x
,
event
->
y_root
,
event
->
y
);
rootx
,
rooty
);
g_print
(
"Reparenting to %dx%d (%dx%d)
\n
"
,
rootx
,
rooty
,
(
gint
)
event
->
x_root
,
(
gint
)
event
->
y_root
);
}
else
gdk_window_raise
(
widget
->
window
);
}
...
...
@@ -298,8 +313,8 @@ static gint gtk_handle_box_motion (GtkWidget *widget,
hb
=
GTK_HANDLE_BOX
(
widget
);
if
(
hb
->
is_being_dragged
)
{
newx
=
event
->
x_root
-
DRAG_HANDLE_SIZE
;
newy
=
event
->
y_root
-
DRAG_HANDLE_SIZE
;
newx
=
event
->
x_root
-
dragoff_x
;
newy
=
event
->
y_root
-
dragoff_y
;
if
(
newx
<
0
)
newx
=
0
;
if
(
newy
<
0
)
newy
=
0
;
gdk_window_move
(
widget
->
window
,
newx
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment