Glade theme improvements

pull/2/head
parent 8d04baf493
commit 80bb999a56

@ -36,7 +36,7 @@ int cmld=0;
void on_plug_added(GtkSocket* self, actionWidgets *builder){
printf("Plug has been added!\n");
//printf("Plug has been added!\n");
gtk_widget_set_vexpand(builder->HideWhileLaunch,0);
gtk_widget_hide(builder->HideWhileLaunch);
gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1);
@ -54,12 +54,12 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){
//gtk_widget_hide(widgets->socketplace);
gtk_widget_set_vexpand(widgets->socketplace,0);
gtk_widget_set_vexpand(widgets->HideWhileLaunch,1);
printf("Plug has been removed!\n\n\n");
//printf("Plug has been removed!\n\n\n");
}
void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){
printf("\n\n\nActivated\n\n\n");
//printf("\n\n\nActivated\n\n\n");
GtkTreeIter iter;
char *name;
gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path);
@ -98,11 +98,11 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets
memset(arg,0,100);
sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)));
if (tempapp[0].Type==1)
if (tempapp[0].Type==2)
if (tempapp->Pluggable==1)
py_launch_app(tempapp[0].Exec,arg);
else py_launch_app(tempapp[0].Exec,"");
else{
else if (tempapp[0].Type==1){
if (tempapp->Pluggable==1)
launch_app_with_arguments(tempapp[0].Exec,arg);
else launch_app(tempapp[0].Exec);
@ -153,7 +153,7 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){
};
int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
printf("Saving config...\n");
//printf("Saving config...\n");
actionWidgets *widgets=(actionWidgets*)widgetsD->data;
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY);
@ -228,7 +228,7 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi
if (position <115) position=115;
double pos=((double)position-(1/(double)position*4)*500)/1.8;
if (pos<110) pos=110;
printf("Paned moved to %f\n",pos);
//printf("Paned moved to %f\n",pos);
for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){
IVGraphicals *IV=(IVGraphicals*)dict->data;
gtk_icon_view_set_item_width(GTK_ICON_VIEW(IV->IV),pos);
@ -1015,7 +1015,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){
if (main_config.WindowTheme==1) {
gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1);
gtk_widget_set_name(iv,"GnomeIcon");
gtk_icon_view_set_activate_on_single_click(GTK_ICON_VIEW(iv),1);
gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL);
}
@ -1110,7 +1110,10 @@ int yon_show_icon_views(dictionary *IVS,actionWidgets *widgets){
IVGraphicals *iv=dct->data;
gtk_widget_show_all(iv->Box);
gtk_box_pack_start(GTK_BOX(widgets->icvpack),iv->Box,FALSE,FALSE,0);
g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_Item_activated),widgets);
if (main_config.WindowTheme==0)
g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_Item_activated),widgets);
else if (main_config.WindowTheme==1)
g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_gnome_Item_activated),widgets);
g_signal_connect(G_OBJECT(iv->IV),"selection-changed",G_CALLBACK(on_item_selection_changed),widgets);
}
@ -1203,34 +1206,12 @@ SectionSettingSegment *yon_create_section_setting(char *name, char *categories){
gtk_widget_set_margin_top(segment->DragButtonBox,3);
gtk_widget_set_margin_end(segment->DragUpButton,3);
// gtk_widget_set_halign(segment->ElemBox,GTK_ALIGN_FILL);
// gtk_widget_set_halign(segment->NameBox,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->CategoriesBox,GTK_ALIGN_START);
gtk_widget_set_halign(segment->NameEntry,GTK_ALIGN_START);
gtk_widget_set_halign(segment->NameLabel,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->CategoriesEntry,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->CategoriesLabel,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->EditButtonAccept,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->EditButtonBox,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->EditButtonCancel,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->ButtonEdit,GTK_ALIGN_END);
// gtk_widget_set_valign(segment->ElemBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->NameBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->CategoriesBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->NameEntry,GTK_ALIGN_START);
// gtk_widget_set_valign(segment->NameLabel,GTK_ALIGN_START);
// gtk_widget_set_valign(segment->CategoriesEntry,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->CategoriesLabel,GTK_ALIGN_CENTER);
gtk_widget_set_valign(segment->OptionBox,GTK_ALIGN_CENTER);
gtk_label_set_xalign(GTK_LABEL(segment->NameLabel),0);
gtk_label_set_xalign(GTK_LABEL(segment->CategoriesLabel),0);
// gtk_widget_set_hexpand(segment->ElemBox,1);
// gtk_widget_set_hexpand(segment->NameEntry,1);
// gtk_widget_set_hexpand(segment->NameLabel,1);
// gtk_widget_set_hexpand(segment->CategoriesEntry,1);
// gtk_widget_set_hexpand(segment->CategoriesLabel,1);
gtk_widget_set_vexpand(segment->ElemBox,0);
gtk_widget_set_vexpand(segment->NameBox,0);
@ -1281,9 +1262,6 @@ void yon_segments_hide(actionWidgets *widgets){
for (dictionary *dict=widgets->SettingsSections->first;dict!=NULL;dict=dict->next){
SectionSettingSegment *sgm=(SectionSettingSegment*)dict->data;
if (sgm!=NULL){
//GKeyFile *gfile=g_key_file_new();
//g_key_file_load_from_file(gfile,".config/ubconfig-main/ubconfig-main.conf",G_KEY_FILE_NONE,NULL);
//g_key_file_set_string(gfile,"sections",gtk_label_get_text(GTK_LABEL(sgm->NameLabel)),gtk_label_get_text(GTK_LABEL(sgm->CategoriesLabel)));
g_object_ref(G_OBJECT(sgm->MainFrame));
gtk_container_remove(GTK_CONTAINER(widgets->SectionSettingsPack),sgm->MainFrame);
} else return;
@ -1331,12 +1309,13 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_
sysinfo(&info);
char lbl[2000];
memset(lbl,0,2000);
double mind=(double)info.uptime/60; // 13=x*60/100
double mind=(double)info.uptime/60;
while(mind>60) mind-=60;
int minutes=mind;
sprintf(lbl,"Система: UBLinux\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB",sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.freeram/1024/1024,info.totalram/1024/1024);
sprintf(lbl,"Система: UBLinux\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB\nЗапущенные процессы: %d\nСредняя загруженность процессора за 15 минут: %d%%\n",sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.freeram/1024/1024,info.totalram/1024/1024,info.procs,info.loads[2]/1000);
gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoLabel),lbl);
printf("\n\n%d\n\n",info.totalram/1024/1024);
printf("\n\n%d\n\n",info.freeram/1024/1024);
//printf("\n\n%d\n\n",info.totalram/1024/1024);
//printf("\n\n%d\n\n",info.freeram/1024/1024);
}
if (curWidgets->ButtonBackToMain!=NULL)

Loading…
Cancel
Save