Hat visual height srinked by recoloring box background

pull/62/head
parent aeb9bbb0a2
commit 612baa543b

@ -876,6 +876,46 @@ config_str yon_ubl_get_all_slices(int *slices_size){
// parsing functions // parsing functions
dictionary *yon_scan_desktops(){
dictionary *apps_dict = NULL;
DIR *directory = opendir(DesktopPath);
struct dirent *de;
while ((de = readdir(directory)))
{
FILE *file;
char *path = yon_char_append(DesktopPath, de->d_name);
file = fopen(path, "r");
if (strstr(path,".desktop")){
apps *application = malloc(sizeof(apps));
GKeyFile *gfile = g_key_file_new();
GError *err = NULL;
if (!access(path,F_OK)){
g_key_file_load_from_file(gfile, path, G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
application->Type = !strcmp(g_key_file_get_string(gfile, "Desktop Entry", "Type", &err),"Application") ? 1 : 0;
if (application->Type){
application->Name = g_key_file_get_locale_string(gfile,"Desktop Entry", "Name",setlocale(LC_ALL, NULL),&err);
application->Categories = g_key_file_get_string(gfile,"Desktop Entry", "Categories",&err);
application->Exec = g_key_file_get_string(gfile,"Desktop Entry", "Exec",&err);
application->Icon = g_key_file_get_string(gfile,"Desktop Entry", "Icon",&err);
application->Pluggable = (g_key_file_get_boolean(gfile,"Desktop Entry", "Pluggable",NULL)||
g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",&err));
application->DualPluggable = g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL);
application->Hidden = g_key_file_get_boolean(gfile,"Desktop Entry", "X-X-UBL-SettingsManager-Hidden",NULL);
if (application->Name&&application->Exec){
if (!apps_dict){
yon_dictionary_add_or_create_if_exists_with_data(apps_dict,application->Name,application);
} else if (!yon_dictionary_get(&apps_dict,application->Name)){
yon_dictionary_add_or_create_if_exists_with_data(apps_dict,application->Name,application);
} else {
yon_dictionary_set_data(apps_dict,application);
}
}
}
}
}
}
if (apps_dict) return apps_dict;
}
apps *yon_apps_scan_and_parse_desktops(int *sizef) apps *yon_apps_scan_and_parse_desktops(int *sizef)
{ {
@ -956,6 +996,7 @@ apps *yon_apps_scan_and_parse_desktops(int *sizef)
size++; size++;
} }
} }
g_key_file_free(gfile);
} }
} }
} }
@ -1004,6 +1045,9 @@ void __yon_on_app_chooser_selection(GtkTreeView *self, GtkTreeStore *store){
if (gtk_tree_model_iter_nth_child(model,&parentiter,&iter,0)) if (gtk_tree_model_iter_nth_child(model,&parentiter,&iter,0))
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(self),&parentiter); gtk_tree_selection_select_iter(gtk_tree_view_get_selection(self),&parentiter);
} }
} else {
gtk_tree_model_get_iter_first(model,&iter);
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(self),&iter);
} }
} }
@ -1027,7 +1071,7 @@ char *yon_app_chooser_open_with_sections(char *section_name, char *section_filte
g_object_ref(box); g_object_ref(box);
gtk_container_remove(GTK_CONTAINER(window),box); gtk_container_remove(GTK_CONTAINER(window),box);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),box,1,1,5); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),box,1,1,5);
(gtk_dialog_get_content_area(GTK_DIALOG(dialog)),0); gtk_style_context_add_class(gtk_widget_get_style_context(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),"workingbg");
GtkWidget *main_tree = GTK_WIDGET(gtk_builder_get_object(builder,"MainTree")); GtkWidget *main_tree = GTK_WIDGET(gtk_builder_get_object(builder,"MainTree"));
GtkTreeStore *store = GTK_TREE_STORE(gtk_builder_get_object(builder,"treestore1")); GtkTreeStore *store = GTK_TREE_STORE(gtk_builder_get_object(builder,"treestore1"));
va_list args; va_list args;

@ -73,6 +73,7 @@ typedef struct apps
char *Icon; char *Icon;
int Pluggable; int Pluggable;
int DualPluggable; int DualPluggable;
int Hidden;
} apps; } apps;
typedef char** config_str; typedef char** config_str;
@ -188,6 +189,8 @@ config_str yon_ubl_get_all_slices(int *slices_size);
config_str philos_list_user(int* size); config_str philos_list_user(int* size);
dictionary *yon_scan_desktops();
apps *yon_apps_scan_and_parse_desktops(int *sizef); apps *yon_apps_scan_and_parse_desktops(int *sizef);
void yon_apps_sort(apps *applist, int size); void yon_apps_sort(apps *applist, int size);

@ -27,7 +27,6 @@
<object class="GtkScrolledWindow"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child> <child>
<object class="GtkTreeView" id="MainTree"> <object class="GtkTreeView" id="MainTree">
<property name="visible">True</property> <property name="visible">True</property>
@ -35,6 +34,9 @@
<property name="model">treestore1</property> <property name="model">treestore1</property>
<property name="headers-visible">False</property> <property name="headers-visible">False</property>
<property name="expander-column">treeviewcolumn1</property> <property name="expander-column">treeviewcolumn1</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1"> <object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">column</property> <property name="title" translatable="yes">column</property>

Loading…
Cancel
Save