changeset 1491:d77b8cf25f04

Code cleanup and removed some erroneous code for GTK in dw_window_new().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 24 Dec 2011 18:57:46 +0000
parents 5393b56ec6d0
children 1608c2a9c2b8
files gtk/dw.c gtk3/dw.c
diffstat 2 files changed, 9 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Sat Dec 24 17:38:00 2011 +0000
+++ b/gtk/dw.c	Sat Dec 24 18:57:46 2011 +0000
@@ -3449,27 +3449,20 @@
       if(flStyle & DW_FCF_SIZEBORDER)
          flags |= GDK_DECOR_RESIZEH | GDK_DECOR_BORDER;
 
-      if(flStyle & DW_FCF_BORDER || flStyle & DW_FCF_DLGBORDER)
+      if(flStyle & (DW_FCF_BORDER | DW_FCF_DLGBORDER))
          flags |= GDK_DECOR_BORDER;
 
+#if GTK_MAJOR_VERSION > 1
       if(flStyle & DW_FCF_MAXIMIZE)
-      {
-         flags &= ~DW_FCF_MAXIMIZE;
-#if GTK_MAJOR_VERSION > 1
          gtk_window_maximize(GTK_WINDOW(tmp));
-#endif
-      }
+         
       if(flStyle & DW_FCF_MINIMIZE)
-      {
-         flags &= ~DW_FCF_MINIMIZE;
-#if GTK_MAJOR_VERSION > 1
          gtk_window_iconify(GTK_WINDOW(tmp));
 #endif
-      }
+
 #if GTK_CHECK_VERSION(2,10,0)
       /* Either the CLOSEBUTTON or SYSMENU flags should make it deletable */
-      if(!(flStyle & (DW_FCF_CLOSEBUTTON | DW_FCF_SYSMENU)))
-         gtk_window_set_deletable(GTK_WINDOW(tmp), FALSE);
+      gtk_window_set_deletable(GTK_WINDOW(tmp), (flStyle & (DW_FCF_CLOSEBUTTON | DW_FCF_SYSMENU)) ? TRUE : FALSE);
 #endif
 
       gdk_window_set_decorations(tmp->window, flags);
--- a/gtk3/dw.c	Sat Dec 24 17:38:00 2011 +0000
+++ b/gtk3/dw.c	Sat Dec 24 18:57:46 2011 +0000
@@ -2914,22 +2914,17 @@
       if(flStyle & DW_FCF_SIZEBORDER)
          flags |= GDK_DECOR_RESIZEH | GDK_DECOR_BORDER;
 
-      if(flStyle & DW_FCF_BORDER || flStyle & DW_FCF_DLGBORDER)
+      if(flStyle & (DW_FCF_BORDER | DW_FCF_DLGBORDER))
          flags |= GDK_DECOR_BORDER;
 
       if(flStyle & DW_FCF_MAXIMIZE)
-      {
-         flags &= ~DW_FCF_MAXIMIZE;
          gtk_window_maximize(GTK_WINDOW(tmp));
-      }
+         
       if(flStyle & DW_FCF_MINIMIZE)
-      {
-         flags &= ~DW_FCF_MINIMIZE;
          gtk_window_iconify(GTK_WINDOW(tmp));
-      }
+         
       /* Either the CLOSEBUTTON or SYSMENU flags should make it deletable */
-      if(!(flStyle & (DW_FCF_CLOSEBUTTON | DW_FCF_SYSMENU)))
-         gtk_window_set_deletable(GTK_WINDOW(tmp), FALSE);
+      gtk_window_set_deletable(GTK_WINDOW(tmp), (flStyle & (DW_FCF_CLOSEBUTTON | DW_FCF_SYSMENU)) ? TRUE : FALSE);
 
       gdk_window_set_decorations(gtk_widget_get_window(tmp), flags);
       if(!flags)