changeset 3068:c5189bc4100b

Refactor skinned window code.
author William Pitcock <nenolod@atheme-project.org>
date Fri, 13 Jul 2007 10:19:43 -0500
parents e1d86c047a60
children be5375dd588f
files src/audacious/ui_equalizer.c src/audacious/ui_main.c src/audacious/ui_playlist.c src/audacious/ui_skinned_window.c src/audacious/ui_skinned_window.h
diffstat 5 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_equalizer.c	Fri Jul 13 10:11:04 2007 -0500
+++ b/src/audacious/ui_equalizer.c	Fri Jul 13 10:19:43 2007 -0500
@@ -732,7 +732,7 @@
     width = 275;
     height = cfg.equalizer_shaded ? 14 : 116;
 
-    equalizerwin = ui_skinned_window_new(GTK_WINDOW_POPUP, "equalizer");
+    equalizerwin = ui_skinned_window_new("equalizer");
     gtk_window_set_title(GTK_WINDOW(equalizerwin), _("Audacious Equalizer"));
     gtk_window_set_role(GTK_WINDOW(equalizerwin), "equalizer");
     gtk_window_set_resizable(GTK_WINDOW(equalizerwin), FALSE);
--- a/src/audacious/ui_main.c	Fri Jul 13 10:11:04 2007 -0500
+++ b/src/audacious/ui_main.c	Fri Jul 13 10:19:43 2007 -0500
@@ -2909,7 +2909,7 @@
 {
     gint width, height;
 
-    mainwin = ui_skinned_window_new(GTK_WINDOW_POPUP, "player");
+    mainwin = ui_skinned_window_new("player");
     gtk_window_set_title(GTK_WINDOW(mainwin), _("Audacious"));
     gtk_window_set_role(GTK_WINDOW(mainwin), "player");
     gtk_window_set_resizable(GTK_WINDOW(mainwin), FALSE);
--- a/src/audacious/ui_playlist.c	Fri Jul 13 10:11:04 2007 -0500
+++ b/src/audacious/ui_playlist.c	Fri Jul 13 10:19:43 2007 -0500
@@ -1679,7 +1679,7 @@
 {
     GdkPixbuf *icon;
 
-    playlistwin = ui_skinned_window_new(GTK_WINDOW_POPUP, "playlist");
+    playlistwin = ui_skinned_window_new("playlist");
     gtk_window_set_title(GTK_WINDOW(playlistwin), _("Audacious Playlist Editor"));
     gtk_window_set_role(GTK_WINDOW(playlistwin), "playlist");
     gtk_window_set_default_size(GTK_WINDOW(playlistwin),
--- a/src/audacious/ui_skinned_window.c	Fri Jul 13 10:11:04 2007 -0500
+++ b/src/audacious/ui_skinned_window.c	Fri Jul 13 10:19:43 2007 -0500
@@ -139,13 +139,12 @@
 }
 
 GtkWidget *
-ui_skinned_window_new(GtkWindowType type, const gchar *wmclass_name)
+ui_skinned_window_new(const gchar *wmclass_name)
 {
     GtkWidget *widget = g_object_new(ui_skinned_window_get_type(), NULL);
     GtkWindow *window = GTK_WINDOW(widget);
 
-    window->type = type;
-    gtk_window_unstick(GTK_WINDOW(widget));
+    window->type = SKINNED_WINDOW_TYPE;
 
     if (wmclass_name)
         gtk_window_set_wmclass(GTK_WINDOW(widget), wmclass_name, "Audacious");
--- a/src/audacious/ui_skinned_window.h	Fri Jul 13 10:11:04 2007 -0500
+++ b/src/audacious/ui_skinned_window.h	Fri Jul 13 10:19:43 2007 -0500
@@ -25,6 +25,12 @@
 #define SKINNED_CHECK_WINDOW(obj)    GTK_CHECK_TYPE (obj, ui_skinned_window_get_type ())
 #define SKINNED_TYPE_WINDOW          (ui_skinned_window_get_type())
 
+#ifdef GDK_WINDOWING_QUARTZ
+# define SKINNED_WINDOW_TYPE		GTK_WINDOW_POPUP
+#else
+# define SKINNED_WINDOW_TYPE		GTK_WINDOW_TOPLEVEL
+#endif
+
 typedef struct _SkinnedWindow SkinnedWindow;
 typedef struct _SkinnedWindowClass SkinnedWindowClass;
 
@@ -46,7 +52,7 @@
 };
 
 extern GType ui_skinned_window_get_type(void);
-extern GtkWidget *ui_skinned_window_new(GtkWindowType type, const gchar *wmclass_name);
+extern GtkWidget *ui_skinned_window_new(const gchar *wmclass_name);
 extern void ui_skinned_window_widgetlist_associate(GtkWidget * widget, Widget * w);
 extern void ui_skinned_window_widgetlist_dissociate(GtkWidget * widget, Widget * w);
 extern gboolean ui_skinned_window_widgetlist_contained(GtkWidget * widget, gint x, gint y);