From 1ce8ee63197d1df824034c29cd1563c15e574173 Mon Sep 17 00:00:00 2001 From: Orangerot Date: Wed, 5 Apr 2023 23:35:32 +0200 Subject: [PATCH] now spanning the whole desktop and transparent --- dicons.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dicons.c b/dicons.c index 3c231a4..4f17f52 100644 --- a/dicons.c +++ b/dicons.c @@ -68,12 +68,9 @@ static void activate_cb(GtkIconView *icon_view, GtkTreePath *tree_path, gpointer char* file_uri; store = GTK_LIST_STORE (user_data); - gtk_tree_model_get_iter (GTK_TREE_MODEL (store), - &iter, tree_path); + gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, tree_path); - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, - COL_FILE, &file, - -1); + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_FILE, &file, -1); file_uri = g_file_get_uri(file); printf("uri %s\n", file_uri); @@ -85,17 +82,26 @@ static void activate (GtkApplication* app, gpointer user_data) { GtkWidget *window, *icon_view; GtkListStore *model; + GdkScreen *screen; window = gtk_application_window_new(app); gtk_window_set_title(GTK_WINDOW (window), "Window"); - gtk_window_set_default_size(GTK_WINDOW (window), 200, 200); gtk_layer_init_for_window(GTK_WINDOW(window)); gtk_layer_set_layer(GTK_WINDOW(window), GTK_LAYER_SHELL_LAYER_BOTTOM); + for (int anchor = 0; anchor < 4; anchor++) + gtk_layer_set_anchor(GTK_WINDOW(window), anchor, 1); + + gtk_layer_set_margin(GTK_WINDOW(window), GTK_LAYER_SHELL_EDGE_TOP, 20); + model = create_desktop_list(); icon_view = gtk_icon_view_new_with_model(GTK_TREE_MODEL(model)); + gtk_widget_override_background_color(icon_view, 0, &(GdkRGBA){0,0,0,0}); + gtk_widget_override_background_color(window, 0, &(GdkRGBA){0,0,0,0}); + + gtk_icon_view_set_item_width(GTK_ICON_VIEW(icon_view), 96); gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view), GTK_SELECTION_MULTIPLE); gtk_icon_view_set_text_column(GTK_ICON_VIEW (icon_view), COL_DISPLAY_NAME);