diff --git a/data/images/go-down.png b/data/images/go-down.png
index 93c3644..c02a83a 100644
Binary files a/data/images/go-down.png and b/data/images/go-down.png differ
diff --git a/data/images/go-up.png b/data/images/go-up.png
index 899e596..1e38916 100644
Binary files a/data/images/go-up.png and b/data/images/go-up.png 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,8 +595,30 @@ _process_list(void *data, Ecore_Thread *thread)
}
}
+static Evas_Object *_selected = NULL;
+
static void
-_btn_icon_state_set(Evas_Object *button, Eina_Bool reverse)
+_btn_icon_state_update(Evas_Object *button, Eina_Bool reverse)
+{
+ Evas_Object *icon = elm_icon_add(button);
+
+ if (_selected)
+ evas_object_color_set(_selected, 47, 153, 255, 255);
+
+ if (reverse)
+ elm_icon_standard_set(icon, evisum_icon_path_get("go-down"));
+ else
+ elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
+
+ _selected = icon;
+ evas_object_color_set(_selected, 192, 192, 192, 255);
+
+ elm_object_part_content_set(button, "icon", icon);
+ evas_object_show(icon);
+}
+
+static void
+_btn_icon_state_init(Evas_Object *button, Eina_Bool reverse, Eina_Bool selected)
{
Evas_Object *icon = elm_icon_add(button);
@@ -605,15 +627,22 @@ _btn_icon_state_set(Evas_Object *button, Eina_Bool reverse)
else
elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
- elm_object_part_content_set(button, "icon", icon);
+ if (!selected)
+ evas_object_color_set(icon, 47, 153, 255, 255);
+ else
+ {
+ _selected = icon;
+ evas_object_color_set(icon, 192, 192, 192, 255);
+ }
+ elm_object_part_content_set(button, "icon", icon);
evas_object_show(icon);
}
static void
_btn_clicked_state_save(Ui *ui, Evas_Object *btn)
{
- _btn_icon_state_set(btn, ui->sort_reverse);
+ _btn_icon_state_update(btn, ui->sort_reverse);
_config_save(ui);
_process_list_update(ui);
@@ -957,8 +986,9 @@ _ui_content_system_add(Ui *ui)
evas_object_show(table);
ui->btn_pid = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_PID ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_PID ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_PID);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
elm_object_text_set(button, _("PID"));
@@ -966,8 +996,9 @@ _ui_content_system_add(Ui *ui)
elm_table_pack(table, button, i++, 0, 1, 1);
ui->btn_uid = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_UID ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_UID ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_UID);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
elm_object_text_set(button, _("User"));
@@ -975,8 +1006,9 @@ _ui_content_system_add(Ui *ui)
elm_table_pack(table, button, i++, 0, 1, 1);
ui->btn_size = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_SIZE ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_SIZE ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_SIZE);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
elm_object_text_set(button, _("Size"));
@@ -984,8 +1016,9 @@ _ui_content_system_add(Ui *ui)
elm_table_pack(table, button, i++, 0, 1, 1);
ui->btn_rss = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_RSS ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_RSS ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_RSS);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
elm_object_text_set(button, _("Res"));
@@ -993,8 +1026,9 @@ _ui_content_system_add(Ui *ui)
elm_table_pack(table, button, i++, 0, 1, 1);
ui->btn_cmd = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_CMD ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_CMD ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_CMD);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
elm_object_text_set(button, _("Command"));
@@ -1002,8 +1036,9 @@ _ui_content_system_add(Ui *ui)
elm_table_pack(table, button, i++, 0, 1, 1);
ui->btn_state = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_STATE ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_STATE ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_STATE);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
elm_object_text_set(button, _("State"));
@@ -1011,8 +1046,9 @@ _ui_content_system_add(Ui *ui)
elm_table_pack(table, button, i++, 0, 1, 1);
ui->btn_cpu_usage = button = elm_button_add(parent);
- _btn_icon_state_set(button,
- ui->sort_type == SORT_BY_CPU_USAGE ? ui->sort_reverse : EINA_FALSE);
+ _btn_icon_state_init(button,
+ ui->sort_type == SORT_BY_CPU_USAGE ? ui->sort_reverse : EINA_FALSE,
+ ui->sort_type == SORT_BY_CPU_USAGE);
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
evas_object_size_hint_align_set(button, FILL, FILL);
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)
evas_object_show(label);
elm_box_pack_end(vbox, label);
- elm_object_text_set(label, eina_slstr_printf("%s",
+ elm_object_text_set(label, eina_slstr_printf("%s",
inf->mount));
hbox = elm_box_add(parent);
@@ -107,7 +107,7 @@ _ui_disk_add(Ui *ui, File_System *inf)
evas_object_show(label);
elm_object_text_set(label,
- eina_slstr_printf("%s (%s)",
+ eina_slstr_printf("%s (%s)",
inf->path, type));
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)
Evas_Object *label = elm_label_add(parent);
evas_object_size_hint_weight_set(label, 0, EXPAND);
evas_object_size_hint_align_set(label, FILL, FILL);
- elm_object_text_set(label, eina_slstr_printf("%s",text));
+ elm_object_text_set(label, eina_slstr_printf("%s",text));
evas_object_show(label);
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)
elm_box_pack_end(vbox, label);
if (power->have_ac && i == 0)
- fmt = _("%s (plugged in) ");
+ fmt = _("%s (plugged in)");
else
- fmt = _("%s");
+ fmt = _("%s");
elm_object_text_set(label, eina_slstr_printf(fmt,
power->batteries[i]->name));
@@ -94,7 +94,7 @@ _sensor_usage_add(Evas_Object *box, sensor_t **sensors, int count)
evas_object_show(label);
elm_box_pack_end(vbox, label);
- elm_object_text_set(label, eina_slstr_printf("%s",
+ elm_object_text_set(label, eina_slstr_printf("%s",
snsr->name));
hbox = elm_box_add(box);
@@ -171,9 +171,9 @@ _network_usage_add(Ui *ui, Evas_Object *box, uint64_t bytes, Eina_Bool incoming)
label = elm_label_add(box);
if (incoming)
- elm_object_text_set(label, _("Network Incoming"));
+ elm_object_text_set(label, _("Network Incoming"));
else
- elm_object_text_set(label, _("Network Outgoing"));
+ elm_object_text_set(label, _("Network Outgoing"));
evas_object_size_hint_align_set(label, 1.0, FILL);
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)
elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
elm_object_part_content_set(button, "icon", icon);
+ evas_object_color_set(icon, 47, 153, 255, 255);
evas_object_show(icon);
}