summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-05-18 15:52:35 +0100
committerAlastair Poole <netstar@gmail.com>2020-05-18 15:52:35 +0100
commit1532038b5d8cb958e3e625d2a8ea41a2f72eaf62 (patch)
tree67490dbef863b4b26babd19935d30d56a74d3bd0
parented6948061939a2bd19f7d3e6d11de5deb895849d (diff)
process_viewer: improve visual.
-rw-r--r--src/bin/ui/ui_process_view.c58
1 files changed, 39 insertions, 19 deletions
diff --git a/src/bin/ui/ui_process_view.c b/src/bin/ui/ui_process_view.c
index 73fe2dc..531cb29 100644
--- a/src/bin/ui/ui_process_view.c
+++ b/src/bin/ui/ui_process_view.c
@@ -461,21 +461,21 @@ _label_add(Evas_Object *parent, const char *text)
461static Evas_Object * 461static Evas_Object *
462_process_tab_add(Evas_Object *parent, Ui_Process *ui) 462_process_tab_add(Evas_Object *parent, Ui_Process *ui)
463{ 463{
464 Evas_Object *hbox, *scroller, *table; 464 Evas_Object *frame, *hbox, *table;
465 Evas_Object *label, *entry, *button, *border; 465 Evas_Object *label, *entry, *button, *border;
466 int i = 0; 466 int i = 0;
467 467
468 frame = elm_frame_add(parent);
469 elm_object_text_set(frame, _("General"));
470 evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
471 evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
472 evas_object_show(frame);
473
468 table = elm_table_add(parent); 474 table = elm_table_add(parent);
469 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 475 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
470 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL); 476 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
471 evas_object_show(ui->content); 477 evas_object_show(table);
472 478 elm_object_content_set(frame, table);
473 scroller = elm_scroller_add(parent);
474 evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
475 evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
476 elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
477 evas_object_show(scroller);
478 elm_object_content_set(scroller, table);
479 479
480 label = _label_add(parent, _("Command:")); 480 label = _label_add(parent, _("Command:"));
481 elm_table_pack(table, label, 0, i, 1, 1); 481 elm_table_pack(table, label, 0, i, 1, 1);
@@ -561,7 +561,7 @@ _process_tab_add(Evas_Object *parent, Ui_Process *ui)
561 evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); 561 evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
562 elm_box_horizontal_set(hbox, EINA_TRUE); 562 elm_box_horizontal_set(hbox, EINA_TRUE);
563 evas_object_show(hbox); 563 evas_object_show(hbox);
564 elm_table_pack(table, hbox, 1, i, 2, 1); 564 elm_table_pack(table, hbox, 0, i, 2, 1);
565 565
566 border = elm_frame_add(parent); 566 border = elm_frame_add(parent);
567 evas_object_size_hint_weight_set(border, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 567 evas_object_size_hint_weight_set(border, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -571,7 +571,7 @@ _process_tab_add(Evas_Object *parent, Ui_Process *ui)
571 elm_box_pack_end(hbox, border); 571 elm_box_pack_end(hbox, border);
572 572
573 border = elm_frame_add(parent); 573 border = elm_frame_add(parent);
574 evas_object_size_hint_weight_set(border, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 574 evas_object_size_hint_weight_set(border, 0.2, EVAS_HINT_EXPAND);
575 evas_object_size_hint_align_set(border, EVAS_HINT_FILL, 0.5); 575 evas_object_size_hint_align_set(border, EVAS_HINT_FILL, 0.5);
576 elm_object_style_set(border, "pad_small"); 576 elm_object_style_set(border, "pad_small");
577 evas_object_show(border); 577 evas_object_show(border);
@@ -586,7 +586,7 @@ _process_tab_add(Evas_Object *parent, Ui_Process *ui)
586 elm_box_pack_end(hbox, border); 586 elm_box_pack_end(hbox, border);
587 587
588 border = elm_frame_add(parent); 588 border = elm_frame_add(parent);
589 evas_object_size_hint_weight_set(border, EVAS_HINT_EXPAND, 0); 589 evas_object_size_hint_weight_set(border, 0.2, EVAS_HINT_EXPAND);
590 evas_object_size_hint_align_set(border, EVAS_HINT_FILL, 0.5); 590 evas_object_size_hint_align_set(border, EVAS_HINT_FILL, 0.5);
591 elm_object_style_set(border, "pad_small"); 591 elm_object_style_set(border, "pad_small");
592 evas_object_show(border); 592 evas_object_show(border);
@@ -601,7 +601,7 @@ _process_tab_add(Evas_Object *parent, Ui_Process *ui)
601 evas_object_smart_callback_add(button, "clicked", _btn_start_clicked_cb, ui); 601 evas_object_smart_callback_add(button, "clicked", _btn_start_clicked_cb, ui);
602 602
603 border = elm_frame_add(parent); 603 border = elm_frame_add(parent);
604 evas_object_size_hint_weight_set(border, EVAS_HINT_EXPAND, 0.1); 604 evas_object_size_hint_weight_set(border, 0.2, EVAS_HINT_EXPAND);
605 evas_object_size_hint_align_set(border, EVAS_HINT_FILL, 0.5); 605 evas_object_size_hint_align_set(border, EVAS_HINT_FILL, 0.5);
606 elm_object_style_set(border, "pad_small"); 606 elm_object_style_set(border, "pad_small");
607 evas_object_show(border); 607 evas_object_show(border);
@@ -612,10 +612,11 @@ _process_tab_add(Evas_Object *parent, Ui_Process *ui)
612 elm_object_text_set(button, _("Kill")); 612 elm_object_text_set(button, _("Kill"));
613 elm_box_pack_end(hbox, border); 613 elm_box_pack_end(hbox, border);
614 evas_object_show(button); 614 evas_object_show(button);
615
615 elm_object_content_set(border, button); 616 elm_object_content_set(border, button);
616 evas_object_smart_callback_add(button, "clicked", _btn_kill_clicked_cb, ui); 617 evas_object_smart_callback_add(button, "clicked", _btn_kill_clicked_cb, ui);
617 618
618 return scroller; 619 return frame;
619} 620}
620 621
621static void 622static void
@@ -701,11 +702,18 @@ _btn_cpu_usage_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
701static Evas_Object * 702static Evas_Object *
702_threads_tab_add(Evas_Object *parent, Ui_Process *ui) 703_threads_tab_add(Evas_Object *parent, Ui_Process *ui)
703{ 704{
704 Evas_Object *box, *hbox, *btn, *genlist; 705 Evas_Object *frame, *box, *hbox, *btn, *genlist;
706
707 frame = elm_frame_add(parent);
708 evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
709 evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
710 elm_object_text_set(frame, _("Threads"));
705 711
706 box = elm_box_add(parent); 712 box = elm_box_add(parent);
707 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 713 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
708 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); 714 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
715 evas_object_show(box);
716 elm_object_content_set(frame, box);
709 717
710 hbox = elm_box_add(box); 718 hbox = elm_box_add(box);
711 evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0); 719 evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0);
@@ -772,17 +780,24 @@ _threads_tab_add(Evas_Object *parent, Ui_Process *ui)
772 elm_box_pack_end(box, hbox); 780 elm_box_pack_end(box, hbox);
773 elm_box_pack_end(box, genlist); 781 elm_box_pack_end(box, genlist);
774 782
775 return box; 783 return frame;
776} 784}
777 785
778static Evas_Object * 786static Evas_Object *
779_info_tab_add(Evas_Object *parent, Ui_Process *ui) 787_info_tab_add(Evas_Object *parent, Ui_Process *ui)
780{ 788{
781 Evas_Object *box, *entry; 789 Evas_Object *frame, *box, *entry;
790
791 frame = elm_frame_add(parent);
792 evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
793 evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
794 elm_object_text_set(frame, _("Documentation"));
782 795
783 box = elm_box_add(parent); 796 box = elm_box_add(parent);
784 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 797 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
785 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); 798 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
799 evas_object_show(box);
800 elm_object_content_set(frame, box);
786 801
787 ui->entry_info = entry = elm_entry_add(box); 802 ui->entry_info = entry = elm_entry_add(box);
788 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 803 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -794,7 +809,7 @@ _info_tab_add(Evas_Object *parent, Ui_Process *ui)
794 evas_object_show(entry); 809 evas_object_show(entry);
795 elm_box_pack_end(box, entry); 810 elm_box_pack_end(box, entry);
796 811
797 return box; 812 return frame;
798} 813}
799 814
800static void 815static void
@@ -867,6 +882,12 @@ _btn_info_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
867 882
868 eina_list_free(lines); 883 eina_list_free(lines);
869 } 884 }
885 else
886 {
887 elm_object_text_set(ui->entry_info, eina_slstr_printf(_("No documentation found for %s."),
888 ui->selected_cmd));
889 }
890
870 ui->info_init = EINA_TRUE; 891 ui->info_init = EINA_TRUE;
871} 892}
872 893
@@ -986,7 +1007,6 @@ ui_process_win_add(int pid, const char *cmd)
986 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ui); 1007 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ui);
987 evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, ui); 1008 evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, ui);
988 elm_win_center(win, EINA_TRUE, EINA_TRUE); 1009 elm_win_center(win, EINA_TRUE, EINA_TRUE);
989 evas_object_resize(win, 540 * elm_config_scale_get(), 480 * elm_config_scale_get());
990 evas_object_show(win); 1010 evas_object_show(win);
991 1011
992 ui->cache = evisum_ui_item_cache_new(ui->genlist_threads, _item_create, 10); 1012 ui->cache = evisum_ui_item_cache_new(ui->genlist_threads, _item_create, 10);