Icons: Add default icons (Use Apostolos E icons).

Minor formatting and use our own icons by Apostolos.
He already created the application icon. These look fine
with flat and dark theme.
This commit is contained in:
Alastair Poole 2020-01-04 12:59:03 +00:00
parent bd588341a8
commit 14344e8bd2
7 changed files with 52 additions and 10 deletions

View File

@ -1,4 +1,4 @@
Alastair Poole <netstar@gmail.com>
Icon:
Icons:
Apostolos Bartziokas <barz621@gmail.com>

BIN
data/images/go-down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
data/images/go-up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

2
data/images/meson.build Normal file
View File

@ -0,0 +1,2 @@
install_data('go-up.png', 'go-down.png',
install_dir: join_paths(dir_data, 'evisum/images'))

View File

@ -1,2 +1,3 @@
subdir('desktop')
subdir('icons')
subdir('images')

View File

@ -26,6 +26,7 @@ dir_locale = join_paths(dir_prefix, get_option('localedir'))
##### config.h
cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
cfg.set_quoted('PACKAGE_DATA_DIR', join_paths(dir_data, 'evisum'))
configure_file(output: 'config.h', configuration: cfg)
subdir('src')

View File

@ -1,3 +1,4 @@
#include "config.h"
#include "system.h"
#include "process.h"
#include "disks.h"
@ -12,6 +13,7 @@
static Eina_Lock _lock;
void
ui_shutdown(Ui *ui)
{
@ -110,6 +112,42 @@ _network_transfer_format(double rate)
return strdup(eina_slstr_printf("%.2f %s", rate, unit));
}
char *
_path_append(const char *path, const char *file)
{
char *concat;
int len;
char separator = '/';
#ifdef WIN32
separator = '\\';
#endif
len = strlen(path) + strlen(file) + 2;
concat = malloc(len * sizeof(char));
snprintf(concat, len, "%s%c%s", path, separator, file);
return concat;
}
const char *
_icon_path_get(const char *name)
{
char *path;
const char *icon_path, *directory = PACKAGE_DATA_DIR "/images";
icon_path = name;
path = _path_append(directory, eina_slstr_printf("%s.png", name));
if (path)
{
if (ecore_file_exists(path))
icon_path = eina_slstr_printf("%s", path);
free(path);
}
return icon_path;
}
static void
_tab_misc_update(Ui *ui, results_t *results)
{
@ -848,9 +886,9 @@ _btn_icon_state_set(Evas_Object *button, Eina_Bool reverse)
{
Evas_Object *icon = elm_icon_add(button);
if (reverse)
elm_icon_standard_set(icon, "go-down");
elm_icon_standard_set(icon, _icon_path_get("go-down"));
else
elm_icon_standard_set(icon, "go-up");
elm_icon_standard_set(icon, _icon_path_get("go-up"));
elm_object_part_content_set(button, "icon", icon);
evas_object_show(icon);