=== modified file 'src/awn-gconf.c' --- src/awn-gconf.c 2007-08-04 10:57:52 +0000 +++ src/awn-gconf.c 2007-08-05 08:11:14 +0000 @@ -92,6 +92,16 @@ AwnSettings* awn_gconf_new() { + GdkScreen *screen; + gint width = 1024; + gint height = 768; + + screen = gdk_screen_get_default(); + if (screen) { + width = gdk_screen_get_width(screen); + height = gdk_screen_get_height(screen); + } + if (settings) return settings; AwnSettings *s = NULL; @@ -104,8 +114,8 @@ /* general settings */ gconf_client_add_dir(client, AWN_PATH, GCONF_CLIENT_PRELOAD_NONE, NULL); awn_load_bool(client, AWN_FORCE_MONITOR, &s->force_monitor, FALSE); - awn_load_int(client, AWN_MONITOR_WIDTH, &s->monitor_width, 1024); - awn_load_int(client, AWN_MONITOR_HEIGHT, &s->monitor_height, 768); + awn_load_int(client, AWN_MONITOR_WIDTH, &s->monitor_width, width); + awn_load_int(client, AWN_MONITOR_HEIGHT, &s->monitor_height, height); awn_load_bool(client, AWN_PANEL_MODE, &s->panel_mode, FALSE); awn_load_bool(client, AWN_AUTO_HIDE, &s->auto_hide, FALSE); s->hidden = FALSE; === modified file 'src/awn-task-manager.c' --- src/awn-task-manager.c 2007-08-05 13:11:57 +0000 +++ src/awn-task-manager.c 2007-08-05 14:10:31 +0000 @@ -762,24 +762,55 @@ gtk_window_get_size (GTK_WINDOW (settings->window), &w, &h); //gint width = settings->bar_height+10; - gint width = 60; + gint i = 0; //for (i =0; i < settings->bar_height+10; i+=2) { - for (i =0; i < 60; i+=2) { - gint res = (settings->monitor.width) / width; - if (res > (num_tasks+num_launchers)) { - break; + + gint width = settings->task_width; + gint x; + gint num = num_tasks + num_launchers; + + if (num == 0) { + awn_task_manager_update_separator_position (task_manager); + return; + } + + + if (w + 20 > settings->monitor.width) { + x = w - num * width; + + do { + --width; + } while (x + num * width + 40 > settings->monitor_width); + } else if (width != settings->bar_height + 12 && w + 60 < settings->monitor.width) { + x = w - num * width; + + do { + ++width; + } while (x + num * width + 50 < settings->monitor_width); + } + + if (width != settings->task_width) { + if (width < priv->settings->task_width) { + priv->settings->task_width = width; + g_list_foreach(priv->launchers, (GFunc)_task_resize, GINT_TO_POINTER (width)); + g_list_foreach(priv->tasks, (GFunc)_task_resize, GINT_TO_POINTER (width)); + } else { + if (width > settings->bar_height + 12) { + priv->settings->task_width = settings->bar_height + 12; + } else { + priv->settings->task_width = width; + } + g_list_foreach(priv->launchers, (GFunc)_task_resize, GINT_TO_POINTER (width)); + g_list_foreach(priv->tasks, (GFunc)_task_resize, GINT_TO_POINTER (width)); } - width -=i; - } - - if (width != priv->settings->task_width) { - priv->settings->task_width = width; + } else if (width == settings->bar_height + 12) { + priv->settings->task_width = settings->bar_height + 12; g_list_foreach(priv->launchers, (GFunc)_task_resize, GINT_TO_POINTER (width)); g_list_foreach(priv->tasks, (GFunc)_task_resize, GINT_TO_POINTER (width)); - g_print ("New width = %d", width); } + awn_task_manager_update_separator_position (task_manager); } === modified file 'src/awn-task.c' --- src/awn-task.c 2007-08-03 16:25:43 +0000 +++ src/awn-task.c 2007-08-05 14:07:19 +0000 @@ -1784,13 +1784,13 @@ if (priv->is_launcher) { char * icon_name = gnome_desktop_item_get_icon (priv->item, priv->settings->icon_theme ); if (!icon_name) - priv->icon = awn_x_get_icon_for_window (priv->window, width-6, width-6); + priv->icon = awn_x_get_icon_for_window (priv->window, width-12, width-12); else - priv->icon = icon_loader_get_icon_spec(icon_name, width-6, width-6); + priv->icon = icon_loader_get_icon_spec(icon_name, width-12, width-12); g_free (icon_name); } else { if (WNCK_IS_WINDOW (priv->window)) - priv->icon = awn_x_get_icon_for_window (priv->window, width-6, width-6); + priv->icon = awn_x_get_icon_for_window (priv->window, width-12, width-12); priv->reflect = gdk_pixbuf_flip (priv->icon,FALSE); }