summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-09-15 22:14:03 +0000
committerTor Lillqvist <tml@src.gnome.org>2005-09-15 22:14:03 +0000
commit6c544097597c4226164fd16674e57dc8b8ce7afc (patch)
treeff4824b159b4cff53939805c2ca64c27375b40e9 /modules
parent329bc4e22109bbf7633d22ff2a50e4f10628a783 (diff)
downloadgtk+-6c544097597c4226164fd16674e57dc8b8ce7afc.tar.gz
Check whether the widget actually is a GtkNotebook before treating it as
2005-09-16 Tor Lillqvist <tml@novell.com> * modules/engines/ms-windows/msw_style.c (draw_extension, draw_box_gap): Check whether the widget actually is a GtkNotebook before treating it as such. Drop some unneeded local variables, use parameter with same information instead. (#316412)
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/engines/ms-windows/msw_style.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c
index 2672d4c6b1..ce76e06625 100755
--- a/modules/engines/ms-windows/msw_style.c
+++ b/modules/engines/ms-windows/msw_style.c
@@ -1724,24 +1724,23 @@ draw_extension(GtkStyle *style,
gint height,
GtkPositionType gap_side)
{
- if (detail && !strcmp(detail, "tab"))
+ if (GTK_IS_NOTEBOOK(widget) && detail && !strcmp(detail, "tab"))
{
GtkNotebook *notebook = GTK_NOTEBOOK(widget);
- GtkPositionType pos_type = gtk_notebook_get_tab_pos(notebook);
- gint x2, y2, w2, h2;
+ gint x2, y2, w2, h2;
- x2 = x; y2 = y; w2 = width; h2 = height;
- if (pos_type == GTK_POS_TOP && state_type == GTK_STATE_NORMAL) {
+ x2 = x; y2 = y; w2 = width; h2 = height;
+ if (gap_side == GTK_POS_TOP && state_type == GTK_STATE_NORMAL) {
/*h2 += XP_EDGE_SIZE;*/
}
- else if (pos_type == GTK_POS_BOTTOM && state_type == GTK_STATE_NORMAL) {
+ else if (gap_side == GTK_POS_BOTTOM && state_type == GTK_STATE_NORMAL) {
/*h2 += XP_EDGE_SIZE;*/
}
- else if (pos_type == GTK_POS_LEFT && state_type == GTK_STATE_NORMAL) {
+ else if (gap_side == GTK_POS_LEFT && state_type == GTK_STATE_NORMAL) {
x2 += 1;
w2 -= XP_EDGE_SIZE;
}
- else if (pos_type == GTK_POS_RIGHT && state_type == GTK_STATE_NORMAL) {
+ else if (gap_side == GTK_POS_RIGHT && state_type == GTK_STATE_NORMAL) {
w2 -= (XP_EDGE_SIZE + 1);
}
@@ -1766,12 +1765,10 @@ draw_box_gap (GtkStyle *style, GdkWindow *window, GtkStateType state_type,
gint y, gint width, gint height, GtkPositionType gap_side,
gint gap_x, gint gap_width)
{
- if (detail && !strcmp(detail, "notebook"))
+ if (GTK_IS_NOTEBOOK(widget) && detail && !strcmp(detail, "notebook"))
{
- GtkNotebook *notebook = GTK_NOTEBOOK(widget);
-
/* FIXME: pos != TOP to be implemented */
- if (gtk_notebook_get_tab_pos(notebook) == GTK_POS_TOP && xp_theme_draw(window, XP_THEME_ELEMENT_TAB_PANE, style, x, y, width, height,
+ if (gap_side == GTK_POS_TOP && xp_theme_draw(window, XP_THEME_ELEMENT_TAB_PANE, style, x, y, width, height,
state_type, area))
{
return;