Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
gtk
Commits
3ec8daa6
Commit
3ec8daa6
authored
Nov 18, 2010
by
Michael Natterer
Browse files
gtk: draw the progress only on the text area
so it doesn't extend under GtkSpinButton's buttons.
parent
4782804b
Changes
1
Hide whitespace changes
Inline
Side-by-side
gtk/gtkentry.c
View file @
3ec8daa6
...
...
@@ -3393,59 +3393,37 @@ gtk_entry_draw_frame (GtkWidget *widget,
cairo_restore
(
cr
);
}
static
void
gtk_entry_get_progress_border
(
GtkWidget
*
widget
,
GtkBorder
*
progress_border
)
{
GtkBorder
*
tmp_border
;
GtkStyle
*
style
;
gtk_widget_style_get
(
widget
,
"progress-border"
,
&
tmp_border
,
NULL
);
if
(
tmp_border
)
{
*
progress_border
=
*
tmp_border
;
gtk_border_free
(
tmp_border
);
}
else
{
style
=
gtk_widget_get_style
(
widget
);
progress_border
->
left
=
style
->
xthickness
;
progress_border
->
right
=
style
->
xthickness
;
progress_border
->
top
=
style
->
ythickness
;
progress_border
->
bottom
=
style
->
ythickness
;
}
}
static
void
get_progress_area
(
GtkWidget
*
widget
,
gint
*
x
,
gint
*
y
,
gint
*
width
,
gint
*
height
)
gint
*
x
,
gint
*
y
,
gint
*
width
,
gint
*
height
)
{
GtkEntryPrivate
*
private
=
GTK_ENTRY_GET_PRIVATE
(
widget
);
GtkEntry
*
entry
=
GTK_ENTRY
(
widget
);
GtkBorder
progress_border
;
gint
frame_width
,
frame_height
;
GtkBorder
*
progress_border
;
get_frame_size
(
entry
,
NULL
,
NULL
,
&
frame_width
,
&
frame_height
);
gtk_entry_get_progress_border
(
widget
,
&
progress_border
);
get_text_area_size
(
entry
,
x
,
y
,
width
,
height
);
*
x
=
progress_border
.
left
;
*
y
=
progress_border
.
top
;
if
(
!
private
->
interior_focus
)
{
*
x
-=
private
->
focus_width
;
*
y
-=
private
->
focus_width
;
*
width
+=
2
*
private
->
focus_width
;
*
height
+=
2
*
private
->
focus_width
;
}
*
width
=
frame_width
-
progress_border
.
left
-
progress_border
.
right
;
*
height
=
frame_height
-
progress_border
.
top
-
progress_border
.
bottom
;
gtk_widget_style_get
(
widget
,
"progress-border"
,
&
progress_border
,
NULL
);
if
(
gtk_widget_has_focus
(
widget
)
&&
!
private
->
interior_focus
)
if
(
progress_border
)
{
*
x
+=
private
->
focus_width
;
*
y
+=
private
->
focus_width
;
*
width
-=
2
*
private
->
focus_width
;
*
height
-=
2
*
private
->
focus_width
;
*
x
+=
progress_border
->
left
;
*
y
+=
progress_border
->
top
;
*
width
-=
progress_border
->
left
+
progress_border
->
right
;
*
height
-=
progress_border
->
top
+
progress_border
->
bottom
;
gtk_border_free
(
progress_border
);
}
if
(
private
->
progress_pulse_mode
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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