Inspector window last used button outline

pull/80/head
Ivan Yartsev 2 years ago
parent 4ec310122a
commit 8f3c97b863

@ -349,46 +349,62 @@ void on_inspector_update(GtkWidget *self, inspector_window *window){
config_str output; config_str output;
if (!strcmp(window->journal_name,"journald")){ if (!strcmp(window->journal_name,"journald")){
if(self!=window->UpdateButton){ if(self!=window->UpdateButton){
gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowKernelButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowKernelButton),"chosenOutline");
gtk_style_context_remove_class(gtk_widget_get_style_context(window->NewMessagesButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->NewMessagesButton),"chosenOutline");
gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowAllBootsButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowAllBootsButton),"chosenOutline");
gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowAllUnitsButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowAllUnitsButton),"chosenOutline");
gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowInitTreeButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowInitTreeButton),"chosenOutline");
gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowPriorityButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowPriorityButton),"chosenOutline");
gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowKernelButton,1);
gtk_widget_set_sensitive(window->NewMessagesButton,1);
gtk_widget_set_sensitive(window->ShowAllBootsButton,1);
gtk_widget_set_sensitive(window->ShowAllUnitsButton,1);
gtk_widget_set_sensitive(window->ShowInitTreeButton,1);
gtk_widget_set_sensitive(window->ShowPriorityButton,1);
gtk_widget_set_sensitive(window->ShowSinceBootButton,1);
} }
GtkWidget *terminal = (GtkWidget*)window->terminals->first->data; GtkWidget *terminal = (GtkWidget*)window->terminals->first->data;
gtk_widget_hide(window->LoggingNotebook); gtk_widget_hide(window->LoggingNotebook);
gtk_widget_show(gtk_widget_get_parent(window->JournaldTree)); gtk_widget_show(gtk_widget_get_parent(window->JournaldTree));
if (window->last_mode==0)
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"boxInfoMessOK");
if (self==window->ShowSinceBootButton){ if (self==window->ShowSinceBootButton){
window->last_mode=1; window->last_mode=1;
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowSinceBootButton,0);
} }
else if (self==window->NewMessagesButton){ else if (self==window->NewMessagesButton){
window->last_mode=2; window->last_mode=2;
gtk_style_context_add_class(gtk_widget_get_style_context(window->NewMessagesButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->NewMessagesButton),"chosenOutline");
gtk_widget_set_sensitive(window->NewMessagesButton,0);
} }
else if (self==window->ShowKernelButton){ else if (self==window->ShowKernelButton){
window->last_mode=3; window->last_mode=3;
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowKernelButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowKernelButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowKernelButton,0);
} }
else if (self==window->ShowPriorityButton){ else if (self==window->ShowPriorityButton){
window->last_mode=4; window->last_mode=4;
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowPriorityButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowPriorityButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowPriorityButton,0);
} }
else if (self==window->ShowAllBootsButton){ else if (self==window->ShowAllBootsButton){
window->last_mode=5; window->last_mode=5;
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowAllBootsButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowAllBootsButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowAllBootsButton,0);
} }
else if (self==window->ShowAllUnitsButton){ else if (self==window->ShowAllUnitsButton){
window->last_mode=6; window->last_mode=6;
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowAllUnitsButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowAllUnitsButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowAllUnitsButton,0);
} }
else if (self==window->ShowInitTreeButton){ else if (self==window->ShowInitTreeButton){
window->last_mode=7; window->last_mode=7;
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowInitTreeButton),"boxInfoMessOK"); gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowInitTreeButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowInitTreeButton,0);
}
else if (window->last_mode==0){
gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"chosenOutline");
gtk_widget_set_sensitive(window->ShowSinceBootButton,0);
} }
main_config.remove_thread=0; main_config.remove_thread=0;
gtk_tree_view_set_model(GTK_TREE_VIEW(window->JournaldTree),GTK_TREE_MODEL(window->list)); gtk_tree_view_set_model(GTK_TREE_VIEW(window->JournaldTree),GTK_TREE_MODEL(window->list));

@ -120,3 +120,10 @@ background:transparent;
border-color: #ea9999; border-color: #ea9999;
border-style:solid; border-style:solid;
} }
.chosenOutline{
transition: 0ms;
border-width: 2px;
border-color: #f3f0ac;
border-style:solid;
}
Loading…
Cancel
Save