Исправил задачу №11

pull/4/head
Igor Belitskiy 2 years ago
parent 49ef8210fa
commit 7b1a0075a6

@ -180,8 +180,11 @@ main_window *setup_window(){
widgets->LoadLocalMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem"); widgets->LoadLocalMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem");
widgets->LeftBox = yon_gtk_builder_get_widget(builder,"HeaderLeftBox"); widgets->LeftBox = yon_gtk_builder_get_widget(builder,"HeaderLeftBox");
widgets->DocumentationMenuItem = yon_gtk_builder_get_widget(builder,"DocumentationMenuItem"); widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL); // yon_gtk_builder_get_widget(builder,"DocumentationMenuItem");
widgets->AboutMenuItem = yon_gtk_builder_get_widget(builder,"AboutMenuItem"); widgets->AboutMenuItem = yon_ubl_menu_item_about_new(ABOUT_LABEL);
GtkWidget *menu = yon_gtk_builder_get_widget(builder,"menuAbout");
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem);
widgets->btnShowFilters = yon_gtk_builder_get_widget(builder,"btnShowFilters"); widgets->btnShowFilters = yon_gtk_builder_get_widget(builder,"btnShowFilters");
if (main_config.lock_load_global == 1){ if (main_config.lock_load_global == 1){

@ -1413,7 +1413,33 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
gtk_window_move(__yon_window_config_target_window,__yon_main_window_config.x,__yon_main_window_config.y); gtk_window_move(__yon_window_config_target_window,__yon_main_window_config.x,__yon_main_window_config.y);
gtk_window_resize(__yon_window_config_target_window,__yon_main_window_config.width,__yon_main_window_config.height); gtk_window_resize(__yon_window_config_target_window,__yon_main_window_config.width,__yon_main_window_config.height);
} }
GtkWidget *yon_ubl_menu_item_about_new(char *buttonname){
GtkWidget *menu_item = gtk_menu_item_new();
gtk_style_context_add_class(gtk_widget_get_style_context(menu_item),"menuitembottom");
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
GtkWidget *label = gtk_label_new(buttonname);
GtkWidget *image = gtk_image_new_from_icon_name("dialog-information-symbolic",GTK_ICON_SIZE_BUTTON);
gtk_label_set_xalign(GTK_LABEL(label),0.0);
gtk_box_pack_start(GTK_BOX(box),image,0,0,5);
gtk_box_pack_start(GTK_BOX(box),label,0,0,5);
gtk_container_add(GTK_CONTAINER(menu_item),box);
gtk_widget_show_all(menu_item);
return menu_item;
}
GtkWidget *yon_ubl_menu_item_documentation_new(char *buttonname){
GtkWidget *menu_item = gtk_menu_item_new();
gtk_style_context_add_class(gtk_widget_get_style_context(menu_item),"menuitemtop");
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
GtkWidget *label = gtk_label_new(buttonname);
GtkWidget *image = gtk_image_new_from_icon_name("dialog-question-symbolic",GTK_ICON_SIZE_BUTTON);
gtk_label_set_xalign(GTK_LABEL(label),0.0);
gtk_box_pack_start(GTK_BOX(box),image,0,0,5);
gtk_box_pack_start(GTK_BOX(box),label,0,0,5);
gtk_container_add(GTK_CONTAINER(menu_item),box);
gtk_widget_show_all(menu_item);
return menu_item;
}
int yon_gtk_combo_box_text_fill(GtkWidget *combo, config_str parameters,int size){ int yon_gtk_combo_box_text_fill(GtkWidget *combo, config_str parameters,int size){
if (combo&&parameters){ if (combo&&parameters){
for (int i=0;i<size;i++){ for (int i=0;i<size;i++){

@ -231,6 +231,10 @@ void yon_window_config_setup(GtkWindow *window);
int yon_window_config_load(char *path); int yon_window_config_load(char *path);
GtkWidget *yon_ubl_menu_item_about_new(char *buttonname);
GtkWidget *yon_ubl_menu_item_documentation_new(char *buttonname);
int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size); int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size);
int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find); int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find);

@ -51,68 +51,93 @@
} }
.menu:hover >* { .menu:hover >* {
border-color:alpha(@theme_text_color, 0.01); border-color:alpha(@theme_text_color, 0.01);
} }.menuitembottom{
.menuitembottom{ margin-top:0px;
margin-top:0px; margin-bottom:3px;
margin-bottom:3px; border-color:inherit;
} border-left-width:inherit;
.menuitemmiddle{ border-right-width:inherit;
margin-top:0px; }
margin-bottom:0px; .menuitemmiddle{
} margin-top:0px;
margin-bottom:0px;
.menuitemtop{ border-color:inherit;
margin-bottom:0px; border-left-width:inherit;
} border-right-width:inherit;
.menuitemtop *{ }
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
}
.menuitemmiddle *{
margin:0 2px 0 2px;
padding: 3px 10px 3px 5px;
}
.menuitembottom *{
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
}
.menuitemtop:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemmiddle:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitembottom:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
} .menuitemtop{
.menuitemtop:hover* { margin-bottom:0px;
margin:2px 2px 0 2px; border-color:inherit;
padding: 5px 10px 3px 5px; border-top-width:inherit;
background:@theme_selected_bg_color; border-left-width:inherit;
border-radius:2px; border-right-width:inherit;
} }
.menuitemmiddle:hover* { .menuitemtop *{
margin:0 2px 0 2px; margin:2px 2px 0 2px;
padding: 3px 10px 3px 5px; padding-top:2px;
background:@theme_selected_bg_color; padding-bottom:2px;
border-radius:2px; /* padding: 5px 0px 3px 5px; */
} border:transparent;
.menuitembottom:hover* { }
margin:0 2px 2px 2px; .menuitemmiddle *{
padding: 3px 10px 5px 5px; margin:0 2px 0 2px;
background:@theme_selected_bg_color; padding-top:2px;
border-radius:2px; padding-bottom:2px;
} /* padding: 3px 0px 3px 5px; */
border:transparent;
}
.menuitembottom *{
margin:0 2px 2px 2px;
padding-top:2px;
padding-bottom:2px;
/* padding: 3px 0px 5px 5px; */
}
.menuitemtop:hover {
background:@theme_bg_color;
border-color:inherit;
border-top-width:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemmiddle:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitembottom:hover {
background:@theme_bg_color;
border-color:inherit;
border-bottom-width:0px;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemtop:hover* {
margin:2px 2px 0 2px;
padding-top:2px;
padding-bottom:2px;
/* padding: 5px 0 3px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}
.menuitemmiddle:hover* {
margin:0 2px 0px 2px;
padding-top:2px;
padding-bottom:2px;
/* padding: 3px 0px 3px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}
.menuitembottom:hover* {
margin:0 2px 2px 2px;
padding-top:2px;
padding-bottom:2px;
/* padding: 3px 0px 5px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}
.workingbg, #workingbg { .workingbg, #workingbg {
background-color:@theme_base_color; background-color:@theme_base_color;

@ -2605,25 +2605,6 @@ translated and supported by community.</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="take-focus">False</property> <property name="take-focus">False</property>
<property name="reserve-toggle-size">False</property> <property name="reserve-toggle-size">False</property>
<child>
<object class="GtkMenuItem" id="DocumentationMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<style>
<class name="menuitemtop"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="AboutMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<style>
<class name="menuitemsolo"/>
<class name="menuitembottom"/>
</style>
</object>
</child>
</object> </object>
<object class="GtkMenu" id="menuLoad"> <object class="GtkMenu" id="menuLoad">
<property name="visible">True</property> <property name="visible">True</property>

Loading…
Cancel
Save