Removed the need to use gtk_widget_get_child_visible()
This commit is contained in:
parent
4d089df33d
commit
91ad565ecc
12
src/wofi.c
12
src/wofi.c
@ -741,7 +741,7 @@ static void select_item(GtkFlowBox* flow_box, gpointer data) {
|
|||||||
static void activate_search(GtkEntry* entry, gpointer data) {
|
static void activate_search(GtkEntry* entry, gpointer data) {
|
||||||
(void) data;
|
(void) data;
|
||||||
GtkFlowBoxChild* child = gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(inner_box), 0);
|
GtkFlowBoxChild* child = gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(inner_box), 0);
|
||||||
gboolean is_visible = gtk_widget_get_child_visible(GTK_WIDGET(child));
|
gboolean is_visible = gtk_widget_get_visible(GTK_WIDGET(child));
|
||||||
if(mode != NULL && (exec_search || child == NULL || !is_visible)) {
|
if(mode != NULL && (exec_search || child == NULL || !is_visible)) {
|
||||||
execute_action(mode, gtk_entry_get_text(entry));
|
execute_action(mode, gtk_entry_get_text(entry));
|
||||||
} else if(child != NULL) {
|
} else if(child != NULL) {
|
||||||
@ -754,8 +754,7 @@ static void activate_search(GtkEntry* entry, gpointer data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean do_filter(GtkFlowBoxChild* row, gpointer data) {
|
static gboolean filter_proxy(GtkFlowBoxChild* row) {
|
||||||
(void) data;
|
|
||||||
GtkWidget* box = gtk_bin_get_child(GTK_BIN(row));
|
GtkWidget* box = gtk_bin_get_child(GTK_BIN(row));
|
||||||
if(GTK_IS_EXPANDER(box)) {
|
if(GTK_IS_EXPANDER(box)) {
|
||||||
box = gtk_expander_get_label_widget(GTK_EXPANDER(box));
|
box = gtk_expander_get_label_widget(GTK_EXPANDER(box));
|
||||||
@ -774,6 +773,13 @@ static gboolean do_filter(GtkFlowBoxChild* row, gpointer data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean do_filter(GtkFlowBoxChild* row, gpointer data) {
|
||||||
|
(void) data;
|
||||||
|
gboolean ret = filter_proxy(row);
|
||||||
|
gtk_widget_set_visible(GTK_WIDGET(row), ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static gint fuzzy_sort(const gchar* text1, const gchar* text2) {
|
static gint fuzzy_sort(const gchar* text1, const gchar* text2) {
|
||||||
char* _filter = strdup(filter);
|
char* _filter = strdup(filter);
|
||||||
size_t len = strlen(_filter);
|
size_t len = strlen(_filter);
|
||||||
|
Loading…
Reference in New Issue
Block a user