summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-06-30 11:28:20 +0100
committerAlastair Poole <netstar@gmail.com>2020-06-30 11:28:20 +0100
commit4df3d73fe01103d8d44534843ef84f170fbf36e4 (patch)
tree76d4d2facf2115c8efa8ebe52208560ea5b87719
parent045f1766b52e88240d410e83739622d1de858857 (diff)
ui: Fonts and Sorting.
Fonts should be normal sized. If fonts aren't looking good, just bump up the overall ELM scaling, it works much better! Indicate which sort we are using in the process list.
-rw-r--r--data/images/go-down.pngbin1470 -> 2440 bytes
-rw-r--r--data/images/go-up.pngbin1580 -> 2358 bytes
-rw-r--r--src/bin/ui/ui.c68
-rw-r--r--src/bin/ui/ui_disk.c4
-rw-r--r--src/bin/ui/ui_memory.c2
-rw-r--r--src/bin/ui/ui_misc.c10
-rw-r--r--src/bin/ui/ui_process_view.c1
7 files changed, 61 insertions, 24 deletions
diff --git a/data/images/go-down.png b/data/images/go-down.png
index 93c3644..c02a83a 100644
--- a/data/images/go-down.png
+++ b/data/images/go-down.png
Binary files differ
diff --git a/data/images/go-up.png b/data/images/go-up.png
index 899e596..1e38916 100644
--- a/data/images/go-up.png
+++ b/data/images/go-up.png
Binary files differ
diff --git a/src/bin/ui/ui.c b/src/bin/ui/ui.c
index 46ff828..5bd58f9 100644
--- a/src/bin/ui/ui.c
+++ b/src/bin/ui/ui.c
@@ -595,25 +595,54 @@ _process_list(void *data, Ecore_Thread *thread)
595 } 595 }
596} 596}
597 597
598static Evas_Object *_selected = NULL;
599
598static void 600static void
599_btn_icon_state_set(Evas_Object *button, Eina_Bool reverse) 601_btn_icon_state_update(Evas_Object *button, Eina_Bool reverse)
600{ 602{
601 Evas_Object *icon = elm_icon_add(button); 603 Evas_Object *icon = elm_icon_add(button);
602 604
605 if (_selected)
606 evas_object_color_set(_selected, 47, 153, 255, 255);
607
603 if (reverse) 608 if (reverse)
604 elm_icon_standard_set(icon, evisum_icon_path_get("go-down")); 609 elm_icon_standard_set(icon, evisum_icon_path_get("go-down"));
605 else 610 else
606 elm_icon_standard_set(icon, evisum_icon_path_get("go-up")); 611 elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
607 612
613 _selected = icon;
614 evas_object_color_set(_selected, 192, 192, 192, 255);
615
608 elm_object_part_content_set(button, "icon", icon); 616 elm_object_part_content_set(button, "icon", icon);
617 evas_object_show(icon);
618}
609 619
620static void
621_btn_icon_state_init(Evas_Object *button, Eina_Bool reverse, Eina_Bool selected)
622{
623 Evas_Object *icon = elm_icon_add(button);
624
625 if (reverse)
626 elm_icon_standard_set(icon, evisum_icon_path_get("go-down"));
627 else
628 elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
629
630 if (!selected)
631 evas_object_color_set(icon, 47, 153, 255, 255);
632 else
633 {
634 _selected = icon;
635 evas_object_color_set(icon, 192, 192, 192, 255);
636 }
637
638 elm_object_part_content_set(button, "icon", icon);
610 evas_object_show(icon); 639 evas_object_show(icon);
611} 640}
612 641
613static void 642static void
614_btn_clicked_state_save(Ui *ui, Evas_Object *btn) 643_btn_clicked_state_save(Ui *ui, Evas_Object *btn)
615{ 644{
616 _btn_icon_state_set(btn, ui->sort_reverse); 645 _btn_icon_state_update(btn, ui->sort_reverse);
617 646
618 _config_save(ui); 647 _config_save(ui);
619 _process_list_update(ui); 648 _process_list_update(ui);
@@ -957,8 +986,9 @@ _ui_content_system_add(Ui *ui)
957 evas_object_show(table); 986 evas_object_show(table);
958 987
959 ui->btn_pid = button = elm_button_add(parent); 988 ui->btn_pid = button = elm_button_add(parent);
960 _btn_icon_state_set(button, 989 _btn_icon_state_init(button,
961 ui->sort_type == SORT_BY_PID ? ui->sort_reverse : EINA_FALSE); 990 ui->sort_type == SORT_BY_PID ? ui->sort_reverse : EINA_FALSE,
991 ui->sort_type == SORT_BY_PID);
962 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 992 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
963 evas_object_size_hint_align_set(button, FILL, FILL); 993 evas_object_size_hint_align_set(button, FILL, FILL);
964 elm_object_text_set(button, _("PID")); 994 elm_object_text_set(button, _("PID"));
@@ -966,8 +996,9 @@ _ui_content_system_add(Ui *ui)
966 elm_table_pack(table, button, i++, 0, 1, 1); 996 elm_table_pack(table, button, i++, 0, 1, 1);
967 997
968 ui->btn_uid = button = elm_button_add(parent); 998 ui->btn_uid = button = elm_button_add(parent);
969 _btn_icon_state_set(button, 999 _btn_icon_state_init(button,
970 ui->sort_type == SORT_BY_UID ? ui->sort_reverse : EINA_FALSE); 1000 ui->sort_type == SORT_BY_UID ? ui->sort_reverse : EINA_FALSE,
1001 ui->sort_type == SORT_BY_UID);
971 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 1002 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
972 evas_object_size_hint_align_set(button, FILL, FILL); 1003 evas_object_size_hint_align_set(button, FILL, FILL);
973 elm_object_text_set(button, _("User")); 1004 elm_object_text_set(button, _("User"));
@@ -975,8 +1006,9 @@ _ui_content_system_add(Ui *ui)
975 elm_table_pack(table, button, i++, 0, 1, 1); 1006 elm_table_pack(table, button, i++, 0, 1, 1);
976 1007
977 ui->btn_size = button = elm_button_add(parent); 1008 ui->btn_size = button = elm_button_add(parent);
978 _btn_icon_state_set(button, 1009 _btn_icon_state_init(button,
979 ui->sort_type == SORT_BY_SIZE ? ui->sort_reverse : EINA_FALSE); 1010 ui->sort_type == SORT_BY_SIZE ? ui->sort_reverse : EINA_FALSE,
1011 ui->sort_type == SORT_BY_SIZE);
980 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 1012 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
981 evas_object_size_hint_align_set(button, FILL, FILL); 1013 evas_object_size_hint_align_set(button, FILL, FILL);
982 elm_object_text_set(button, _("Size")); 1014 elm_object_text_set(button, _("Size"));
@@ -984,8 +1016,9 @@ _ui_content_system_add(Ui *ui)
984 elm_table_pack(table, button, i++, 0, 1, 1); 1016 elm_table_pack(table, button, i++, 0, 1, 1);
985 1017
986 ui->btn_rss = button = elm_button_add(parent); 1018 ui->btn_rss = button = elm_button_add(parent);
987 _btn_icon_state_set(button, 1019 _btn_icon_state_init(button,
988 ui->sort_type == SORT_BY_RSS ? ui->sort_reverse : EINA_FALSE); 1020 ui->sort_type == SORT_BY_RSS ? ui->sort_reverse : EINA_FALSE,
1021 ui->sort_type == SORT_BY_RSS);
989 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 1022 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
990 evas_object_size_hint_align_set(button, FILL, FILL); 1023 evas_object_size_hint_align_set(button, FILL, FILL);
991 elm_object_text_set(button, _("Res")); 1024 elm_object_text_set(button, _("Res"));
@@ -993,8 +1026,9 @@ _ui_content_system_add(Ui *ui)
993 elm_table_pack(table, button, i++, 0, 1, 1); 1026 elm_table_pack(table, button, i++, 0, 1, 1);
994 1027
995 ui->btn_cmd = button = elm_button_add(parent); 1028 ui->btn_cmd = button = elm_button_add(parent);
996 _btn_icon_state_set(button, 1029 _btn_icon_state_init(button,
997 ui->sort_type == SORT_BY_CMD ? ui->sort_reverse : EINA_FALSE); 1030 ui->sort_type == SORT_BY_CMD ? ui->sort_reverse : EINA_FALSE,
1031 ui->sort_type == SORT_BY_CMD);
998 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 1032 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
999 evas_object_size_hint_align_set(button, FILL, FILL); 1033 evas_object_size_hint_align_set(button, FILL, FILL);
1000 elm_object_text_set(button, _("Command")); 1034 elm_object_text_set(button, _("Command"));
@@ -1002,8 +1036,9 @@ _ui_content_system_add(Ui *ui)
1002 elm_table_pack(table, button, i++, 0, 1, 1); 1036 elm_table_pack(table, button, i++, 0, 1, 1);
1003 1037
1004 ui->btn_state = button = elm_button_add(parent); 1038 ui->btn_state = button = elm_button_add(parent);
1005 _btn_icon_state_set(button, 1039 _btn_icon_state_init(button,
1006 ui->sort_type == SORT_BY_STATE ? ui->sort_reverse : EINA_FALSE); 1040 ui->sort_type == SORT_BY_STATE ? ui->sort_reverse : EINA_FALSE,
1041 ui->sort_type == SORT_BY_STATE);
1007 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 1042 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
1008 evas_object_size_hint_align_set(button, FILL, FILL); 1043 evas_object_size_hint_align_set(button, FILL, FILL);
1009 elm_object_text_set(button, _("State")); 1044 elm_object_text_set(button, _("State"));
@@ -1011,8 +1046,9 @@ _ui_content_system_add(Ui *ui)
1011 elm_table_pack(table, button, i++, 0, 1, 1); 1046 elm_table_pack(table, button, i++, 0, 1, 1);
1012 1047
1013 ui->btn_cpu_usage = button = elm_button_add(parent); 1048 ui->btn_cpu_usage = button = elm_button_add(parent);
1014 _btn_icon_state_set(button, 1049 _btn_icon_state_init(button,
1015 ui->sort_type == SORT_BY_CPU_USAGE ? ui->sort_reverse : EINA_FALSE); 1050 ui->sort_type == SORT_BY_CPU_USAGE ? ui->sort_reverse : EINA_FALSE,
1051 ui->sort_type == SORT_BY_CPU_USAGE);
1016 evas_object_size_hint_weight_set(button, EXPAND, EXPAND); 1052 evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
1017 evas_object_size_hint_align_set(button, FILL, FILL); 1053 evas_object_size_hint_align_set(button, FILL, FILL);
1018 elm_object_text_set(button, _("CPU %")); 1054 elm_object_text_set(button, _("CPU %"));
diff --git a/src/bin/ui/ui_disk.c b/src/bin/ui/ui_disk.c
index 7720b80..de6700f 100644
--- a/src/bin/ui/ui_disk.c
+++ b/src/bin/ui/ui_disk.c
@@ -63,7 +63,7 @@ _ui_disk_add(Ui *ui, File_System *inf)
63 evas_object_show(label); 63 evas_object_show(label);
64 elm_box_pack_end(vbox, label); 64 elm_box_pack_end(vbox, label);
65 65
66 elm_object_text_set(label, eina_slstr_printf("<big>%s</big>", 66 elm_object_text_set(label, eina_slstr_printf("%s",
67 inf->mount)); 67 inf->mount));
68 68
69 hbox = elm_box_add(parent); 69 hbox = elm_box_add(parent);
@@ -107,7 +107,7 @@ _ui_disk_add(Ui *ui, File_System *inf)
107 evas_object_show(label); 107 evas_object_show(label);
108 108
109 elm_object_text_set(label, 109 elm_object_text_set(label,
110 eina_slstr_printf("<big>%s <b>(%s)</b></big>", 110 eina_slstr_printf("%s <b>(%s)</b>",
111 inf->path, type)); 111 inf->path, type));
112 112
113 elm_box_pack_end(vbox, label); 113 elm_box_pack_end(vbox, label);
diff --git a/src/bin/ui/ui_memory.c b/src/bin/ui/ui_memory.c
index d99e82d..e92a5fb 100644
--- a/src/bin/ui/ui_memory.c
+++ b/src/bin/ui/ui_memory.c
@@ -15,7 +15,7 @@ _label_mem(Evas_Object *parent, const char *text)
15 Evas_Object *label = elm_label_add(parent); 15 Evas_Object *label = elm_label_add(parent);
16 evas_object_size_hint_weight_set(label, 0, EXPAND); 16 evas_object_size_hint_weight_set(label, 0, EXPAND);
17 evas_object_size_hint_align_set(label, FILL, FILL); 17 evas_object_size_hint_align_set(label, FILL, FILL);
18 elm_object_text_set(label, eina_slstr_printf("<big>%s</big>",text)); 18 elm_object_text_set(label, eina_slstr_printf("%s",text));
19 evas_object_show(label); 19 evas_object_show(label);
20 20
21 return label; 21 return label;
diff --git a/src/bin/ui/ui_misc.c b/src/bin/ui/ui_misc.c
index ccf3fc1..bfd6212 100644
--- a/src/bin/ui/ui_misc.c
+++ b/src/bin/ui/ui_misc.c
@@ -30,9 +30,9 @@ _battery_usage_add(Evas_Object *box, power_t *power)
30 elm_box_pack_end(vbox, label); 30 elm_box_pack_end(vbox, label);
31 31
32 if (power->have_ac && i == 0) 32 if (power->have_ac && i == 0)
33 fmt = _("<big>%s (plugged in) </big>"); 33 fmt = _("%s (plugged in)");
34 else 34 else
35 fmt = _("<big>%s</big>"); 35 fmt = _("%s");
36 36
37 elm_object_text_set(label, eina_slstr_printf(fmt, 37 elm_object_text_set(label, eina_slstr_printf(fmt,
38 power->batteries[i]->name)); 38 power->batteries[i]->name));
@@ -94,7 +94,7 @@ _sensor_usage_add(Evas_Object *box, sensor_t **sensors, int count)
94 evas_object_show(label); 94 evas_object_show(label);
95 elm_box_pack_end(vbox, label); 95 elm_box_pack_end(vbox, label);
96 96
97 elm_object_text_set(label, eina_slstr_printf("<big>%s</big>", 97 elm_object_text_set(label, eina_slstr_printf("%s",
98 snsr->name)); 98 snsr->name));
99 99
100 hbox = elm_box_add(box); 100 hbox = elm_box_add(box);
@@ -171,9 +171,9 @@ _network_usage_add(Ui *ui, Evas_Object *box, uint64_t bytes, Eina_Bool incoming)
171 171
172 label = elm_label_add(box); 172 label = elm_label_add(box);
173 if (incoming) 173 if (incoming)
174 elm_object_text_set(label, _("<big>Network Incoming</big>")); 174 elm_object_text_set(label, _("Network Incoming"));
175 else 175 else
176 elm_object_text_set(label, _("<big>Network Outgoing</big>")); 176 elm_object_text_set(label, _("Network Outgoing"));
177 177
178 evas_object_size_hint_align_set(label, 1.0, FILL); 178 evas_object_size_hint_align_set(label, 1.0, FILL);
179 evas_object_size_hint_weight_set(label, EXPAND, EXPAND); 179 evas_object_size_hint_weight_set(label, EXPAND, EXPAND);
diff --git a/src/bin/ui/ui_process_view.c b/src/bin/ui/ui_process_view.c
index 002c0b4..d1c193e 100644
--- a/src/bin/ui/ui_process_view.c
+++ b/src/bin/ui/ui_process_view.c
@@ -643,6 +643,7 @@ _btn_icon_state_set(Evas_Object *button, Eina_Bool reverse)
643 elm_icon_standard_set(icon, evisum_icon_path_get("go-up")); 643 elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
644 644
645 elm_object_part_content_set(button, "icon", icon); 645 elm_object_part_content_set(button, "icon", icon);
646 evas_object_color_set(icon, 47, 153, 255, 255);
646 647
647 evas_object_show(icon); 648 evas_object_show(icon);
648} 649}