config: save window and height.
If the user finds a comfortable size let's remember it. Someone is bound to ask for that, just make it happen.
This commit is contained in:
parent
f73d85c136
commit
b33d69db8a
|
@ -11,6 +11,8 @@ typedef struct _Evisum_Config
|
||||||
int sort_type;
|
int sort_type;
|
||||||
Eina_Bool sort_reverse;
|
Eina_Bool sort_reverse;
|
||||||
int data_unit;
|
int data_unit;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
} Evisum_Config;
|
} Evisum_Config;
|
||||||
|
|
||||||
void config_init(void);
|
void config_init(void);
|
||||||
|
|
13
src/bin/ui.c
13
src/bin/ui.c
|
@ -27,11 +27,18 @@ typedef struct _Item_Cache {
|
||||||
static void
|
static void
|
||||||
_config_save(Ui *ui)
|
_config_save(Ui *ui)
|
||||||
{
|
{
|
||||||
|
Evas_Coord w, h;
|
||||||
|
|
||||||
if (!_evisum_config) return;
|
if (!_evisum_config) return;
|
||||||
|
if (!ui->ready) return;
|
||||||
|
|
||||||
|
evas_object_geometry_get(ui->win, NULL, NULL, &w, &h);
|
||||||
|
|
||||||
_evisum_config->sort_type = ui->sort_type;
|
_evisum_config->sort_type = ui->sort_type;
|
||||||
_evisum_config->sort_reverse = ui->sort_reverse;
|
_evisum_config->sort_reverse = ui->sort_reverse;
|
||||||
_evisum_config->data_unit = ui->data_unit;
|
_evisum_config->data_unit = ui->data_unit;
|
||||||
|
_evisum_config->width = w;
|
||||||
|
_evisum_config->height = h;
|
||||||
|
|
||||||
config_save(_evisum_config);
|
config_save(_evisum_config);
|
||||||
}
|
}
|
||||||
|
@ -43,6 +50,11 @@ _config_load(Ui *ui)
|
||||||
ui->sort_type = _evisum_config->sort_type;
|
ui->sort_type = _evisum_config->sort_type;
|
||||||
ui->sort_reverse = _evisum_config->sort_reverse;
|
ui->sort_reverse = _evisum_config->sort_reverse;
|
||||||
ui->data_unit = _evisum_config->data_unit == 0 ? DATA_UNIT_MB : _evisum_config->data_unit;
|
ui->data_unit = _evisum_config->data_unit == 0 ? DATA_UNIT_MB : _evisum_config->data_unit;
|
||||||
|
|
||||||
|
if (_evisum_config->width > 0 && _evisum_config->height > 0)
|
||||||
|
{
|
||||||
|
evas_object_resize(ui->win, _evisum_config->width, _evisum_config->height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2808,6 +2820,7 @@ _evisum_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
|
|
||||||
elm_genlist_clear(ui->genlist_procs);
|
elm_genlist_clear(ui->genlist_procs);
|
||||||
_process_panel_update(ui);
|
_process_panel_update(ui);
|
||||||
|
_config_save(ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#define EVISUM_SIZE_WIDTH 600
|
#define EVISUM_SIZE_WIDTH 640
|
||||||
#define EVISUM_SIZE_HEIGHT 520
|
#define EVISUM_SIZE_HEIGHT 480
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,6 @@ typedef enum
|
||||||
SORT_BY_CPU_USAGE,
|
SORT_BY_CPU_USAGE,
|
||||||
} Sort_Type;
|
} Sort_Type;
|
||||||
|
|
||||||
#define TEXT_FIELD_MAX 65535
|
|
||||||
#define TAB_BTN_SIZE 75
|
#define TAB_BTN_SIZE 75
|
||||||
|
|
||||||
typedef struct Ui
|
typedef struct Ui
|
||||||
|
|
Loading…
Reference in New Issue