all repos — tint2 @ 3e03e81dbf3beeef3ccf564a896d65feba3e5900

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

tint2conf: Display themes consistently
o9000 mrovi9000@gmail.com
commit

3e03e81dbf3beeef3ccf564a896d65feba3e5900

parent

9150a180fa827f6245a9424d2c6d6032c94d56c6

4 files changed, 19 insertions(+), 13 deletions(-)

jump to
M ChangeLogChangeLog

@@ -5,7 +5,11 @@ - Extra tint2rc themes are installed to /usr/share/tint2 and available in tint2conf

- Tint2conf GUI improvements - Config options with changed behavior: - The launcher now also allows launcher_item_app entries without a full path. - In this case the .desktop file is searched in the standard application directories. + In this case the .desktop file is searched in the standard application directories (issue #565). + - If the panel size is given as a percentage and a non-zero margin is also specified, + the size is now computed as a fraction of the available size (i.e. monitor size - margin). + Before it was computed as a fraction of the monitor size first, then the margin was subtracted from the value, which + was not intuitive (issue #559). - Fixes: - Taskbar icons are now resized correctly for certain geometries (issue #560) - Fix get_version.sh so that it returns the correct version when .git is missing
M src/tint2conf/main.csrc/tint2conf/main.c

@@ -117,7 +117,7 @@

gchar *newpath = g_build_filename(g_get_user_config_dir(), "tint2", filename, NULL); if (!g_file_test(newpath, G_FILE_TEST_EXISTS)) { copy_file(filepath, newpath); - theme_list_append(newpath, NULL); + theme_list_append(newpath); g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL); }

@@ -136,7 +136,7 @@ copy_file(filepath, newpath);

if (theme_is_editable(newpath)) { if (!theme_existed) { - theme_list_append(newpath, NULL); + theme_list_append(newpath); g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL); } else { int unused = system("killall -SIGUSR1 tint2 || pkill -SIGUSR1 -x tint2");

@@ -708,7 +708,7 @@ if (!g_file_test(file_name, G_FILE_TEST_IS_DIR) && !strstr(file_name, "backup") && !strstr(file_name, "copy") &&

!strstr(file_name, "~") && (endswith(file_name, "tint2rc") || endswith(file_name, ".conf"))) { found_theme = TRUE; gchar *path = g_build_filename(tint2_config_dir, file_name, NULL); - theme_list_append(path, NULL); + theme_list_append(path); g_free(path); } }

@@ -732,7 +732,7 @@ !strstr(file_name, "copy") && !strstr(file_name, "~") &&

(endswith(file_name, "tint2rc") || endswith(file_name, ".conf"))) { found_theme = TRUE; gchar *path = g_build_filename(path_tint2, file_name, NULL); - theme_list_append(path, dirs[i]); + theme_list_append(path); g_free(path); } }
M src/tint2conf/theme_view.csrc/tint2conf/theme_view.c

@@ -20,6 +20,7 @@

#include "main.h" #include "strnatcmp.h" #include "theme_view.h" +#include "common.h" // The data columns that we export via the tree model interface GtkWidget *g_theme_view;

@@ -136,7 +137,7 @@ }

return FALSE; } -void theme_list_append(const gchar *path, const gchar *suffix) +void theme_list_append(const gchar *path) { if (theme_list_contains(path)) return;

@@ -146,14 +147,15 @@ gtk_list_store_append(theme_list_store, &iter);

gchar *name = strrchr(path, '/') + 1; - gchar *display_name; - if (suffix) { - display_name = g_strdup_printf("%s\n(%s)", name, suffix); - } else { - display_name = g_strdup(name); - } + gchar *dir = g_strdup(path); + strrchr(dir, '/')[0] = 0; + char *suffix = contract_tilde(dir); + g_free(dir); + + gchar *display_name = g_strdup_printf("%s\n(%s)", name, suffix); gtk_list_store_set(theme_list_store, &iter, COL_THEME_FILE, path, COL_THEME_NAME, display_name, -1); g_free(display_name); + g_free(suffix); }
M src/tint2conf/theme_view.hsrc/tint2conf/theme_view.h

@@ -9,6 +9,6 @@ enum { COL_THEME_FILE = 0, COL_THEME_NAME, COL_SNAPSHOT, NB_COL, };

GtkWidget *create_view(); -void theme_list_append(const gchar *path, const gchar *suffix); +void theme_list_append(const gchar *path); #endif