Added the single_click config option

This commit is contained in:
Scoopta
2022-07-13 21:36:38 -07:00
parent 49d41d0497
commit a3a8f3c3f9
2 changed files with 7 additions and 3 deletions

View File

@@ -105,6 +105,7 @@ static pthread_t mode_thread;
static bool has_joined_mode = false;
static char* copy_exec = NULL;
static char* pre_display_cmd = NULL;
static bool single_click = false;
static struct map* keys;
@@ -583,7 +584,7 @@ static gboolean _insert_widget(gpointer data) {
gtk_expander_set_label_widget(GTK_EXPANDER(parent), box);
GtkWidget* exp_box = gtk_list_box_new();
gtk_list_box_set_activate_on_single_click(GTK_LIST_BOX(exp_box), FALSE);
gtk_list_box_set_activate_on_single_click(GTK_LIST_BOX(exp_box), single_click);
g_signal_connect(exp_box, "row-activated", G_CALLBACK(activate_item), NULL);
gtk_container_add(GTK_CONTAINER(parent), exp_box);
for(size_t count = 1; count < node->action_count; ++count) {
@@ -1620,8 +1621,8 @@ void wofi_init(struct map* _config) {
char* monitor = map_get(config, "monitor");
char* layer = config_get(config, "layer", "top");
copy_exec = config_get(config, "copy_exec", "wl-copy");
pre_display_cmd = map_get(config, "pre_display_cmd");
single_click = strcmp(config_get(config, "single_click", "false"), "true") == 0;
keys = map_init_void();
@@ -1792,7 +1793,7 @@ void wofi_init(struct map* _config) {
gtk_widget_set_valign(inner_box, valign);
gtk_widget_set_name(inner_box, "inner-box");
gtk_flow_box_set_activate_on_single_click(GTK_FLOW_BOX(inner_box), FALSE);
gtk_flow_box_set_activate_on_single_click(GTK_FLOW_BOX(inner_box), single_click);
GtkWidget* wrapper_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_set_homogeneous(GTK_BOX(wrapper_box), TRUE);