netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=e26e1bb3920d24f96165c4514bb1d0e03abbf09e

commit e26e1bb3920d24f96165c4514bb1d0e03abbf09e
Author: Alastair Poole <[email protected]>
Date:   Sat Jun 20 11:02:23 2020 +0100

    ui: button sizing.
---
 src/bin/ui/ui.c              | 18 ++++++++++++------
 src/bin/ui/ui.h              |  3 ++-
 src/bin/ui/ui_process_view.c |  9 ++++++---
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/bin/ui/ui.c b/src/bin/ui/ui.c
index ff397c9..0b63dc0 100644
--- a/src/bin/ui/ui.c
+++ b/src/bin/ui/ui.c
@@ -1241,7 +1241,8 @@ _ui_tabs_add(Evas_Object *parent, Ui *ui)
    evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
    evas_object_size_hint_align_set(button, FILL, FILL);
    evas_object_size_hint_min_set(button,
-                   elm_config_scale_get() * TAB_BTN_SIZE, 0);
+                   elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(button, _("General"));
    evas_object_show(button);
    elm_object_content_set(border, button);
@@ -1259,7 +1260,8 @@ _ui_tabs_add(Evas_Object *parent, Ui *ui)
    evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
    evas_object_size_hint_align_set(button, FILL, FILL);
    evas_object_size_hint_min_set(button,
-                   elm_config_scale_get() * TAB_BTN_SIZE, 0);
+                   elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(button, _("CPU"));
    elm_object_content_set(border, button);
    evas_object_show(button);
@@ -1277,7 +1279,8 @@ _ui_tabs_add(Evas_Object *parent, Ui *ui)
    evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
    evas_object_size_hint_align_set(button, FILL, FILL);
    evas_object_size_hint_min_set(button,
-                   elm_config_scale_get() * TAB_BTN_SIZE, 0);
+                   elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(button, _("Memory"));
    evas_object_show(button);
    elm_object_content_set(border, button);
@@ -1295,7 +1298,8 @@ _ui_tabs_add(Evas_Object *parent, Ui *ui)
    evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
    evas_object_size_hint_align_set(button, FILL, FILL);
    evas_object_size_hint_min_set(button,
-                   elm_config_scale_get() * TAB_BTN_SIZE, 0);
+                   elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(button, _("Storage"));
    evas_object_show(button);
    elm_object_content_set(border, button);
@@ -1313,7 +1317,8 @@ _ui_tabs_add(Evas_Object *parent, Ui *ui)
    evas_object_size_hint_weight_set(button, FILL, EXPAND);
    evas_object_size_hint_align_set(button, FILL, FILL);
    evas_object_size_hint_min_set(button,
-                   elm_config_scale_get() * TAB_BTN_SIZE, 0);
+                   elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(button, _("Misc"));
    evas_object_show(button);
    elm_object_content_set(border, button);
@@ -1373,7 +1378,8 @@ _ui_tabs_add(Evas_Object *parent, Ui *ui)
    evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
    evas_object_size_hint_align_set(button, FILL, FILL);
    evas_object_size_hint_min_set(button,
-                   TAB_BTN_SIZE * elm_config_scale_get(), 0),
+                   TAB_BTN_WIDTH * elm_config_scale_get(),
+                   TAB_BTN_HEIGHT * elm_config_scale_get()),
    elm_object_text_set(button, _("Close"));
    elm_object_content_set(border, button);
    elm_box_pack_end(box, border);
diff --git a/src/bin/ui/ui.h b/src/bin/ui/ui.h
index af01141..05db633 100644
--- a/src/bin/ui/ui.h
+++ b/src/bin/ui/ui.h
@@ -31,7 +31,8 @@ typedef enum
    SORT_BY_CPU_USAGE,
 } Sort_Type;
 
-#define TAB_BTN_SIZE 96
+#define TAB_BTN_WIDTH  96
+#define TAB_BTN_HEIGHT 32
 
 typedef struct Ui
 {
diff --git a/src/bin/ui/ui_process_view.c b/src/bin/ui/ui_process_view.c
index 034fa6e..b3458e3 100644
--- a/src/bin/ui/ui_process_view.c
+++ b/src/bin/ui/ui_process_view.c
@@ -947,7 +947,8 @@ _tabs_add(Evas_Object *parent, Ui_Process *ui)
    ui->btn_main = btn = elm_button_add(parent);
    evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
    evas_object_size_hint_align_set(btn, FILL, FILL);
-   evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_SIZE, 
1);
+   evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(btn, _("Process"));
    elm_object_disabled_set(btn, EINA_TRUE);
    evas_object_show(btn);
@@ -964,7 +965,8 @@ _tabs_add(Evas_Object *parent, Ui_Process *ui)
    ui->btn_thread = btn = elm_button_add(parent);
    evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
    evas_object_size_hint_align_set(btn, FILL, FILL);
-   evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_SIZE, 
1);
+   evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(btn, _("Threads"));
    elm_object_disabled_set(btn, EINA_FALSE);
    evas_object_show(btn);
@@ -981,7 +983,8 @@ _tabs_add(Evas_Object *parent, Ui_Process *ui)
    ui->btn_info = btn = elm_button_add(parent);
    evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
    evas_object_size_hint_align_set(btn, FILL, FILL);
-   evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_SIZE, 
1);
+   evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_WIDTH,
+                   elm_config_scale_get() * TAB_BTN_HEIGHT);
    elm_object_text_set(btn, _("Manual"));
    evas_object_show(btn);
    elm_object_content_set(pad, btn);

-- 


Reply via email to